diff -ruN smeserver-letsencrypt-0.5.old/root/etc/e-smith/templates/etc/dehydrated/config/10Default smeserver-letsencrypt-0.5/root/etc/e-smith/templates/etc/dehydrated/config/10Default --- smeserver-letsencrypt-0.5.old/root/etc/e-smith/templates/etc/dehydrated/config/10Default 2020-01-17 11:54:35.903578792 +0100 +++ smeserver-letsencrypt-0.5/root/etc/e-smith/templates/etc/dehydrated/config/10Default 2020-01-17 12:48:44.752482453 +0100 @@ -15,35 +15,44 @@ $OUT .= "#!/bin/bash\n"; - $OUT .= "WELLKNOWN=\"/home/e-smith/files/ibays/Primary/html/.well-known/acme-challenge\"\n"; - - if ( $letsencryptStatus eq 'test' ) { + if ( $letsencryptStatus eq 'disabled' ) { + $OUT .= "letsencrypt is disabled"; + } + else { + # We should only be here if we are not disabled + if ( $letsencryptStatus eq 'test' ) { - # Use staging directory for testing - # Once you are sure you have the settings right then change + # Use staging directory for testing + # Once you are sure you have the settings right then change - # If it's v1 then use v1, if v2 or auto then use v2 staging - if ( $letsencryptAPI eq '1' ) { - $OUT .= "CA=\"https://acme-staging.api.letsencrypt.org/directory\"\n"; + # If it's v1 then use v1, if v2 or auto then use v2 staging + if ( $letsencryptAPI eq '1' ) { + $OUT .= "CA=\"https://acme-staging.api.letsencrypt.org/directory\"\n"; + } + elsif ( ( $letsencryptAPI eq '2' ) || ( $letsencryptAPI eq 'auto' ) ) { + $OUT .= "CA=\"https://acme-staging-v02.api.letsencrypt.org/directory\"\n"; + } } - elsif (( $letsencryptAPI eq '2' ) || ( $letsencryptAPI eq 'auto' )) { - $OUT .= "CA=\"https://acme-staging-v02.api.letsencrypt.org/directory\"\n"; - } - } - elsif ( $letsencryptStatus ne 'test' ) { + elsif ( $letsencryptStatus ne 'test' ) { - # Real server - default setting in the the main file - # Only use this once you are sure things are OK or you will hit a rate limit. + # Real server - default settings are in the the main dehydrated file + # Only use this once you are sure things are OK or you will hit a rate limit. - # If it's v1 then use v1, if v2 then v2, if auto accept the defaults in the main file - if ( $letsencryptAPI eq '1' ) { - $OUT .= "CA=\"https://acme-v01.api.letsencrypt.org/directory\"\n"; - } - elsif ( $letsencryptAPI eq '2' ) { - $OUT .= "CA=\"https://acme-v02.api.letsencrypt.org/directory\"\n"; + # If it's v1 then use v1, if v2 then v2, if auto accept the defaults in the main file + if ( $letsencryptAPI eq '1' ) { + $OUT .= "CA=\"https://acme-v01.api.letsencrypt.org/directory\"\n"; + } + elsif ( $letsencryptAPI eq '2' ) { + $OUT .= "CA=\"https://acme-v02.api.letsencrypt.org/directory\"\n"; + } } + $OUT .= "WELLKNOWN=\"/home/e-smith/files/ibays/Primary/html/.well-known/acme-challenge\"\n"; + + # Hook Script always enabled + $OUT .= "HOOK=\"/usr/bin/hook-script.sh\"\n"; + # Base directory for account key, generated certificates and list of domains (default: $SCRIPTDIR -- uses config directory if undefined) #BASEDIR=$SCRIPTDIR @@ -67,11 +76,7 @@ $OUT .= "CONTACT_EMAIL=$letsencryptEmail\n"; } - # Hook Script always enabled - $OUT .= "HOOK=\"/usr/bin/hook-script.sh\"\n"; - # API version - auto | 1 | 2 - if ( $letsencryptAPI eq '1' ) { $OUT .= "API=\"1\"\n"; } @@ -81,6 +86,5 @@ else { $OUT .= "API=\"auto\"\n"; } - } }