From 7400a652e3fec9652cba14b219b800b1df2ba987 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 25 Jul 2026 18:05:36 +0200 Subject: [PATCH] fix(sys-ca-selfsigned): write the combined CA bundle to a writable temp path The CA-injection entrypoint wrapper built the combined bundle inside /tmp/infinito, which is the root-owned mount root docker creates for the read-only cert and wrapper binds. Any image whose entrypoint runs as a non-root user (node, www-data) hit 'cannot create /tmp/infinito/ca-trust-combined.crt: Permission denied' and never started; web-app-openclaw looped on restart. Images starting as root (s6-based ones like hermes) masked the defect. mktemp -t resolves TMPDIR itself and always yields a path writable by the running user, so the wrapper no longer creates a directory it does not own. Co-Authored-By: Claude Opus 4.8 --- roles/sys-ca-selfsigned/files/with-ca-trust.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/roles/sys-ca-selfsigned/files/with-ca-trust.sh b/roles/sys-ca-selfsigned/files/with-ca-trust.sh index a550d95853..de2725ba06 100644 --- a/roles/sys-ca-selfsigned/files/with-ca-trust.sh +++ b/roles/sys-ca-selfsigned/files/with-ca-trust.sh @@ -42,8 +42,7 @@ export CURL_CA_BUNDLE="$CA_TRUST_CERT" export NODE_EXTRA_CA_CERTS="$CA_TRUST_CERT" if [ -n "${CA_TRUST_CERT_EXTRA:-}" ] && [ -r "${CA_TRUST_CERT_EXTRA}" ]; then - combined="/tmp/infinito/ca-trust-combined.crt" - mkdir -p "$(dirname "$combined")" + combined="$(mktemp -t ca-trust-combined.XXXXXX)" cat "$CA_TRUST_CERT" "$CA_TRUST_CERT_EXTRA" > "$combined" export SSL_CERT_FILE="$combined" export REQUESTS_CA_BUNDLE="$combined"