···66# proxied through Caddy (e.g. the PDS OAuth endpoints).
77#
88# Reading Caddy's CA (its pki/ tree is root-owned, mode 0700 to protect the CA
99-# key) and installing it into the system trust store both require root. The
1010-# image now runs as the non-root `app` user, so the e2e compose overrides the
1111-# container user back to root for this bootstrap; we install the CA as root and
1212-# then drop to `app` to run the server, keeping the non-root runtime under test.
99+# key) and installing it into the system trust store both require root, so the
1010+# e2e compose runs this container as root. The production image also runs as
1111+# root (see the Dockerfile note on the reverted non-root user), so after the CA
1212+# bootstrap we run the server directly — matching production, no privilege drop.
1313CA_CERT=/caddy-data/caddy/pki/authorities/local/root.crt
1414if [ -d /caddy-data ]; then
1515 echo "Waiting for Caddy CA certificate..."
···1919 echo "Caddy CA certificate installed."
2020fi
21212222-# Drop back to the unprivileged app user (uid 10001) to run the server when we
2323-# started as root; run directly otherwise (already unprivileged).
2424-if [ "$(id -u)" = "0" ]; then
2525- exec runuser -u app -- /entrypoint.sh "$@"
2626-fi
2722exec /entrypoint.sh "$@"