self-heal standalone cert renewal configs on provision
Provision server / provision (push) Successful in 22s

This commit is contained in:
2026-06-08 11:35:37 -04:00
parent f093a66580
commit 0f951281d5
2 changed files with 30 additions and 1 deletions
+24
View File
@@ -37,6 +37,25 @@ fi
echo "==> Deploying services..."
# Deploy nginx first (creates the shared network)
bash "$REPO_DIR/scripts/deploy.sh" deploy-nginx
# Self-heal renewal config drift: certs issued by the old --standalone flow
# (removed in de1d60b) can never renew because nginx now holds port 80. Reissue
# any such cert via the canonical webroot path. nginx must be up (above) to
# serve the ACME challenge. Best-effort: a single failure warns but does not
# block the rest of the provision.
echo "==> Healing standalone cert renewal configs..."
heal_failed=false
for conf in /etc/letsencrypt/renewal/*.conf; do
[ -e "$conf" ] || continue
grep -q '^authenticator = standalone' "$conf" || continue
cert_name=$(basename "$conf" .conf)
echo " $cert_name uses standalone; reissuing via webroot..."
if ! bash "$REPO_DIR/scripts/deploy.sh" "cert-$cert_name"; then
echo " WARNING: failed to reissue $cert_name; leaving standalone config in place"
heal_failed=true
fi
done
# Deploy all other apps
for app in "$REPO_DIR"/docker/*/; do
app_name=$(basename "$app")
@@ -46,3 +65,8 @@ for app in "$REPO_DIR"/docker/*/; do
done
echo "==> Done."
if [ "$heal_failed" = true ]; then
echo "ERROR: one or more standalone certs could not be reissued (see warnings above)."
exit 1
fi