Skip to content
This repository was archived by the owner on Jan 6, 2021. It is now read-only.

Commit d4d5fb1

Browse files
authored
Merge pull request #444 from linuxserver/propagation
Add propagation parameter for dns validation, add whois
2 parents 9aa9dd3 + 0fe03f1 commit d4d5fb1

File tree

7 files changed

+43
-24
lines changed

7 files changed

+43
-24
lines changed

Diff for: Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ RUN \
8383
php7-zip \
8484
py3-cryptography \
8585
py3-future \
86-
py3-pip && \
86+
py3-pip \
87+
whois && \
8788
echo "**** install certbot plugins ****" && \
8889
if [ -z ${CERTBOT_VERSION+x} ]; then \
8990
CERTBOT="certbot"; \

Diff for: Dockerfile.aarch64

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ RUN \
8383
php7-zip \
8484
py3-cryptography \
8585
py3-future \
86-
py3-pip && \
86+
py3-pip \
87+
whois && \
8788
echo "**** install certbot plugins ****" && \
8889
if [ -z ${CERTBOT_VERSION+x} ]; then \
8990
CERTBOT="certbot"; \

Diff for: Dockerfile.armhf

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ RUN \
8383
php7-zip \
8484
py3-cryptography \
8585
py3-future \
86-
py3-pip && \
86+
py3-pip \
87+
whois && \
8788
echo "**** install certbot plugins ****" && \
8889
if [ -z ${CERTBOT_VERSION+x} ]; then \
8990
CERTBOT="certbot"; \

