Skip to content

Commit

Permalink
scripts/entry.sh: fix cert renewal
Browse files Browse the repository at this point in the history
Certificate renewal was broken because renewed certificates were stored
in the container's /etc/letsencrypt, which was subsequently removed and
soft-linked from /host/etc/letsencrypt.

This change fixes that by moving cert renewal after the /host/etc ->
/etc handling. It also disables certbot's random sleep before renewal
since that would impact the mailserver's startup time.

Signed-off-by: Thilo Fromm <github@thilo-fromm.de>
  • Loading branch information
t-lo committed Jul 22, 2023
1 parent 9405e75 commit d30b5b3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ function check_letsencrypt() {
certbot certonly --non-interactive --webroot --webroot-path /host/srv/www/html \
--agree-tos --email "${ADMIN_EMAIL}" \
-d "${HOSTNAME}"
else
echo "##### ENTRY: checking for certificate renewals"
certbot renew --non-interactive --webroot --webroot-path /host/srv/www/html
fi

init_srv_cfg letsencrypt

echo "##### ENTRY: checking for certificate renewals"
certbot renew --non-interactive --no-random-sleep-on-renew \
--webroot --webroot-path /host/srv/www/html
}
# --

Expand Down

0 comments on commit d30b5b3

Please sign in to comment.