From 0ac5a2a4f21db3185572718ce3bd29dbf8b9fa25 Mon Sep 17 00:00:00 2001 From: Thomas Cuthbert Date: Mon, 12 Apr 2021 20:45:55 +0800 Subject: [PATCH 1/2] Add vultr certbot authenticator plugin --- Dockerfile | 1 + Dockerfile.aarch64 | 1 + Dockerfile.armhf | 1 + root/defaults/dns-conf/vultr.ini | 3 +++ root/etc/cont-init.d/50-config | 4 ++-- 5 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 root/defaults/dns-conf/vultr.ini diff --git a/Dockerfile b/Dockerfile index 64e59a9..c3fe0cd 100755 --- a/Dockerfile +++ b/Dockerfile @@ -117,6 +117,7 @@ RUN \ certbot-dns-rfc2136 \ certbot-dns-route53 \ certbot-dns-transip \ + certbot-dns-vultr \ certbot-plugin-gandi \ cryptography \ requests && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 11b0740..559eef2 100755 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -117,6 +117,7 @@ RUN \ certbot-dns-rfc2136 \ certbot-dns-route53 \ certbot-dns-transip \ + certbot-dns-vultr \ certbot-plugin-gandi \ cryptography \ requests && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 2d6ccae..a247423 100755 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -117,6 +117,7 @@ RUN \ certbot-dns-rfc2136 \ certbot-dns-route53 \ certbot-dns-transip \ + certbot-dns-vultr \ certbot-plugin-gandi \ cryptography \ requests && \ diff --git a/root/defaults/dns-conf/vultr.ini b/root/defaults/dns-conf/vultr.ini new file mode 100644 index 0000000..901bdff --- /dev/null +++ b/root/defaults/dns-conf/vultr.ini @@ -0,0 +1,3 @@ +# Instructions: https://github.com/lezgomatt/certbot-dns-vultr +# Replace with your vultr Personal Access Token (see https://www.vultr.com/docs/how-to-setup-dynamic-dns). +dns_vultr_key = YOUR_VULTR_API_KEY diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 1efa820..ceb22f4 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -99,7 +99,7 @@ if ! grep -q 'PARAMETERS' "/config/nginx/dhparams.pem"; then fi # check to make sure DNSPLUGIN is selected if dns validation is used -[[ "$VALIDATION" = "dns" ]] && [[ ! "$DNSPLUGIN" =~ ^(aliyun|cloudflare|cloudxns|cpanel|digitalocean|directadmin|dnsimple|dnsmadeeasy|domeneshop|gandi|gehirn|google|hetzner|inwx|linode|luadns|netcup|njalla|nsone|ovh|rfc2136|route53|sakuracloud|transip)$ ]] && \ +[[ "$VALIDATION" = "dns" ]] && [[ ! "$DNSPLUGIN" =~ ^(aliyun|cloudflare|cloudxns|cpanel|digitalocean|directadmin|dnsimple|dnsmadeeasy|domeneshop|gandi|gehirn|google|hetzner|inwx|linode|luadns|netcup|njalla|nsone|ovh|rfc2136|route53|sakuracloud|transip|vultr)$ ]] && \ echo "Please set the DNSPLUGIN variable to a valid plugin name. See docker info for more details." && \ sleep infinity @@ -213,7 +213,7 @@ if [ "$VALIDATION" = "dns" ]; then elif [[ "$DNSPLUGIN" =~ ^(google)$ ]]; then if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.json ${PROPAGATIONPARAM}" - elif [[ "$DNSPLUGIN" =~ ^(aliyun|domeneshop|hetzner|inwx|netcup|njalla|transip)$ ]]; then + elif [[ "$DNSPLUGIN" =~ ^(aliyun|domeneshop|hetzner|inwx|netcup|njalla|transip|vultr)$ ]]; then if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi PREFCHAL="-a dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM}" elif [[ "$DNSPLUGIN" =~ ^(directadmin)$ ]]; then From 28cdf9b8c6e70b50f0d9c31d9a72ad38379c6273 Mon Sep 17 00:00:00 2001 From: Thomas Cuthbert Date: Mon, 12 Apr 2021 21:58:46 +0800 Subject: [PATCH 2/2] Add vultr DNS authenticator plugin documentation --- README.md | 3 ++- readme-vars.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb5f5fe..0b51cd1 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-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) | | `-e VALIDATION=http` | Certbot 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`). | | `-e CERTPROVIDER=` | Optionally define the cert provider. Set to `zerossl` for ZeroSSL certs (requires existing [ZeroSSL account](https://app.zerossl.com/signup) and the e-mail address entered in `EMAIL` env var). Otherwise defaults to Let's Encrypt. | -| `-e DNSPLUGIN=cloudflare` | Required if `VALIDATION` is set to `dns`. Options are `aliyun`, `cloudflare`, `cloudxns`, `cpanel`, `digitalocean`, `directadmin`, `dnsimple`, `dnsmadeeasy`, `domeneshop`, `gandi`, `gehirn`, `google`, `hetzner`, `inwx`, `linode`, `luadns`, `netcup`, `njalla`, `nsone`, `ovh`, `rfc2136`, `route53`, `sakuracloud` and `transip`. Also need to enter the credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf`. | +| `-e DNSPLUGIN=cloudflare` | Required if `VALIDATION` is set to `dns`. Options are `aliyun`, `cloudflare`, `cloudxns`, `cpanel`, `digitalocean`, `directadmin`, `dnsimple`, `dnsmadeeasy`, `domeneshop`, `gandi`, `gehirn`, `google`, `hetzner`, `inwx`, `linode`, `luadns`, `netcup`, `njalla`, `nsone`, `ovh`, `rfc2136`, `route53`, `sakuracloud`, `transip` and `vultr`. Also need to enter the credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf`. | | `-e PROPAGATION=` | Optionally override (in seconds) the default propagation time for the dns plugins. | | `-e DUCKDNSTOKEN=` | Required if `VALIDATION` is set to `duckdns`. Retrieve your token from https://www.duckdns.org | | `-e EMAIL=` | Optional e-mail address used for cert expiration notifications (Required for ZeroSSL). | @@ -326,6 +326,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **12.04.21:** - Add support for vultr dns validation. * **14.03.21:** - Add support for directadmin dns validation. * **12.02.21:** - Clean up rust/cargo cache, which ballooned the image size in the last couple of builds. * **10.02.21:** - Fix aliyun, domeneshop, inwx and transip dns confs for existing users. diff --git a/readme-vars.yml b/readme-vars.yml index 3c324a0..4510976 100755 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -51,7 +51,7 @@ cap_add_param_vars: opt_param_usage_include_env: true opt_param_env_vars: - { env_var: "CERTPROVIDER", env_value: "", desc: "Optionally define the cert provider. Set to `zerossl` for ZeroSSL certs (requires existing [ZeroSSL account](https://app.zerossl.com/signup) and the e-mail address entered in `EMAIL` env var). Otherwise defaults to Let's Encrypt." } - - { env_var: "DNSPLUGIN", env_value: "cloudflare", desc: "Required if `VALIDATION` is set to `dns`. Options are `aliyun`, `cloudflare`, `cloudxns`, `cpanel`, `digitalocean`, `directadmin`, `dnsimple`, `dnsmadeeasy`, `domeneshop`, `gandi`, `gehirn`, `google`, `hetzner`, `inwx`, `linode`, `luadns`, `netcup`, `njalla`, `nsone`, `ovh`, `rfc2136`, `route53`, `sakuracloud` and `transip`. Also need to enter the credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf`." } + - { env_var: "DNSPLUGIN", env_value: "cloudflare", desc: "Required if `VALIDATION` is set to `dns`. Options are `aliyun`, `cloudflare`, `cloudxns`, `cpanel`, `digitalocean`, `directadmin`, `dnsimple`, `dnsmadeeasy`, `domeneshop`, `gandi`, `gehirn`, `google`, `hetzner`, `inwx`, `linode`, `luadns`, `netcup`, `njalla`, `nsone`, `ovh`, `rfc2136`, `route53`, `sakuracloud`, `transip` and `vultr`. Also need to enter the credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf`." } - { env_var: "PROPAGATION", env_value: "", desc: "Optionally override (in seconds) the default propagation time for the dns plugins." } - { env_var: "DUCKDNSTOKEN", env_value: "", desc: "Required if `VALIDATION` is set to `duckdns`. Retrieve your token from https://www.duckdns.org" } - { env_var: "EMAIL", env_value: "", desc: "Optional e-mail address used for cert expiration notifications (Required for ZeroSSL)." } @@ -151,6 +151,7 @@ app_setup_nginx_reverse_proxy_block: "" # changelog changelogs: + - { date: "12.04.21:", desc: "Add support for vultr dns validation." } - { date: "14.03.21:", desc: "Add support for directadmin dns validation." } - { date: "12.02.21:", desc: "Clean up rust/cargo cache, which ballooned the image size in the last couple of builds." } - { date: "10.02.21:", desc: "Fix aliyun, domeneshop, inwx and transip dns confs for existing users." }