Skip to content

Commit 7f0a3bf

Browse files
authored
Merge pull request #99 from Platzii/directadmin
Add support for DirectAdmin DNS validation
2 parents 1a16a7c + 6f8101e commit 7f0a3bf

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ RUN \
101101
certbot-dns-cloudxns \
102102
certbot-dns-cpanel \
103103
certbot-dns-digitalocean \
104+
certbot-dns-directadmin \
104105
certbot-dns-dnsimple \
105106
certbot-dns-dnsmadeeasy \
106107
certbot-dns-domeneshop \

Dockerfile.aarch64

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ RUN \
101101
certbot-dns-cloudxns \
102102
certbot-dns-cpanel \
103103
certbot-dns-digitalocean \
104+
certbot-dns-directadmin \
104105
certbot-dns-dnsimple \
105106
certbot-dns-dnsmadeeasy \
106107
certbot-dns-domeneshop \

Dockerfile.armhf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ RUN \
101101
certbot-dns-cloudxns \
102102
certbot-dns-cpanel \
103103
certbot-dns-digitalocean \
104+
certbot-dns-directadmin \
104105
certbot-dns-dnsimple \
105106
certbot-dns-dnsmadeeasy \
106107
certbot-dns-domeneshop \

readme-vars.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ cap_add_param_vars:
5151
opt_param_usage_include_env: true
5252
opt_param_env_vars:
5353
- { 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." }
54-
- { 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`, `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`." }
54+
- { 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`." }
5555
- { env_var: "PROPAGATION", env_value: "", desc: "Optionally override (in seconds) the default propagation time for the dns plugins." }
5656
- { env_var: "DUCKDNSTOKEN", env_value: "", desc: "Required if `VALIDATION` is set to `duckdns`. Retrieve your token from https://www.duckdns.org" }
5757
- { 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: ""
151151

152152
# changelog
153153
changelogs:
154+
- { date: "14.03.21:", desc: "Add support for directadmin dns validation." }
154155
- { date: "12.02.21:", desc: "Clean up rust/cargo cache, which ballooned the image size in the last couple of builds." }
155156
- { date: "10.02.21:", desc: "Fix aliyun, domeneshop, inwx and transip dns confs for existing users." }
156157
- { date: "09.02.21:", desc: "Rebasing to alpine 3.13. Add nginx mods brotli and dav-ext. Remove nginx mods lua and lua-upstream (due to regression over the last couple of years)." }
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Instructions: https://github.com/cybercinch/certbot-dns-directadmin/blob/master/certbot_dns_directadmin/__init__.py
2+
3+
# It is recommended to create a login key in the DirectAdmin control panel to be used as value for directadmin_password.
4+
# Instructions on how to create such key can be found at https://help.directadmin.com/item.php?id=523.
5+
#
6+
# Make sure to grant the following permissions:
7+
# - CMD_API_LOGIN_TEST
8+
# - CMD_API_DNS_CONTROL
9+
# - CMD_API_SHOW_DOMAINS
10+
#
11+
# Username and password can also be used in case your DirectAdmin instance has no support for login keys.
12+
13+
# The DirectAdmin Server url
14+
# include the scheme and the port number (Normally 2222)
15+
directadmin_url = https://my.directadminserver.com:2222
16+
17+
# The DirectAdmin username
18+
directadmin_username = username
19+
20+
# The DirectAdmin password
21+
directadmin_password = aSuperStrongPassword

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ if ! grep -q 'PARAMETERS' "/config/nginx/dhparams.pem"; then
9999
fi
100100

101101
# check to make sure DNSPLUGIN is selected if dns validation is used
102-
[[ "$VALIDATION" = "dns" ]] && [[ ! "$DNSPLUGIN" =~ ^(aliyun|cloudflare|cloudxns|cpanel|digitalocean|dnsimple|dnsmadeeasy|domeneshop|gandi|gehirn|google|hetzner|inwx|linode|luadns|netcup|njalla|nsone|ovh|rfc2136|route53|sakuracloud|transip)$ ]] && \
102+
[[ "$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)$ ]] && \
103103
echo "Please set the DNSPLUGIN variable to a valid plugin name. See docker info for more details." && \
104104
sleep infinity
105105

@@ -216,6 +216,9 @@ if [ "$VALIDATION" = "dns" ]; then
216216
elif [[ "$DNSPLUGIN" =~ ^(aliyun|domeneshop|hetzner|inwx|netcup|njalla|transip)$ ]]; then
217217
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
218218
PREFCHAL="-a dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM}"
219+
elif [[ "$DNSPLUGIN" =~ ^(directadmin)$ ]]; then
220+
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
221+
PREFCHAL="-a ${DNSPLUGIN} --${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM}"
219222
else
220223
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
221224
PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM}"

0 commit comments

Comments
 (0)