[mod] added PRODUCTION check for certbot

This commit is contained in:
2020-04-05 20:36:15 -04:00
parent b14fc1f0c1
commit 0e537ee1cd
3 changed files with 19 additions and 11 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
production.env

View File

@@ -138,17 +138,23 @@ function get_cert()
if [ $webserver_exists -eq 1 ] ; then if [ $webserver_exists -eq 1 ] ; then
log get_cert "Getting cert for [$root_domain] with [$domains]" log get_cert "Getting cert for [$root_domain] with [$domains]"
# certbotx certonly \ # PRODUCTION needs to be set in env
# --config-dir "$cert_bot_path" \ if [ -z ${PRODUCTION+x} ]; then
# --agree-tos \ log WARNING get_cert "PRODUCTION not set, exiting"
# --domains "$domains" \ return 0
# --email "contact@${root_domain}" \ fi
# --no-eff-email \ log get_cert "Running certbot"
# --expand \ certbot certonly \
# --noninteractive \ --config-dir "$cert_bot_path" \
# --webroot \ --agree-tos \
# --webroot-path "$web_root_path" \ --domains "$domains" \
# $OPTIONS || true --email "contact@${root_domain}" \
--no-eff-email \
--expand \
--noninteractive \
--webroot \
--webroot-path "$web_root_path"
# $OPTIONS || true
else else
log get_cert ERROR "Webserver for [$root_domain] not reachable after $server_retries retries" log get_cert ERROR "Webserver for [$root_domain] not reachable after $server_retries retries"
return 1 return 1

View File

@@ -35,6 +35,7 @@ services:
GROUP_UID: ${UID_PROXY:-12002} GROUP_UID: ${UID_PROXY:-12002}
env_file: env_file:
- ./certbot/files/domains.env - ./certbot/files/domains.env
- ./production.env # set PRODUCTION= here
restart: always restart: always
image: certbot image: certbot
container_name: certbot container_name: certbot