From c7d9e0e2a3e4c4e0147e2a3b55d025a27e338dcf Mon Sep 17 00:00:00 2001 From: Rich Turner <7072278+richturner@users.noreply.github.com> Date: Sun, 3 Apr 2022 14:16:57 +0100 Subject: [PATCH] Sync haproxy certs during startup --- entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 26400a2..a3c7bd1 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -338,7 +338,7 @@ cron_auto_renewal_init() { done IFS=$IFS_OLD - # Remove any stale/obsolete certificates + # Remove any stale/obsolete certificates and check haproxy full chain file exists DIRS=$(ls -1d ${LE_DIR}/live/* 2>/dev/null) IFS_OLD=$IFS IFS=$'\n' @@ -351,6 +351,9 @@ cron_auto_renewal_init() { if [[ "$DOMAINNAMES" != "$CERT"* ]] && [[ "$DOMAINNAMES" != *",$CERT"* ]]; then log_info "Removing obsolete certificate for '$CERT'" remove "$CERT" + else + RENEWED_LINEAGE="$LE_DIR/live/$CERT" + sync_haproxy fi done IFS=$IFS_OLD