Repository navigation
fix(hub): serve live previews from a port range Compose can publish - #104
Merged
Merged
Conversation
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. Notes:
Triage will approve, request review, label. |
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
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.Replaces #93.