nginx: rework directory so that certbot works

single-dockerfile
Trammell Hudson 3 years ago
parent 64efdf9211
commit 357642d27e
  1. 7
      nginx/certbot-renew
  2. 8
      nginx/docker-compose.yaml
  3. 0
      nginx/nginx/includes/challenge.conf
  4. 0
      nginx/nginx/includes/options-ssl-nginx.conf
  5. 0
      nginx/nginx/includes/ssl-dhparams.pem
  6. 0
      nginx/nginx/nginx.conf
  7. 6
      nginx/nginx/templates/000-default.conf.template
  8. 6
      nginx/nginx/templates/cloud.conf.template
  9. 6
      nginx/nginx/templates/docs.conf.template
  10. 6
      nginx/nginx/templates/login.conf.template
  11. 6
      nginx/nginx/templates/social.conf.template

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
die() { echo >&2 "$@" ; exit 1 ; }
source ../env.production source ../env.production
source ./env.production source ./env.production
@ -7,12 +9,17 @@ rsa_key_size=2048
set -x set -x
# move the old live directory away
rm -rf data/certbot/conf/live.old
mv data/certbot/conf/live data/certbot/conf/live.old
docker-compose run --rm certbot \ docker-compose run --rm certbot \
certonly --webroot -w /var/www/certbot \ certonly --webroot -w /var/www/certbot \
$staging_arg \ $staging_arg \
--email "admin@$DOMAIN_NAME" \ --email "admin@$DOMAIN_NAME" \
--rsa-key-size $rsa_key_size \ --rsa-key-size $rsa_key_size \
--agree-tos \ --agree-tos \
--no-eff-email \
--force-renewal \ --force-renewal \
$domain_args \ $domain_args \
|| die "unable to renew!" || die "unable to renew!"

@ -6,11 +6,11 @@ services:
- "80:80" - "80:80"
- "443:443" - "443:443"
volumes: volumes:
- ./data/nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/nginx.conf:/etc/nginx/nginx.conf
#- ./data/nginx/sites-enabled:/etc/nginx/sites-enabled - ./nginx/templates:/etc/nginx/templates
- ./data/nginx/templates:/etc/nginx/templates - ./nginx/includes:/etc/nginx/includes
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot - ./data/certbot/www:/var/www/certbot
- ./data/certbot/conf:/etc/letsencrypt
env_file: env_file:
- ../env.production - ../env.production
- env.production - env.production

@ -32,9 +32,9 @@ server {
listen 443 ssl; listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem; ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf; include /etc/nginx/includes/options-ssl-nginx.conf;
include /etc/letsencrypt/challenge.conf; include /etc/nginx/includes/challenge.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; ssl_dhparam /etc/nginx/includes/ssl-dhparams.pem;
} }

@ -45,9 +45,9 @@ server {
listen 443 ssl; listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem; ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf; include /etc/nginx/includes/options-ssl-nginx.conf;
include /etc/letsencrypt/challenge.conf; include /etc/nginx/includes/challenge.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; ssl_dhparam /etc/nginx/includes/ssl-dhparams.pem;
} }

@ -52,9 +52,9 @@ server {
listen 443 ssl; listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem; ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf; include /etc/nginx/includes/options-ssl-nginx.conf;
include /etc/letsencrypt/challenge.conf; include /etc/nginx/includes/challenge.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; ssl_dhparam /etc/nginx/includes/ssl-dhparams.pem;
} }

@ -21,9 +21,9 @@ server {
listen 443 ssl; listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem; ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf; include /etc/nginx/includes/options-ssl-nginx.conf;
include /etc/letsencrypt/challenge.conf; include /etc/nginx/includes/challenge.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; ssl_dhparam /etc/nginx/includes/ssl-dhparams.pem;
} }

@ -20,9 +20,9 @@ server {
listen 443 ssl; listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem; ssl_certificate /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf; include /etc/nginx/includes/options-ssl-nginx.conf;
include /etc/letsencrypt/challenge.conf; include /etc/nginx/includes/challenge.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; ssl_dhparam /etc/nginx/includes/ssl-dhparams.pem;
} }
Loading…
Cancel
Save