You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Live Preview is served on a random port the Compose deployment never publishes #91
What happened. With the hub running from deploy/compose.yml, the Live Preview never loads. The app itself is up and reachable from inside the hub, but the preview frame points at http://localhost:34141 and the browser cannot connect.
Why.apps/hub/src/live-app/proxy.ts gives each project's app an origin of its own: a Bun.serve on port: 0, so a port chosen at random on the hub host, and the origin handed to the UI is the hub's public origin with that port swapped in. That keeps the app's cookies apart from the hub's and lets the app keep absolute paths, which is right. But Compose publishes only the hub's port and the two login ports (PORT, 1455, 1456). A random port cannot be published in advance, so from a browser outside the container the origin is unreachable. On a Mac where the hub runs on the host directly, every port it opens is reachable, which is why this never showed.
Seen 2026-11-02: inside the container the proxy answered on 34141 with the expected "Sign in to Builder" 401; docker port corbits-builder-hub-1 listed only 1455, 1456 and 8877.
Expected. The preview works from a browser outside the container without weakening the origin separation.
Proposed fix. A configured range of live-app ports, LIVE_APP_PORTS such as 4100-4119, from which the proxy picks a free port per project; deploy/compose.yml publishes that range on loopback beside the hub's port; the self-host docs explain it, including the one-port-per-open-project limit it implies. Absent the setting, the proxy keeps picking any free port, as on a Mac.
Related: #71 (the app was also unreachable from the hub itself on Linux), #66.
Activity