local: fix dashboard origin to the external UI (http://localhost:3000)#3230
Open
jgraettinger wants to merge 1 commit into
Open
local: fix dashboard origin to the external UI (http://localhost:3000)#3230jgraettinger wants to merge 1 commit into
jgraettinger wants to merge 1 commit into
Conversation
The multi-stack refactor set the dashboard origin to a per-stack base+5 (FLOW_PORT_DASHBOARD), but nothing binds or serves base+5 — the estuary/ui dev-server runs off-stack on the laptop at :3000 and reaches a stack through `vm:port-forward`. So every consumer of that origin pointed at a dead port: CORS allow-origins (gazette's check is an exact string match, and an SSH -L forward can't rewrite the Origin header), Supabase site_url, the flowctl dashboard_url, and the reactor's FLOW_DASHBOARD. Introduce one global FLOW_DASHBOARD_ORIGIN=http://localhost:3000 (in stack-env, deliberately not stack-scoped, like cockpit :9090) and route all consumers through it: FLOW_SITE_URL, broker/reactor/agent CORS, reactor FLOW_DASHBOARD, the flowctl profile dashboard_url, and temp-data-plane's --flow.dashboard / --consumer.allow-origin. Includes the optional multi-stack UI escape hatch: the per-stack base+5 origin is kept as a SECOND CORS allow-origin on brokers/reactors/agent, so you can run a second UI against a second stack. Because gazette's ALLOW_ORIGIN env vars are single-valued, the two origins are passed as repeated --*.allow-origin flags in the unit ExecStart rather than via the EnvironmentFile. Known limitation (documented in local/README.md): site_url is single-valued and stays :3000, so a base+5 UI's Supabase auth redirect still lands on :3000.
jgraettinger
force-pushed
the
johnny/dashboard-origin-localhost-3000-675537
branch
from
July 22, 2026 20:10
2fa4632 to
15ba761
Compare
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.
Problem
The multi-stack local refactor set the dashboard origin to a per-stack
base+5(FLOW_PORT_DASHBOARD, e.g.10005). But nothing binds or servesbase+5— the estuary/ui dev-server runs off-stack on the developer's laptop athttp://localhost:3000and reaches a stack (local or remote) throughmise run vm:port-forward. So every consumer of that origin pointed at a dead port:http://localhost:<base+5>, but the browser'sOriginishttp://localhost:3000. Gazette's check is an exact string match, and an SSH-Lforward can't rewrite theOriginheader — so every cross-origin fetch from the UI (journal reads, shard listings) was rejected.site_url, the flowctl profiledashboard_url, and the reactor'sFLOW_DASHBOARDalso pointed atbase+5, so auth redirects andflowctl auth login's browser-open landed on a dead page.Change
Introduce one global, deliberately not stack-scoped
FLOW_DASHBOARD_ORIGIN="http://localhost:3000"(instack-env, like cockpit:9090) and route every consumer through it:FLOW_SITE_URL, broker/reactor/agent CORS, reactorFLOW_DASHBOARD, the flowctldashboard_url, andtemp-data-plane's--flow.dashboard/--consumer.allow-origin.Optional multi-stack UI escape hatch (included)
The per-stack
base+5origin is kept as a second CORS allow-origin on brokers/reactors/agent, so you can run a second UI against a second stack concurrently (convention: that stack'sbase+5). Because gazette'sALLOW_ORIGINenv vars are single-valued (noenv-delimupstream), the two origins are passed as repeated--*.allow-originflags in the unitExecStartrather than via theEnvironmentFile.Known limitation (documented in
local/README.md): Supabasesite_urlis single-valued and stays:3000, so abase+5UI's auth redirect still lands on:3000— log in via the:3000UI. Acceptable for this power-user path.Verification
Booted a full local stack and ran a live CORS smoke test (preflight
OPTIONS) against broker, reactor, and agent:http://localhost:3000(global UI)http://localhost:12005(base+5 escape hatch)Also confirmed: generated env files carry the new origins (no
*_ALLOW_ORIGINlines), running units'ExecStartcarry both flags, flowctldashboard_url=http://localhost:3000/, and SupabaseGOTRUE_SITE_URL=http://localhost:3000in the running auth container.go vet/gofmtclean; no pgTAP tests assertsite_url. Additionally verified working with a real UI on the host overvm:port-forward.