Repository navigation
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Collaborator
|
Thanks @ianriizky — your work is now merged into What was adjusted on top of your commits before merging:
Closing this PR since the code shipped via #5878. For future PRs, targeting the current |
This was referenced Jul 2, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NEXT_PUBLIC_LIVE_WS_PUBLIC_URLenv var so the live dashboard WebSocket client can connect via a custom domain (reverse proxy / Cloudflare Tunnel) instead of the hardcodedws://hostname:20129.LIVE_WS_ALLOWED_HOSTSenv var documentation to.env.examplefor LAN/Tailscale hostname-based origin allow-listing (already used insrc/server/ws/liveServerAllowList.tsbut not documented).ai_featuresscope to GitLab Duo OAuth env setup instructions in.env.example.Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesTests Added Or Updated
tests/unit/live-ws-public-url.test.ts(new) — 3 test cases:publicUrlwhenNEXT_PUBLIC_LIVE_WS_PUBLIC_URLis setnullpublicUrlwhen env var is unsetWS_PROTOCOL.liveincludespublicUrlfieldCoverage Notes
src/hooks/useLiveDashboard.ts—getDefaultWsUrl()now readsNEXT_PUBLIC_LIVE_WS_PUBLIC_URLfirst. The new branch is covered indirectly by the handshake endpoint test (which reads the same env var). The function itself is not directly unit-tested because it's a non-exported function in a"use client"module; existing behavior is preserved via the fallback path.src/app/api/v1/ws/route.ts— newpublicUrlfield is covered bytests/unit/live-ws-public-url.test.ts..env.example— documentation-only changes, no coverage impact.Reviewer Notes
/live-wsupgrade proxy already exists inscripts/dev/standalone-server-ws.mjs(shipped asserver-ws.mjsin production builds viascripts/build/assembleStandalone.mjs). It performs a raw TCP forward from port 20128 to port 20129, preserving all headers includingCookieandOrigin.auth_tokencookie is forwarded verbatim, soisDashboardCookieAuthenticated()inliveServer.tsvalidates normally.LIVE_WS_ALLOWED_ORIGINSto include the public origin (e.g.https://ws.my-ai.com), otherwise the Origin check inliveServer.tswill reject browser connections. This is documented in.env.example.NEXT_PUBLIC_LIVE_WS_PUBLIC_URLis unset,getDefaultWsUrl()falls back to the existingws://hostname:20129logic. The newpublicUrlfield in the handshake response is additive (nullwhen unset).Architecture
Configuration Example