diff --git a/public/assets/img/terminal.svg b/public/assets/img/steps/certbot.svg similarity index 100% rename from public/assets/img/terminal.svg rename to public/assets/img/steps/certbot.svg diff --git a/public/assets/img/download-cloud.svg b/public/assets/img/steps/download.svg similarity index 100% rename from public/assets/img/download-cloud.svg rename to public/assets/img/steps/download.svg diff --git a/public/assets/img/check-circle.svg b/public/assets/img/steps/live.svg similarity index 100% rename from public/assets/img/check-circle.svg rename to public/assets/img/steps/live.svg diff --git a/public/assets/img/lock.svg b/public/assets/img/steps/ssl.svg similarity index 100% rename from public/assets/img/lock.svg rename to public/assets/img/steps/ssl.svg diff --git a/public/partials/commands-do.html b/public/partials/commands-do.html new file mode 100644 index 0000000..2512515 --- /dev/null +++ b/public/partials/commands-do.html @@ -0,0 +1,98 @@ +
    +
  1. + Download generated config: nginxconfig.io-{{ getDomains().join(',') }}.zip +
  2. +
  3. + Upload to server's {{ data.directory_nginx.replace(endingSlashRegex, '') }} directory
    + or Copy as Base64 string: Copy to clipboard and Paste from clipboard and run the command
    + (echo 'BASE64' | base64 --decode > {{ data.directory_nginx }}nginxconfig.io-{{ getDomains().join(',') }}.zip) +
  4. +
  5. + Go to NGINX directory (over SSH):
    + cd {{ data.directory_nginx.replace(endingSlashRegex, '') }} +
  6. +
  7. + Backup current configuration:
    + tar -czvf nginx_$(date +'%F_%H-%M-%S').tar.gz nginx.conf sites-available/ sites-enabled/ nginxconfig.io/ +
  8. +
  9. + Unzip the uploaded archive:
    + unzip -o nginxconfig.io-{{ getDomains().join(',') }}.zip
    + (you probably need to install unzip: sudo apt-get install unzip) +
  10. +
  1. Generate Diffie-Hellman keys:
    + openssl dhparam -out {{ data.directory_nginx }}dhparam.pem {{ sslProfiles[ data.ssl_profile ].dh_param_size }} +
  2. Create a common ACME-challenge directory (for Let's Encrypt):
    + mkdir -p {{ data.directory_letsencrypt.replace(endingSlashRegex, '') }}
    + chown {{ data.user }} {{ data.directory_letsencrypt.replace(endingSlashRegex, '') }}
    +
  1. + Comment out SSL related directives in configuration:
    + sed -i -r 's/(listen .*443)/\1;#/g; s/(ssl_(certificate|certificate_key|trusted_certificate) )/#;#\1/g' {{ data.directory_nginx }}nginx.conf {{ data.directory_nginx }}sites-{{ isSymlink() ? 'available' : 'enabled' }}/{{ _domain }}.conf +
  2. +
  3. + Reload NGINX:
    + sudo nginx -t && sudo systemctl reload nginx +
  4. +
  5. + Obtain certificate{{ getDomains().length > 1 ? 's' : '' }}:
    +
    + certbot certonly --webroot -d {{ _domain.indexOf('-') !== -1 ? '"' + _domain + '"' : _domain }} -d {{ _domain.indexOf('-') !== -1 ? '"' : '' }}www.{{ _domain }}{{ _domain.indexOf('-') !== -1 ? '"' : '' }} -d {{ _domain.indexOf('-') !== -1 ? '"' : '' }}cdn.{{ _domain }}{{ _domain.indexOf('-') !== -1 ? '"' : '' }} --email {{ data.sites[_site].email ? data.sites[_site].email : 'info@' + _domain }} -w {{ data.directory_letsencrypt.replace(endingSlashRegex, '') }} -n --agree-tos --force-renewal
    +
  6. +
  7. + Reload NGINX:
    + sudo nginx -t && sudo systemctl reload nginx +
  8. +
  9. + Configure Certbot to reload NGINX after success renew:
    + echo -e '#!/bin/bash\nnginx -t && systemctl reload nginx' | sudo tee /etc/letsencrypt/renewal-hooks/post/nginx-reload.sh
    + sudo chmod a+x /etc/letsencrypt/renewal-hooks/post/nginx-reload.sh +
  10. +
  1. + Reload NGINX:
    + sudo nginx -t && sudo systemctl reload nginx +
diff --git a/public/templates/commands.html b/public/partials/commands.html similarity index 96% rename from public/templates/commands.html rename to public/partials/commands.html index ece3e3a..6ad0dc9 100644 --- a/public/templates/commands.html +++ b/public/partials/commands.html @@ -1,4 +1,4 @@ -