Skip to content

Commit

Permalink
Add option to specify ACME server and EAB authentication (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
jderuiter authored Dec 19, 2023
1 parent f15c239 commit 85e52a2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docker/defaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ LETSENCRYPT_STAGING=0
# email address to use for letsencrypt contact
LETSENCRYPT_EMAIL=

# specify ACME server
CERTBOT_SERVER=
# credentials for ACME with EAB
CERTBOT_EAB_KID=
CERTBOT_EAB_HMAC_KEY=

# list of comma separated domains that are also served but redirect to the primary domain name
REDIRECT_DOMAINS=

Expand Down
3 changes: 3 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ services:
- IPV4_IP_PROMETHEUS_INTERNAL
- LETSENCRYPT_STAGING
- LETSENCRYPT_EMAIL
- CERTBOT_SERVER
- CERTBOT_EAB_KID
- CERTBOT_EAB_HMAC_KEY
- REDIRECT_DOMAINS
- NGINX_PROXY_CACHE
- INTERNETNL_BRANDING
Expand Down
19 changes: 19 additions & 0 deletions docker/webserver/certbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ else
email="--register-unsafely-without-email"
fi

if [ ! -z $CERTBOT_SERVER ]; then
server="--server=$CERTBOT_SERVER"
fi


if [ ! -z $CERTBOT_EAB_KID ]; then
eab_kid="--eab-kid=$CERTBOT_EAB_KID"
fi

if [ ! -z $CERTBOT_EAB_HMAC_KEY ]; then
eab_hmac_key="--eab-hmac-key=$CERTBOT_EAB_HMAC_KEY"
fi

domain=$INTERNETNL_DOMAINNAME
subdomains="nl.$domain,en.$domain,www.$domain,ipv6.$domain,conn.$domain,en.conn.$domain,nl.conn.$domain,www.conn.$domain"
if [ ! -z $REDIRECT_DOMAINS ];then
Expand All @@ -40,6 +53,9 @@ configure_letsencrypt() {
--webroot \
$staging \
$email \
$server \
$eab_kid \
$eab_hmac_key \
--cert-name $domain \
-d $domain
cert_acquired=$?
Expand Down Expand Up @@ -67,6 +83,9 @@ configure_letsencrypt() {
--webroot \
$staging \
$email \
$server \
$eab_kid \
$eab_hmac_key \
--cert-name $domain \
-d $domain \
-d $subdomains \
Expand Down

0 comments on commit 85e52a2

Please sign in to comment.