Repository navigation
Conversation
The live-app proxy gave each project's app a port chosen at random, so its origin stayed its own and its cookies apart from the hub's. A deployment that publishes ports, such as Compose, cannot publish a port it does not know, so from a browser outside the container the preview never loaded while the hub inside answered on it. LIVE_APP_PORTS names a range, 4100-4119 by default under Compose, from which the proxy takes the first free port per project; the Compose file publishes the range on loopback beside the hub's port and the self-host docs explain it. Without the setting any free port serves, as on a developer's machine. With every port of the range in use, the app is reported as failed with the reason instead of the request failing. Closes #91
Contributor
Author
|
Continued, rebased onto main, with the triage finding fixed, in a replacement pull request from branch fix/live-app-port-range-main. |
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.
Closes #91
Stacked on #72, since the preview needs both to work under Compose; its base should move to
mainonce #72 merges.What changed
apps/hub/src/environment.ts:LIVE_APP_PORTS, a range such as4100-4119, read asliveAppPorts; absent means any free port, as before. Malformed values refuse startup with a clear message.apps/hub/src/live-app/proxy.ts:serveWithintakes the first free port of the range, skipping ports the other apps hold and ports something else already holds, and fails withlive_app_ports_exhaustedwhen none is left. Without a range it binds port 0 as before.apps/hub/src/artifacts/service.ts: when exposing fails, the app is reported asfailedwith the reason instead of the request failing.deploy/compose.yml: publishes the range on loopback beside the hub's port and passes it to the hub..env.hub.exampleanddocs/SELF_HOST.md: document the setting and the one-port-per-open-project limit.apps/hub/src/environment.test.ts: covers the parser.Why
Compose publishes only the hub's port and the two login ports. The proxy's origin for a project's app was the hub's public origin with a random port swapped in, so on 2026-11-02 the preview frame pointed at
http://localhost:34141, which the browser could not reach, while the hub inside answered on it. Details in #91.How it was verified
tsc --noEmit -p .passes;oxlint --deny-warningsand Prettier pass on the changed files;environment,live-appandartifactstests pass (12 tests, 1 new).docker compose configrendersLIVE_APP_PORTS=4100-4119in the hub's environment and publishes the twenty ports.