Repository navigation
feat(computer): a computer reaches the run's websites by their names (FD-4683) - #448
williamloo-scale wants to merge 9 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
earakely-scale
left a comment
There was a problem hiding this comment.
We've reviewed this against our plan for websites in the computer. Three parts are better than what we'd planned, and we've changed our design docs to follow them:
- the CA made for each deploy, limited to the run's site names, with its key discarded after signing;
- the transparent loopback routing;
- the site table's rules.
The latest commits already fix three things we'd found: Chromium's trust (the CACertificates policy), the check's time budget, and WebSockets through the gateway. Four things are inline. Three smaller ones are below, and are optional.
Smaller things:
- Leaf keys:
RootChannel.write(sites.py:324) sends them base64-encoded in abash -cargument, through a staging file in the VM host's/tmp.write_secret_fileavoids both. site_routingvalidation:run_env_params(computer/env.py:172) uses the value beforeComputerParamsvalidates it."web-env"becomes one env id per character, and1raises a TypeError.- Rewrites:
- a scheme-relative
Location: //gw/website/notes/xis passed through unchanged (site_proxy.py:181), so the browser leaves the site's name for the gateway; Set-Cookie: ...; Path = /website/notes/x, with spaces around=, isn't rewritten (site_proxy.py:200).
- a scheme-relative
… traffic/v1 (FD-4683) This PR's change, rebased as one commit onto #448. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
a50d72f to
a767a25
Compare
cb672e5 to
306587d
Compare
… traffic/v1 (FD-4683) This PR's change, rebased as one commit onto #448. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
a767a25 to
d160d31
Compare
306587d to
2b782e9
Compare
2b782e9 to
0d613b8
Compare
d160d31 to
5953d5a
Compare
… traffic/v1 (FD-4683) This PR's change, rebased as one commit onto #448. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0d613b8 to
9495ed2
Compare
9495ed2 to
25dcf9a
Compare
… traffic/v1 (FD-4683) This PR's change, rebased as one commit onto #448. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
4283738 to
0cca3db
Compare
… traffic/v1 (FD-4683) This PR's change, rebased as one commit onto #448. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0cca3db to
a1ec8b4
Compare
c2bd2fb to
f7c679d
Compare
… traffic/v1 (FD-4683) This PR's change, rebased as one commit onto #448. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
a1ec8b4 to
d044c00
Compare
f7c679d to
571c04b
Compare
… traffic/v1 (FD-4683) This PR's change, rebased as one commit onto #448. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
d044c00 to
f813a59
Compare
571c04b to
04d3f23
Compare
|
@earakely-scale thanks for the review. Everything you raised is now addressed in #448: Inline (replied to and resolved on each thread):
The smaller three (
Each new test fails on the code before its fix. |
… traffic/v1 (FD-4683) This PR's change, rebased as one commit onto #448. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
f813a59 to
faf8e7c
Compare
04d3f23 to
956163f
Compare
…(FD-4683) This PR's change, rebased as one commit onto #447. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… their route, and bound DNS and WebSocket relays (FD-4683) - site_routing on a disk computer is refused before boot, and a container form is chosen when one is ready. - deployed_sites matches a card's website to its frontend URL by its /svc/<name>/ route, not its card name. - The in-computer DNS relay passes on an upstream UDP answer whole, up to the largest datagram. - The gateway's WebSocket relay holds at most WEBSOCKET_MESSAGE_MAX_BYTES of one upstream message, closing both sides with 1009 past it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…proxy running as nobody, and pass CORS preflights (FD-4683) - With site_routing, a computer holds its boot apps' launches (AGENTENV_HOLD_BOOT_LAUNCH); the driver counts a held app ready, and the provider launches each through computer-app/v1's launch once the names, CA and proxy are in place, then waits until the computer is ready. - The site proxy drops to nobody where the base has it, so the agent can't stop it; keep, as root, starts it again should it end; its log sits in the root-owned config folder and is opened without following a link. - A website's gateway routes accept OPTIONS, so a CORS preflight between two sites reaches the site. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… alone, so a name longer than a common name takes is signed (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…stream, kept where root alone reads them (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…the sites it forwards to, and relays a refused handshake's headers (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…part, each named for its env (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ths its card advertises, with no state path (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…_routing before reading it, and rewrite scheme-relative redirects and spaced cookie paths (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… traffic/v1 (FD-4683) This PR's change, rebased as one commit onto #448. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
faf8e7c to
27a865f
Compare
Stacked on #447.
A deployed computer reaches the run's websites by their own names (
https://notes.test/), opt-in.computer/utils/sites.py): each site's names claimed once, synthetic over live over the network allowlist.site_proxy.py, standard library only, runs on the computer's python3: it maps the names to loopback, trusts the CA (system store, Firefox policy, NSS) and proxies 443/80 (and DNS for wildcards) to the site's gateway route withX-Forwarded-Host/-Proto, rewriting redirects and cookies and relaying WebSockets.env_params.site_routing(true, or env ids):deploy_envfills the table from the websites deployed before the computer, read from their cards; once the computer is ready the provider installs the proxy and records the table, the CA and each name's check. A reset routes the new computer under a new CA. Withoutsite_routingnothing changes.Before merging
WebsiteBrowserEnvironment(feat(computer): WebsiteBrowserEnvironment, the base class for website browsers #449): this proxy answers on loopback through the hosts file, so a website browser in a computer, which bypasses loopback and has noAGENTENV_SITE_PROXYset there yet, reaches the sites through it. SettingAGENTENV_SITE_PROXYin a computer (M5.5/M5.7) would need a forward proxy, which this isn't.Test
Unit suite: 12,923 passed (one GitHub-clone test from main, which hangs on the local machine on main too, deselected).
🤖 Generated with Claude Code


Confidence Score: 5/5
No new blocking issue was established in the reviewed changes.Summary
Adds opt-in routing so a computer can open the run’s websites by their declared names.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Run[Previously deployed websites] --> Table[Site names and gateway routes] Table --> Install[Install certificates and local proxy] Install --> Apps[Launch held boot apps] Browser[Computer browser] --> Proxy[Local site proxy] Proxy --> Gateway[Website gateway route] Gateway --> Website[Website server]Reviews (18) · Last reviewed commit: "fix(computer): write the routing config'..." · Reviewed by Greptile