fix(web): allow relay-backup origin in CSP connect-src#4649
Conversation
Adds wss:// and https:// origins for relay-backup.superset.sh to the web app's connect-src. The relay URL can be overridden to the backup relay via the relay-url-override PostHog flag; the prod CSP has no blanket ws:/wss:, so both the WebSocket and HTTPS origins must be listed.
|
Ready to review this PR? Stage has broken it down into 1 individual chapter for you:
Chapters generated by Stage for commit 0b20f84 on May 16, 2026 10:55pm UTC. |
|
Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe web application's Next.js configuration is updated to permit relay-backup connectivity through the Content-Security-Policy ChangesContent Security Policy Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — a two-line additive change to the CSP allowlist with no logic alterations. The change correctly adds both the WebSocket and HTTPS origins for the backup relay, matching the dual-protocol pattern already in place for the primary relay. The new entries are unconditionally present (including in dev), but the dev CSP already allows blanket No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/web/next.config.ts | Adds two hardcoded CSP connect-src entries for the backup relay origin (wss:// and https://), correctly following the same dual-protocol pattern as the primary relay. |
Reviews (1): Last reviewed commit: "fix(web): allow relay-backup origin in C..." | Re-trigger Greptile
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
Adds wss:// and https:// origins for relay-backup.superset.sh to the web app's connect-src. The relay URL can be overridden to the backup relay via the relay-url-override PostHog flag; the prod CSP has no blanket ws:/wss:, so both the WebSocket and HTTPS origins must be listed.
Summary
wss://relay-backup.superset.shandhttps://relay-backup.superset.shto the web app's CSPconnect-src.Why
The relay URL can be overridden to the backup relay via the
relay-url-overridePostHog flag (the same failover mechanism the desktop uses). The desktop already whitelistsrelay-backup.superset.shin its CSP; the web app's production CSP has no blanketws:/wss:, so both the WebSocket and HTTPS origins must be listed explicitly or a failover connection is blocked.Testing
bun run lint— cleanbun run typecheck— clean (28/28)Summary by cubic
Add relay backup origins to the web app’s CSP connect-src to support failover. Allows connections to wss://relay-backup.superset.sh and https://relay-backup.superset.sh so the PostHog relay-url-override can switch without being blocked.
Written for commit 0b20f84. Summary will update on new commits. Review in cubic
Summary by CodeRabbit