fix(tls): absolutise CERT_DIR so cron renewals actually install

acme.sh persists the --install-cert paths and replays them on every cron
renewal, where cwd is $HOME rather than the repo. The relative default
resolved to ~/certs/... so renewals wrote nothing: acme.sh kept renewing
cleanly while nginx served the stale copy until it expired. Apex, auth. and
pack. served expired certs on 2026-09-06.

Absolutise CERT_DIR in issue-letsencrypt.sh and document the failure mode,
the recovery command, and off-host verification in plan/15-letsencrypt.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018UJzZrBaZUoU6qHMLpLz64
This commit is contained in:
oierandClaude Opus 5 committed 2026-09-06 00:36:23 +02:00
1 parent 671e6af05a
commit 0176a674e3
2 files changed
+49 -1

No files matched your search

+6 -1
View File
@@ -52,7 +52,12 @@ ACME="${ACME_SH:-$HOME/.acme.sh/acme.sh}"
curl https://get.acme.sh | sh -s email=${LE_EMAIL}
then re-run (or set ACME_SH=/path/to/acme.sh)."
CERT_DIR="${CERT_DIR:-certs}"
# MUST be absolute: acme.sh persists these paths in its domain conf and replays
# them on every cron renewal, where cwd is $HOME, not the repo. A relative path
# there makes the renewal install silently write nothing -- acme.sh keeps renewing
# happily while nginx serves the stale (eventually expired) copy. Bit us 2026-09-06.
CERT_DIR="${CERT_DIR:-$PWD/certs}"
case "$CERT_DIR" in /*) ;; *) CERT_DIR="$PWD/$CERT_DIR" ;; esac
read -r -a SUBDOMAINS <<< "${LE_SUBDOMAINS:-auth pack distribution www avatar status}"
if [ "${LE_STAGING:-0}" = "1" ]; then