hephaestus/forgejo/Dockerfile
Local Dev fc43382d48 feat(gateway,hephaestus): forward proxied headers + trust Silent Mode CA
Two pieces from testing "login through hephaestus.x":

1. bns-gateway (public-gateway.mjs, ip: case) — forward the upstream's
   response headers, not just content-type. The old code stripped Location,
   Set-Cookie, and everything else, so redirects from a proxied hostname
   died silently in the browser ("Temporary Redirect" body with no Location
   header). Header set now respects RFC 7230 hop-by-hop exclusions and
   drops Content-Length (we may rewrite HTML for baseHref).

2. Hephaestus stack:
   - forgejo/Dockerfile: tiny extension of the official image that copies
     the Silent Mode Argonautica root CA into the OS trust store, so
     Forgejo's Go client can validate hephaestus.x's cert on OIDC discovery
     calls. Deliberately no `USER git` at the end — parent's s6-overlay
     needs to init as root.
   - docker-compose.yml: switch to `build: ./forgejo` and add
     `extra_hosts: - "hephaestus.x:host-gateway"` so Forgejo can resolve
     hephaestus.x back to the host's Caddy.

Both changes are inert at the moment because Forgejo's ROOT_URL is back at
code.silentmode.st (browsers-without-BCNR-resolvers couldn't complete
OAuth through hephaestus.x because session cookies don't cross origins —
the working UX has the "Sign in with wallet" button on hephaestus.x
delegate to code.silentmode.st). Keep the infrastructure in place for when
Theseus/Ariadne adoption makes it viable to flip ROOT_URL properly.
2026-08-31 16:23:43 +02:00

10 lines
582 B
Docker

# Forgejo + Silent Mode CA cert baked into the trust store, so Forgejo's Go
# client can validate hephaestus.x's cert (issued by Argonautica) when it
# fetches OIDC discovery from https://hephaestus.x/auth/.well-known/... .
#
# Do NOT switch to USER git at the end — parent image's s6-overlay init needs
# to start as root (it drops to `git` internally). USER git broke s6-svscan
# with "unable to open .s6-svscan/lock: Permission denied".
FROM codeberg.org/forgejo/forgejo:10
COPY silent-mode-ca.crt /usr/local/share/ca-certificates/silent-mode-ca.crt
RUN update-ca-certificates