Add fail-closed NPM ACME bootstrap entrypoint

This commit is contained in:
2026-09-19 00:13:13 -04:00
parent 47f972161f
commit 6cff2261d5
+22 -1
View File
@@ -3,14 +3,35 @@ set -euo pipefail
readonly ACME_AUTHORITY_ROOT="${ACME_AUTHORITY_ROOT:-/acme_authority}" readonly ACME_AUTHORITY_ROOT="${ACME_AUTHORITY_ROOT:-/acme_authority}"
readonly PATCHER="${ACME_AUTHORITY_ROOT}/patch_acme.py" readonly PATCHER="${ACME_AUTHORITY_ROOT}/patch_acme.py"
readonly NPM_ENTRYPOINT="${NPM_ENTRYPOINT:-/init}"
log() log()
{ {
printf '[acme-authority] %s\n' "$*" printf '[acme-authority] %s\n' "$*"
} }
fail()
{
log "ERROR: $*"
exit 1
}
log "Bootstrap starting" log "Bootstrap starting"
[[ -r "$PATCHER" ]] ||
fail "patcher not readable: $PATCHER"
command -v python3 >/dev/null 2>&1 ||
fail "python3 is not available"
[[ -n "$NPM_ENTRYPOINT" ]] ||
fail "NPM_ENTRYPOINT is empty"
log "Applying configured ACME authority gates"
python3 "$PATCHER" python3 "$PATCHER"
log "Bootstrap completed" log "ACME authority patch and verification completed"
log "Handing off to NPM entrypoint: $NPM_ENTRYPOINT"
exec "$NPM_ENTRYPOINT"