@@ -3,11 +3,13 @@ LETSENCRYPT_CONTAINERS=(
33 {{ if trim $hosts }}
44 {{ range $container := $containers }}
55 {{ if parseBool (coalesce $container.Env.LETSENCRYPT_SINGLE_DOMAIN_CERTS "false") }}
6+ {{/* Explicit per-domain splitting of the certificate */}}
67 {{ range $host := split $hosts "," }}
78 {{ $host := trim $host }}
89 {{- "\t"}}'{{ printf "%.12s" $container.ID }}_{{ sha1 $host }}'
910 {{ end }}
1011 {{ else }}
12+ {{/* Default: multi-domain (SAN) certificate */}}
1113 {{- "\t"}}'{{ printf "%.12s" $container.ID }}'
1214 {{ end }}
1315 {{ end }}
@@ -18,6 +20,7 @@ LETSENCRYPT_CONTAINERS=(
1820{{ range $hosts, $containers := groupBy $ "Env.LETSENCRYPT_HOST" }}
1921 {{ $hosts := trimSuffix "," $hosts }}
2022 {{ range $container := $containers }}
23+ {{/* Trim spaces and set empty values on per-container environment variables */}}
2124 {{ $KEYSIZE := trim (coalesce $container.Env.LETSENCRYPT_KEYSIZE "") }}
2225 {{ $STAGING := trim (coalesce $container.Env.LETSENCRYPT_TEST "") }}
2326 {{ $EMAIL := trim (coalesce $container.Env.LETSENCRYPT_EMAIL "") }}
@@ -30,6 +33,7 @@ LETSENCRYPT_CONTAINERS=(
3033 {{ $RESTART_CONTAINER := trim (coalesce $container.Env.LETSENCRYPT_RESTART_CONTAINER "") }}
3134 {{ $cid := printf "%.12s" $container.ID }}
3235 {{ if parseBool (coalesce $container.Env.LETSENCRYPT_SINGLE_DOMAIN_CERTS "false") }}
36+ {{/* Explicit per-domain splitting of the certificate */}}
3337 {{ range $host := split $hosts "," }}
3438 {{ $host := trim $host }}
3539 {{ $host := trimSuffix "." $host }}
@@ -47,6 +51,7 @@ LETSENCRYPT_CONTAINERS=(
4751 {{- "\n" }}LETSENCRYPT_{{ $cid }}_{{ $hostHash }}_RESTART_CONTAINER="{{ $RESTART_CONTAINER }}"
4852 {{ end }}
4953 {{ else }}
54+ {{/* Default: multi-domain (SAN) certificate */}}
5055 {{- "\n" }}LETSENCRYPT_{{ $cid }}_HOST=(
5156 {{- range $host := split $hosts "," }}
5257 {{- $host := trim $host }}
0 commit comments