@@ -3,11 +3,13 @@ LETSENCRYPT_CONTAINERS=(
3
3
{{ if trim $hosts }}
4
4
{{ range $container := $containers }}
5
5
{{ if parseBool (coalesce $container.Env.LETSENCRYPT_SINGLE_DOMAIN_CERTS "false") }}
6
+ {{/* Explicit per-domain splitting of the certificate */}}
6
7
{{ range $host := split $hosts "," }}
7
8
{{ $host := trim $host }}
8
9
{{- "\t"}}'{{ printf "%.12s" $container.ID }}_{{ sha1 $host }}'
9
10
{{ end }}
10
11
{{ else }}
12
+ {{/* Default: multi-domain (SAN) certificate */}}
11
13
{{- "\t"}}'{{ printf "%.12s" $container.ID }}'
12
14
{{ end }}
13
15
{{ end }}
@@ -18,6 +20,7 @@ LETSENCRYPT_CONTAINERS=(
18
20
{{ range $hosts, $containers := groupBy $ "Env.LETSENCRYPT_HOST" }}
19
21
{{ $hosts := trimSuffix "," $hosts }}
20
22
{{ range $container := $containers }}
23
+ {{/* Trim spaces and set empty values on per-container environment variables */}}
21
24
{{ $KEYSIZE := trim (coalesce $container.Env.LETSENCRYPT_KEYSIZE "") }}
22
25
{{ $STAGING := trim (coalesce $container.Env.LETSENCRYPT_TEST "") }}
23
26
{{ $EMAIL := trim (coalesce $container.Env.LETSENCRYPT_EMAIL "") }}
@@ -30,6 +33,7 @@ LETSENCRYPT_CONTAINERS=(
30
33
{{ $RESTART_CONTAINER := trim (coalesce $container.Env.LETSENCRYPT_RESTART_CONTAINER "") }}
31
34
{{ $cid := printf "%.12s" $container.ID }}
32
35
{{ if parseBool (coalesce $container.Env.LETSENCRYPT_SINGLE_DOMAIN_CERTS "false") }}
36
+ {{/* Explicit per-domain splitting of the certificate */}}
33
37
{{ range $host := split $hosts "," }}
34
38
{{ $host := trim $host }}
35
39
{{ $host := trimSuffix "." $host }}
@@ -47,6 +51,7 @@ LETSENCRYPT_CONTAINERS=(
47
51
{{- "\n" }}LETSENCRYPT_{{ $cid }}_{{ $hostHash }}_RESTART_CONTAINER="{{ $RESTART_CONTAINER }}"
48
52
{{ end }}
49
53
{{ else }}
54
+ {{/* Default: multi-domain (SAN) certificate */}}
50
55
{{- "\n" }}LETSENCRYPT_{{ $cid }}_HOST=(
51
56
{{- range $host := split $hosts "," }}
52
57
{{- $host := trim $host }}
0 commit comments