Diff for: README.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ docker create \
7272
-e SUBDOMAINS=www, \
7373
-e VALIDATION=http \
7474
-e DNSPLUGIN=cloudflare `#optional` \
75-
-e DUCKDNSTOKEN=<token> `#optional` \
76-
-e EMAIL=<e-mail> `#optional` \
75+
-e PROPAGATION= `#optional` \
76+
-e DUCKDNSTOKEN= `#optional` \
77+
-e EMAIL= `#optional` \
7778
-e DHLEVEL=2048 `#optional` \
7879
-e ONLY_SUBDOMAINS=false `#optional` \
79-
-e EXTRA_DOMAINS=<extradomains> `#optional` \
80+
-e EXTRA_DOMAINS= `#optional` \
8081
-e STAGING=false `#optional` \
8182
-p 443:443 \
8283
-p 80:80 `#optional` \
@@ -107,11 +108,12 @@ services:
107108
- SUBDOMAINS=www,
108109
- VALIDATION=http
109110
- DNSPLUGIN=cloudflare #optional
110-
- DUCKDNSTOKEN=<token> #optional
111-
- EMAIL=<e-mail> #optional
111+
- PROPAGATION= #optional
112+
- DUCKDNSTOKEN= #optional
113+
- EMAIL= #optional
112114
- DHLEVEL=2048 #optional
113115
- ONLY_SUBDOMAINS=false #optional
114-
- EXTRA_DOMAINS=<extradomains> #optional
116+
- EXTRA_DOMAINS= #optional
115117
- STAGING=false #optional
116118
volumes:
117119
- </path/to/appdata/config>:/config
@@ -136,11 +138,12 @@ Container images are configured using parameters passed at runtime (such as thos
136138
| `-e SUBDOMAINS=www,` | Subdomains you'd like the cert to cover (comma separated, no spaces) ie. `www,ftp,cloud`. For a wildcard cert, set this _exactly_ to `wildcard` (wildcard cert is available via `dns` and `duckdns` validation only) |
137139
| `-e VALIDATION=http` | Letsencrypt validation method to use, options are `http`, `dns` or `duckdns` (`dns` method also requires `DNSPLUGIN` variable set) (`duckdns` method requires `DUCKDNSTOKEN` variable set, and the `SUBDOMAINS` variable must be either empty or set to `wildcard`). |
138140
| `-e DNSPLUGIN=cloudflare` | Required if `VALIDATION` is set to `dns`. Options are `aliyun`, `cloudflare`, `cloudxns`, `cpanel`, `digitalocean`, `dnsimple`, `dnsmadeeasy`, `domeneshop`, `gandi`, `google`, `inwx`, `linode`, `luadns`, `nsone`, `ovh`, `rfc2136`, `route53` and `transip`. Also need to enter the credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf`. |
139-
| `-e DUCKDNSTOKEN=<token>` | Required if `VALIDATION` is set to `duckdns`. Retrieve your token from https://www.duckdns.org |
140-
| `-e EMAIL=<e-mail>` | Optional e-mail address used for cert expiration notifications. |
141+
| `-e PROPAGATION=` | Optionally override (in seconds) the default propagation time for the dns plugins. |
142+
| `-e DUCKDNSTOKEN=` | Required if `VALIDATION` is set to `duckdns`. Retrieve your token from https://www.duckdns.org |
143+
| `-e EMAIL=` | Optional e-mail address used for cert expiration notifications. |
141144
| `-e DHLEVEL=2048` | Dhparams bit value (default=2048, can be set to `1024` or `4096`). |
142145
| `-e ONLY_SUBDOMAINS=false` | If you wish to get certs only for certain subdomains, but not the main domain (main domain may be hosted on another machine and cannot be validated), set this to `true` |
143-
| `-e EXTRA_DOMAINS=<extradomains>` | Additional fully qualified domain names (comma separated, no spaces) ie. `extradomain.com,subdomain.anotherdomain.org` |
146+
| `-e EXTRA_DOMAINS=` | Additional fully qualified domain names (comma separated, no spaces) ie. `extradomain.com,subdomain.anotherdomain.org` |
144147
| `-e STAGING=false` | Set to `true` to retrieve certs in staging mode. Rate limits will be much higher, but the resulting cert will not pass the browser's security test. Only to be used for testing purposes. |
145148
| `-v /config` | All the config files including the webroot reside here. |
146149

@@ -287,6 +290,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
287290

288291
## Versions
289292

293+
* **04.05.20:** - Allow for optionally setting propagation time for dns plugins. Add repo version of `whois` to replace the built-in busybox version. Update `jail.local` to change default fail2ban ban action to more widely supported `iptables-allports`.
290294
* **13.04.20:** - Update cloudflare.ini with token info.
291295
* **11.03.20:** - Add php7-sodium.
292296
* **06.03.20:** - Implement cert renewal attempt during container start (only if the cert is already expired or will expire within the next 24 hours, otherwise it will be attempted at 2:08am).

Diff for: readme-vars.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,16 @@ cap_add_param_vars:
5252
opt_param_usage_include_env: true
5353
opt_param_env_vars:
5454
- { env_var: "DNSPLUGIN", env_value: "cloudflare", desc: "Required if `VALIDATION` is set to `dns`. Options are `aliyun`, `cloudflare`, `cloudxns`, `cpanel`, `digitalocean`, `dnsimple`, `dnsmadeeasy`, `domeneshop`, `gandi`, `google`, `inwx`, `linode`, `luadns`, `nsone`, `ovh`, `rfc2136`, `route53` and `transip`. Also need to enter the credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf`." }
55-
- { env_var: "DUCKDNSTOKEN", env_value: "<token>", desc: "Required if `VALIDATION` is set to `duckdns`. Retrieve your token from https://www.duckdns.org" }
56-
- { env_var: "EMAIL", env_value: "<e-mail>", desc: "Optional e-mail address used for cert expiration notifications." }
55+
- { env_var: "PROPAGATION", env_value: "", desc: "Optionally override (in seconds) the default propagation time for the dns plugins." }
56+
- { env_var: "DUCKDNSTOKEN", env_value: "", desc: "Required if `VALIDATION` is set to `duckdns`. Retrieve your token from https://www.duckdns.org" }
57+
- { env_var: "EMAIL", env_value: "", desc: "Optional e-mail address used for cert expiration notifications." }
5758
- { env_var: "DHLEVEL", env_value: "2048", desc: "Dhparams bit value (default=2048, can be set to `1024` or `4096`)." }
5859
- { env_var: "ONLY_SUBDOMAINS", env_value: "false", desc: "If you wish to get certs only for certain subdomains, but not the main domain (main domain may be hosted on another machine and cannot be validated), set this to `true`" }
59-
- { env_var: "EXTRA_DOMAINS", env_value: "<extradomains>", desc: "Additional fully qualified domain names (comma separated, no spaces) ie. `extradomain.com,subdomain.anotherdomain.org`" }
60+
- { env_var: "EXTRA_DOMAINS", env_value: "", desc: "Additional fully qualified domain names (comma separated, no spaces) ie. `extradomain.com,subdomain.anotherdomain.org`" }
6061
- { env_var: "STAGING", env_value: "false", desc: "Set to `true` to retrieve certs in staging mode. Rate limits will be much higher, but the resulting cert will not pass the browser's security test. Only to be used for testing purposes." }
6162
opt_param_usage_include_vols: false
6263
opt_param_volumes:
63-
- { vol_path: "/config", vol_host_path: "</path/to/appdata/config>", desc: "Configuration files." }
64+
- { vol_path: "/config", vol_host_path: "/path/to/appdata/config", desc: "Configuration files." }
6465
opt_param_usage_include_ports: true
6566
opt_param_ports:
6667
- { external_port: "80", internal_port: "80", port_desc: "Http port (required for http validation only)" }
@@ -125,6 +126,7 @@ app_setup_nginx_reverse_proxy_block: ""
125126

126127
# changelog
127128
changelogs:
129+
- { date: "04.05.20:", desc: "Allow for optionally setting propagation time for dns plugins. Add repo version of `whois` to replace the built-in busybox version. Update `jail.local` to change default fail2ban ban action to more widely supported `iptables-allports`." }
128130
- { date: "13.04.20:", desc: "Update cloudflare.ini with token info." }
129131
- { date: "11.03.20:", desc: "Add php7-sodium." }
130132
- { date: "06.03.20:", desc: "Implement cert renewal attempt during container start (only if the cert is already expired or will expire within the next 24 hours, otherwise it will be attempted at 2:08am)." }

Diff for: root/defaults/jail.local

+4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
## Version 2020/05/05 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/jail.local
12
# This is the custom version of the jail.conf for fail2ban
23
# Feel free to modify this and add additional filters
34
# Then you can drop the new filter conf files into the fail2ban-filters
45
# folder and restart the container
56

67
[DEFAULT]
78

9+
# Changes the default ban action from "iptables-multiport", which causes issues on some platforms, to "iptables-allports".
10+
banaction = iptables-allports
11+
812
# "bantime" is the number of seconds that a host is banned.
913
bantime = 600
1014

Diff for: root/etc/cont-init.d/50-config

+14-8
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ cp /config/crontabs/* /etc/crontabs/
8686

8787
# create original config file if it doesn't exist
8888
if [ ! -f "/config/donoteditthisfile.conf" ]; then
89-
echo -e "ORIGURL=\"$URL\" ORIGSUBDOMAINS=\"$SUBDOMAINS\" ORIGONLY_SUBDOMAINS=\"$ONLY_SUBDOMAINS\" ORIGEXTRA_DOMAINS=\"$EXTRA_DOMAINS\" ORIGDHLEVEL=\"$DHLEVEL\" ORIGVALIDATION=\"$VALIDATION\" ORIGDNSPLUGIN=\"$DNSPLUGIN\" ORIGSTAGING=\"$STAGING\"" > /config/donoteditthisfile.conf
89+
echo -e "ORIGURL=\"$URL\" ORIGSUBDOMAINS=\"$SUBDOMAINS\" ORIGONLY_SUBDOMAINS=\"$ONLY_SUBDOMAINS\" ORIGEXTRA_DOMAINS=\"$EXTRA_DOMAINS\" ORIGDHLEVEL=\"$DHLEVEL\" ORIGVALIDATION=\"$VALIDATION\" ORIGDNSPLUGIN=\"$DNSPLUGIN\" ORIGPROPAGATION=\"$PROPAGATION\" ORIGSTAGING=\"$STAGING\" ORIGDUCKDNSTOKEN=\"$DUCKDNSTOKEN\"" > /config/donoteditthisfile.conf
9090
echo "Created donoteditthisfile.conf"
9191
fi
9292

@@ -173,17 +173,23 @@ fi
173173
# setting the validation method to use
174174
if [ "$VALIDATION" = "dns" ]; then
175175
if [ "$DNSPLUGIN" = "route53" ]; then
176-
PREFCHAL="--dns-${DNSPLUGIN} --manual-public-ip-logging-ok"
176+
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
177+
PREFCHAL="--dns-${DNSPLUGIN} ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
177178
elif [[ "$DNSPLUGIN" =~ ^(cpanel)$ ]]; then
178-
PREFCHAL="-a certbot-dns-${DNSPLUGIN}:${DNSPLUGIN} --certbot-dns-${DNSPLUGIN}:${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini --manual-public-ip-logging-ok --certbot-dns-${DNSPLUGIN}:${DNSPLUGIN}-propagation-seconds 120"
179+
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--certbot-dns-${DNSPLUGIN}:${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
180+
PREFCHAL="-a certbot-dns-${DNSPLUGIN}:${DNSPLUGIN} --certbot-dns-${DNSPLUGIN}:${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
179181
elif [[ "$DNSPLUGIN" =~ ^(gandi)$ ]]; then
182+
if [ -n "$PROPAGATION" ];then echo "Gandi dns plugin does not support setting propagation time"; fi
180183
PREFCHAL="-a certbot-plugin-${DNSPLUGIN}:dns --certbot-plugin-${DNSPLUGIN}:dns-credentials /config/dns-conf/${DNSPLUGIN}.ini --manual-public-ip-logging-ok"
181184
elif [[ "$DNSPLUGIN" =~ ^(google)$ ]]; then
182-
PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.json --manual-public-ip-logging-ok --dns-${DNSPLUGIN}-propagation-seconds 120"
185+
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
186+
PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.json ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
183187
elif [[ "$DNSPLUGIN" =~ ^(aliyun|domeneshop|inwx|transip)$ ]]; then
184-
PREFCHAL="-a certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN} --certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini --manual-public-ip-logging-ok --certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN}-propagation-seconds 180"
188+
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
189+
PREFCHAL="-a certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN} --certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
185190
else
186-
PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini --manual-public-ip-logging-ok"
191+
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
192+
PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
187193
fi
188194
echo "${VALIDATION} validation via ${DNSPLUGIN} plugin is selected"
189195
elif [ "$VALIDATION" = "tls-sni" ]; then
@@ -215,7 +221,7 @@ else
215221
fi
216222

217223
# checking for changes in cert variables, revoking certs if necessary
218-
if [ ! "$URL" = "$ORIGURL" ] || [ ! "$SUBDOMAINS" = "$ORIGSUBDOMAINS" ] || [ ! "$ONLY_SUBDOMAINS" = "$ORIGONLY_SUBDOMAINS" ] || [ ! "$EXTRA_DOMAINS" = "$ORIGEXTRA_DOMAINS" ] || [ ! "$VALIDATION" = "$ORIGVALIDATION" ] || [ ! "$DNSPLUGIN" = "$ORIGDNSPLUGIN" ] || [ ! "$STAGING" = "$ORIGSTAGING" ]; then
224+
if [ ! "$URL" = "$ORIGURL" ] || [ ! "$SUBDOMAINS" = "$ORIGSUBDOMAINS" ] || [ ! "$ONLY_SUBDOMAINS" = "$ORIGONLY_SUBDOMAINS" ] || [ ! "$EXTRA_DOMAINS" = "$ORIGEXTRA_DOMAINS" ] || [ ! "$VALIDATION" = "$ORIGVALIDATION" ] || [ ! "$DNSPLUGIN" = "$ORIGDNSPLUGIN" ] || [ ! "$PROPAGATION" = "$ORIGPROPAGATION" ] || [ ! "$STAGING" = "$ORIGSTAGING" ] || [ ! "$DUCKDNSTOKEN" = "$ORIGDUCKDNSTOKEN" ]; then
219225
echo "Different validation parameters entered than what was used before. Revoking and deleting existing certificate, and an updated one will be created"
220226
if [ "$ORIGONLY_SUBDOMAINS" = "true" ] && [ ! "$ORIGSUBDOMAINS" = "wildcard" ]; then
221227
ORIGDOMAIN="$(echo "$ORIGSUBDOMAINS" | tr ',' ' ' | awk '{print $1}').${ORIGURL}"
@@ -228,7 +234,7 @@ if [ ! "$URL" = "$ORIGURL" ] || [ ! "$SUBDOMAINS" = "$ORIGSUBDOMAINS" ] || [ ! "
228234
fi
229235

230236
# saving new variables
231-
echo -e "ORIGURL=\"$URL\" ORIGSUBDOMAINS=\"$SUBDOMAINS\" ORIGONLY_SUBDOMAINS=\"$ONLY_SUBDOMAINS\" ORIGEXTRA_DOMAINS=\"$EXTRA_DOMAINS\" ORIGDHLEVEL=\"$DHLEVEL\" ORIGVALIDATION=\"$VALIDATION\" ORIGDNSPLUGIN=\"$DNSPLUGIN\" ORIGSTAGING=\"$STAGING\" ORIGDUCKDNSTOKEN=\"$DUCKDNSTOKEN\"" > /config/donoteditthisfile.conf
237+
echo -e "ORIGURL=\"$URL\" ORIGSUBDOMAINS=\"$SUBDOMAINS\" ORIGONLY_SUBDOMAINS=\"$ONLY_SUBDOMAINS\" ORIGEXTRA_DOMAINS=\"$EXTRA_DOMAINS\" ORIGDHLEVEL=\"$DHLEVEL\" ORIGVALIDATION=\"$VALIDATION\" ORIGDNSPLUGIN=\"$DNSPLUGIN\" ORIGPROPAGATION=\"$PROPAGATION\" ORIGSTAGING=\"$STAGING\" ORIGDUCKDNSTOKEN=\"$DUCKDNSTOKEN\"" > /config/donoteditthisfile.conf
232238

233239
# alter extension for error message
234240
if [ "$DNSPLUGIN" = "google" ]; then

0 commit comments

Comments
 (0)