Apps reach their dens from every window β even the native shell#377
Open
jerpint wants to merge 2 commits into
Open
Apps reach their dens from every window β even the native shell#377jerpint wants to merge 2 commits into
jerpint wants to merge 2 commits into
Conversation
The dens were reachable from every window in the colony but one: the native shell. Clicking an app did nothing β the lodge just stared back. macOS App Transport Security waves through the loopback (127.0.0.1) and the literal "localhost", which is how the shell reaches the lodge at all. But apps live on *.localhost subdomains (blog.localhost:7777), which ATS does not exempt β so WebKit silently refused to follow the lodge's redirect and the window never moved. Add an Info.plist ATS exception for localhost + subdomains so the shell can walk the same path a browser does. Tunnel app subdomains are HTTPS and need no exception. Pairs with the server-side redirect fix so apps behave identically in a browser, the PWA, the desktop shell, and through the tunnel. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
The pond went dark for the apps
Somewhere along the unified-navigation trail, the dens lost their doorways. Clicking a running app used to open its own space at
blog.localhost:7777β a real origin, root and all. The navigation rework swapped that for the path route/app/{name}/, and the lodge, trying to be helpful, redirected clicks to the app's raw in-container port (localhost:4001). But that port is never published to the host β only7777is. So the redirect was a dead end everywhere except a browser that happened to expose the port. In the macOS shell it was worse: the redirect pointed at the public tunnel, or nowhere.The colony has exactly one way apps were ever meant to be reached: the
subdomain_proxymiddleware, which takesblog.localhost:7777(orblog.woltspace.comthrough the tunnel) and forwards it β inside the container β to the app's port. One doorway (7777 / the tunnel), fan-out by hostname. That keeps every app at the root of its own origin, so absolute paths, cookies, and routing behave the same in or out of woltspace.This PR points every client back at that doorway, and teaches the native shell to walk through it.
What changed
server/app.pyβ apps redirect to their own origin, never a raw port./app/{name}/now redirects to the app subdomain:{name}.localhost:<lodge-port>locally,{name}.{tunnel}publicly β which the existingsubdomain_proxyforwards to the in-container port. The raw-port redirect is gone; it was a dead end for every client but a lucky same-host browser. Also fixesis_local, which never matched127.0.0.1β exactly the origin the desktop shell loads from.desktop/src-tauri/Info.plistβ ATS exception forlocalhost+ subdomains. macOS App Transport Security waves through127.0.0.1and the literallocalhost(how the shell reaches the lodge), but not*.localhost. So WebKit silently refused to follow the lodge's redirect to an app and the window never moved. The exception lets the shell take the same path a browser does. Tunnel app subdomains are HTTPS and need nothing.Together: apps behave identically in a browser, the PWA, the desktop shell, and through the Cloudflare tunnel.
Why it's shippable, not a per-user hack
.appbundle β every install carries it.Test plan
/app/blog/β302 β http://blog.localhost:7777/(wasβ localhost:4001); path + query preservedHost: blog.localhost:7777still serves the app200(proxy path intact)localhost:7777blog.<domain>)Info.plistbash test/run-tests.sh uniton CIOne-line closer
𦫠the dens have doorways again β and the native shell finally knows how to knock.
π€ Generated with Claude Code