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 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 4.8 committed 2026-07-25 18:05:36 +02:00
1 parent d0721d2e36
commit 7400a652e3
1 file changed
+1 -2
@@ -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"