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

Commit e5ca5e0

Browse files
committed
Allow getting a cert for the main domain with DuckDNS
This commit is a follow up for #232, which changed DuckDNS to only support wildcards (*.mysubdomain.duckdns.org). This commit tries to mimic the old behavior before #232 with additional support for wildcards. Ie. if SUBDOMAINS is set to 'wildcard' as instructed, a wildcard cert is requested as currently. Otherwise certificate will be for the main domain as it used to be before #232.
1 parent 3e4a570 commit e5ca5e0

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Container images are configured using parameters passed at runtime (such as thos
120120
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. |
121121
| `-e URL=yourdomain.url` | Top url you have control over (`customdomain.com` if you own it, or `customsubdomain.ddnsprovider.com` if dynamic dns). |
122122
| `-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) |
123-
| `-e VALIDATION=http` | Letsencrypt validation method to use, options are `http`, `tls-sni`, `dns` or `duckdns` (`dns` method also requires `DNSPLUGIN` variable set) (`duckdns` method requires `DUCKDNSTOKEN` variable set, and the `SUBDOMAINS` variable set to `wildcard`). |
123+
| `-e VALIDATION=http` | Letsencrypt validation method to use, options are `http`, `tls-sni`, `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`). |
124124
| `-e DNSPLUGIN=cloudflare` | Required if `VALIDATION` is set to `dns`. Options are `cloudflare`, `cloudxns`, `digitalocean`, `dnsimple`, `dnsmadeeasy`, `google`, `luadns`, `nsone`, `ovh`, `rfc2136` and `route53`. Also need to enter the credentials into the corresponding ini file under `/config/dns-conf`. |
125125
| `-e DUCKDNSTOKEN=<token>` | Required if `VALIDATION` is set to `duckdns`. Retrieve your token from https://www.duckdns.org |
126126
| `-e EMAIL=<e-mail>` | Optional e-mail address used for cert expiration notifications. |
@@ -154,7 +154,7 @@ In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as bel
154154
* For `dns` validation, make sure to enter your credentials into the corresponding ini file under `/config/dns-conf`
155155
* Cloudflare provides free accounts for managing dns and is very easy to use with this image. Make sure that it is set up for "dns only" instead of "dns + proxy"
156156
* Google dns plugin is meant to be used with "Google Cloud DNS", a paid enterprise product, and not for "Google Domains DNS"
157-
* For `duckdns` validation, set the `SUBDOMAINS` variable to `wildcard`, and set the `DUCKDNSTOKEN` variable with your duckdns token. Due to a limitation of duckdns, the resulting cert will only cover the sub-subdomains (ie. `*.yoursubdomain.duckdns.org`) but will not cover `yoursubdomain.duckdns.org`. Therefore, it is recommended to use a sub-subdomain like `www.yoursubdomain.duckdns.org` for subfolders. You can use our [duckdns image](https://hub.docker.com/r/linuxserver/duckdns/) to update your IP on duckdns.org.
157+
* For `duckdns` validation, either leave the `SUBDOMAINS` variable empty or set it to `wildcard`, and set the `DUCKDNSTOKEN` variable with your duckdns token. Due to a limitation of duckdns, the resulting cert will only cover either main subdomain (ie. `yoursubdomain.duckdns.org`), or sub-subdomains (ie. `*.yoursubdomain.duckdns.org`), but will not both at the same time. You can use our [duckdns image](https://hub.docker.com/r/linuxserver/duckdns/) to update your IP on duckdns.org.
158158
* `--cap-add=NET_ADMIN` is required for fail2ban to modify iptables
159159
* If you need a dynamic dns provider, you can use the free provider duckdns.org where the `URL` will be `yoursubdomain.duckdns.org` and the `SUBDOMAINS` can be `www,ftp,cloud` with http validation, or `wildcard` with dns validation.
160160
* After setup, navigate to `https://yourdomain.url` to access the default homepage (http access through port 80 is disabled by default, you can enable it by editing the default site config at `/config/nginx/site-confs/default`).
@@ -257,6 +257,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
257257

258258
## Versions
259259

260+
* **30.07.19:** - Support main domain via duckdns validation.
260261
* **29.07.19:** - Enable http to https redirect by default (effective only for new installs).
261262
* **01.07.19:** - Patch geoip2 module until upstream is fixed.
262263
* **30.06.19:** - Add geoip2 module.

readme-vars.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ param_env_vars:
3434
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." }
3535
- { env_var: "URL", env_value: "yourdomain.url", desc: "Top url you have control over (`customdomain.com` if you own it, or `customsubdomain.ddnsprovider.com` if dynamic dns)." }
3636
- { env_var: "SUBDOMAINS", env_value: "www,", desc: "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)" }
37-
- { env_var: "VALIDATION", env_value: "http", desc: "Letsencrypt validation method to use, options are `http`, `tls-sni`, `dns` or `duckdns` (`dns` method also requires `DNSPLUGIN` variable set) (`duckdns` method requires `DUCKDNSTOKEN` variable set, and the `SUBDOMAINS` variable set to `wildcard`)." }
37+
- { env_var: "VALIDATION", env_value: "http", desc: "Letsencrypt validation method to use, options are `http`, `tls-sni`, `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`)." }
3838
param_usage_include_vols: true
3939
param_volumes:
4040
- { vol_path: "/config", vol_host_path: "</path/to/appdata/config>", desc: "All the config files including the webroot reside here." }
@@ -84,7 +84,7 @@ app_setup_block: |
8484
* For `dns` validation, make sure to enter your credentials into the corresponding ini file under `/config/dns-conf`
8585
* Cloudflare provides free accounts for managing dns and is very easy to use with this image. Make sure that it is set up for "dns only" instead of "dns + proxy"
8686
* Google dns plugin is meant to be used with "Google Cloud DNS", a paid enterprise product, and not for "Google Domains DNS"
87-
* For `duckdns` validation, set the `SUBDOMAINS` variable to `wildcard`, and set the `DUCKDNSTOKEN` variable with your duckdns token. Due to a limitation of duckdns, the resulting cert will only cover the sub-subdomains (ie. `*.yoursubdomain.duckdns.org`) but will not cover `yoursubdomain.duckdns.org`. Therefore, it is recommended to use a sub-subdomain like `www.yoursubdomain.duckdns.org` for subfolders. You can use our [duckdns image](https://hub.docker.com/r/linuxserver/duckdns/) to update your IP on duckdns.org.
87+
* For `duckdns` validation, either leave the `SUBDOMAINS` variable empty or set it to `wildcard`, and set the `DUCKDNSTOKEN` variable with your duckdns token. Due to a limitation of duckdns, the resulting cert will only cover either main subdomain (ie. `yoursubdomain.duckdns.org`), or sub-subdomains (ie. `*.yoursubdomain.duckdns.org`), but will not both at the same time. You can use our [duckdns image](https://hub.docker.com/r/linuxserver/duckdns/) to update your IP on duckdns.org.
8888
* `--cap-add=NET_ADMIN` is required for fail2ban to modify iptables
8989
* If you need a dynamic dns provider, you can use the free provider duckdns.org where the `URL` will be `yoursubdomain.duckdns.org` and the `SUBDOMAINS` can be `www,ftp,cloud` with http validation, or `wildcard` with dns validation.
9090
* After setup, navigate to `https://yourdomain.url` to access the default homepage (http access through port 80 is disabled by default, you can enable it by editing the default site config at `/config/nginx/site-confs/default`).
@@ -126,6 +126,7 @@ app_setup_nginx_reverse_proxy_block: ""
126126

127127
# changelog
128128
changelogs:
129+
- { date: "30.07.19:", desc: "Support main domain via duckdns validation." }
129130
- { date: "29.07.19:", desc: "Enable http to https redirect by default (effective only for new installs)." }
130131
- { date: "01.07.19:", desc: "Patch geoip2 module until upstream is fixed." }
131132
- { date: "30.06.19:", desc: "Add geoip2 module." }

root/etc/cont-init.d/50-config

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,13 @@ elif [ "$VALIDATION" = "duckdns" ]; then
185185
PREFCHAL="--non-interactive --manual --preferred-challenges dns --manual-public-ip-logging-ok --manual-auth-hook /app/duckdns-txt"
186186
chmod +x /app/duckdns-txt
187187
echo "duckdns validation is selected"
188-
echo "the resulting certificate will only cover the subdomains due to a limitation of duckdns, so it is advised to set the root location to use www.subdomain.duckdns.org"
189-
export URL_REAL="-d *.${URL}"
188+
if [ "$SUBDOMAINS" = "wildcard" ]; then
189+
echo "the resulting certificate will only cover the subdomains due to a limitation of duckdns, so it is advised to set the root location to use www.subdomain.duckdns.org"
190+
export URL_REAL="-d *.${URL}"
191+
else
192+
echo "the resulting certificate will only cover the main domain due to a limitation of duckdns, ie. subdomain.duckdns.org"
193+
export URL_REAL="-d ${URL}"
194+
fi
190195
else
191196
PREFCHAL="--non-interactive --standalone --preferred-challenges http"
192197
echo "http validation is selected"

0 commit comments

Comments
 (0)