fix(self-hosting): pass CAP_CHROME_EXTENSION_ID through to the web container (#1993)#2035
fix(self-hosting): pass CAP_CHROME_EXTENSION_ID through to the web container (#1993)#2035DPS0340 wants to merge 1 commit into
Conversation
…ntainer The extension auth endpoint requires a pinned extension id on any reachable deployment — without one it rejects every redirect URI, since an unpinned id would let any installed extension mint auth keys for a signed-in user. The variable existed in the env schema but was never mapped into cap-web in either compose file, so self-hosters had no supported way to set it and extension login always failed with a 400. Document it alongside the other optional integrations.
|
@tembo please review |
|
Heads-up on CI: the That matters more than usual for this change, because I verified locally what I could — both files parse as valid YAML and the key resolves to (The red |
Fixes #1993.
Problem
CAP_CHROME_EXTENSION_IDis declared in the env schema (packages/env/server.ts:82) and is load-bearing for extension login, but it is not mapped into thecap-webservice in either compose file. Self-hosters have no supported way to set it, so extension login always fails.The failure is not a soft one.
validateExtensionRedirectUri(packages/web-backend/src/Extension/Http.ts) only tolerates an unpinned extension id on localhost:That check is correct and I have deliberately not touched it — the comment above it explains why, and it's right: without a pinned id, any installed extension could mint auth keys for a signed-in user. The bug is purely that a self-hosted deployment has no way to satisfy it, so every redirect URI is rejected with the
400the reporter saw.Fix
Three mechanical additions, no logic changes:
docker-compose.yml— passCAP_CHROME_EXTENSION_ID: ${CAP_CHROME_EXTENSION_ID:-}tocap-web, matching how the other optional integrations (GOOGLE_CLIENT_ID,APPLE_CLIENT_SECRET,RESEND_API_KEY) are wired.docker-compose.coolify.yml— same.docker-compose.coolify.env.example— a documented, empty entry so it's discoverable.Plus a Chrome Extension section in
self-hosting.mdx, next to the existing Google/Apple OAuth sections, explaining what the value is, why it's required, and where to find it.Defaulting to empty (
:-) keeps the current behaviour for anyone not using the extension: the var stays unset, the schema treats it asoptional(), and nothing changes.Notes
I left
docker-compose.template.ymlalone — it's a minimal template that doesn't carry the OAuth or Resend vars either, so adding just this one would be inconsistent with its scope.Verification
Diff: 4 files, +29/-0.