From 97baf76a1010b5fc2b9afe36aa304818177f4df9 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sat, 12 Aug 2023 13:47:44 -0500 Subject: [PATCH 1/2] Get available DNS Authenticator plugins from CLI Signed-off-by: Eric Nemchik --- root/etc/s6-overlay/s6-rc.d/init-certbot-config/run | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run index d3243c9..0cfd62f 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-certbot-config/run @@ -24,8 +24,10 @@ for i in "${SANED_VARS[@]}"; do done # check to make sure DNSPLUGIN is selected if dns validation is used -if [[ "${VALIDATION}" = "dns" ]] && [[ ! "${DNSPLUGIN}" =~ ^(acmedns|aliyun|azure|bunny|cloudflare|cpanel|desec|digitalocean|directadmin|dnsimple|dnsmadeeasy|dnspod|do|domeneshop|dreamhost|duckdns|dynu|gandi|gehirn|godaddy|google|google-domains|he|hetzner|infomaniak|inwx|ionos|linode|loopia|luadns|netcup|njalla|nsone|ovh|porkbun|rfc2136|route53|sakuracloud|standalone|transip|vultr)$ ]]; then - echo "Please set the DNSPLUGIN variable to a valid plugin name. See docker info for more details." +CERTBOT_DNS_AUTHENTICATORS=$(certbot plugins --authenticators 2>/dev/null | sed -e 's/^Entry point: cpanel =/Entry point: dns-cpanel =/' -e '/^Entry point: dns-/!d' -e 's/^Entry point: dns-\([^ ]*\) =.*/\1/' | sort) +if [[ "${VALIDATION}" = "dns" ]] && ! echo "${CERTBOT_DNS_AUTHENTICATORS}" | grep -q "${DNSPLUGIN}"; then + echo "Please set the DNSPLUGIN variable to one of the following:" + echo "${CERTBOT_DNS_AUTHENTICATORS}" sleep infinity fi From badea52047ac880227de40cf6de9931ddd1511f7 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sat, 12 Aug 2023 13:55:53 -0500 Subject: [PATCH 2/2] Add FreeDNS plugin Signed-off-by: Eric Nemchik --- Dockerfile | 1 + Dockerfile.aarch64 | 1 + README.md | 3 ++- readme-vars.yml | 3 ++- root/defaults/dns-conf/freedns.ini | 4 ++++ 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 root/defaults/dns-conf/freedns.ini diff --git a/Dockerfile b/Dockerfile index ab9937c..dab7574 100755 --- a/Dockerfile +++ b/Dockerfile @@ -105,6 +105,7 @@ RUN \ certbot-dns-dreamhost \ certbot-dns-duckdns \ certbot-dns-dynu \ + certbot-dns-freedns \ certbot-dns-gehirn \ certbot-dns-godaddy \ certbot-dns-google \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index c082525..e5565fe 100755 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -105,6 +105,7 @@ RUN \ certbot-dns-dreamhost \ certbot-dns-duckdns \ certbot-dns-dynu \ + certbot-dns-freedns \ certbot-dns-gehirn \ certbot-dns-godaddy \ certbot-dns-google \ diff --git a/README.md b/README.md index 2eb0bb6..4bc632a 100644 --- a/README.md +++ b/README.md @@ -215,7 +215,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-e VALIDATION=http` | Certbot validation method to use, options are `http` or `dns` (`dns` method also requires `DNSPLUGIN` variable set). | | `-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` validation only) | | `-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 `acmedns`, `aliyun`, `azure`, `bunny`, `cloudflare`, `cpanel`, `desec`, `digitalocean`, `directadmin`, `dnsimple`, `dnsmadeeasy`, `dnspod`, `do`, `domeneshop`, `dreamhost`, `duckdns`, `dynu`, `gandi`, `gehirn`, `godaddy`, `google`, `google-domains`, `he`, `hetzner`, `infomaniak`, `inwx`, `ionos`, `linode`, `loopia`, `luadns`, `netcup`, `njalla`, `nsone`, `ovh`, `porkbun`, `rfc2136`, `route53`, `sakuracloud`, `standalone`, `transip`, and `vultr`. 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 `acmedns`, `aliyun`, `azure`, `bunny`, `cloudflare`, `cpanel`, `desec`, `digitalocean`, `directadmin`, `dnsimple`, `dnsmadeeasy`, `dnspod`, `do`, `domeneshop`, `dreamhost`, `duckdns`, `dynu`, `freedns`, `gandi`, `gehirn`, `godaddy`, `google`, `google-domains`, `he`, `hetzner`, `infomaniak`, `inwx`, `ionos`, `linode`, `loopia`, `luadns`, `netcup`, `njalla`, `nsone`, `ovh`, `porkbun`, `rfc2136`, `route53`, `sakuracloud`, `standalone`, `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 EMAIL=` | Optional e-mail address used for cert expiration notifications (Required for ZeroSSL). | | `-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` | @@ -336,6 +336,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **12.08.23:** - Add FreeDNS plugin. Detect certbot DNS authenticators using CLI. * **07.08.23:** - Add Bunny DNS Configuration. * **27.07.23:** - Added support for dreamhost validation. * **25.05.23:** - Rebase to Alpine 3.18, deprecate armhf. diff --git a/readme-vars.yml b/readme-vars.yml index 2d966ab..9a864f8 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -50,7 +50,7 @@ opt_param_usage_include_env: true opt_param_env_vars: - { 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` validation only)" } - { 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 `acmedns`, `aliyun`, `azure`, `bunny`, `cloudflare`, `cpanel`, `desec`, `digitalocean`, `directadmin`, `dnsimple`, `dnsmadeeasy`, `dnspod`, `do`, `domeneshop`, `dreamhost`, `duckdns`, `dynu`, `gandi`, `gehirn`, `godaddy`, `google`, `google-domains`, `he`, `hetzner`, `infomaniak`, `inwx`, `ionos`, `linode`, `loopia`, `luadns`, `netcup`, `njalla`, `nsone`, `ovh`, `porkbun`, `rfc2136`, `route53`, `sakuracloud`, `standalone`, `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: "DNSPLUGIN", env_value: "cloudflare", desc: "Required if `VALIDATION` is set to `dns`. Options are `acmedns`, `aliyun`, `azure`, `bunny`, `cloudflare`, `cpanel`, `desec`, `digitalocean`, `directadmin`, `dnsimple`, `dnsmadeeasy`, `dnspod`, `do`, `domeneshop`, `dreamhost`, `duckdns`, `dynu`, `freedns`, `gandi`, `gehirn`, `godaddy`, `google`, `google-domains`, `he`, `hetzner`, `infomaniak`, `inwx`, `ionos`, `linode`, `loopia`, `luadns`, `netcup`, `njalla`, `nsone`, `ovh`, `porkbun`, `rfc2136`, `route53`, `sakuracloud`, `standalone`, `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: "EMAIL", env_value: "", desc: "Optional e-mail address used for cert expiration notifications (Required for ZeroSSL)." } - { 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`" } @@ -153,6 +153,7 @@ app_setup_block: | # changelog changelogs: + - { date: "12.08.23:", desc: "Add FreeDNS plugin. Detect certbot DNS authenticators using CLI." } - { date: "07.08.23:", desc: "Add Bunny DNS Configuration." } - { date: "27.07.23:", desc: "Added support for dreamhost validation." } - { date: "25.05.23:", desc: "Rebase to Alpine 3.18, deprecate armhf." } diff --git a/root/defaults/dns-conf/freedns.ini b/root/defaults/dns-conf/freedns.ini new file mode 100644 index 0000000..f3606dc --- /dev/null +++ b/root/defaults/dns-conf/freedns.ini @@ -0,0 +1,4 @@ +# Instructions: https://github.com/schleuss/certbot_dns_freedns#credentials +# Replace with your values +dns_freedns_username = myremoteuser +dns_freedns_password = verysecureremoteuserpassword