From 319bb24d14756052b4d0cfc7f5a15bcf21f673e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szekeres=20Ba=CC=81lint?= Date: Sun, 2 Dec 2018 17:13:48 +0100 Subject: [PATCH] sed commands for SSL directives disable/enable --- public/templates/commands.html | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/public/templates/commands.html b/public/templates/commands.html index 4f4a2b3..2b14a0e 100644 --- a/public/templates/commands.html +++ b/public/templates/commands.html @@ -20,10 +20,17 @@ ✔ Let's Encrypt --># HTTPS: create ACME-challenge common directory +--># HTTPS - certbot (before first run): create ACME-challenge common directory sudo -u {{ data.user }} sh -c "mkdir -p /var/www/_letsencrypt" -# HTTPS: certbot (obtain certificates)
# disable before first run: listen, ssl_certificate, ssl_certificate_key, ssl_trusted_certificate in HTTPS server
+# HTTPS - certbot (before first run): disable SSL directives +sed -i -r 's/listen (.*)443/listen \1443;#/g; s/ssl_(certificate|certificate_key|trusted_certificate) /#;#ssl_\1/g' /etc/nginx/sites-{{ isSymlink() ? 'available' : 'enabled' }}/{{ domain() }}.conf + +# HTTPS - certbot: obtain certificates certbot certonly --webroot -d {{ domain() }} -w /var/www/_letsencrypt -n --agree-tos --force-renewal--force-renewal + +# HTTPS - certbot (after first run): enable SSL directives +sed -i -r 's/#?;#//g' /etc/nginx/sites-{{ isSymlink() ? 'available' : 'enabled' }}/{{ domain() }}.conf +