feat(sandbox): host→netns ingress forwarding so sandboxed apps serve edge traffic #91

Merged
gmackie merged 1 commit from feat/netns-ingress into main 2026-07-12 19:51:44 +00:00
Owner

Closes the sandbox ingress gap (documented 2026-06-08): edge routes point at host:port while sandboxed apps listen inside the netns, with no forwarding between them. The poll payload now carries the app+stage's edge-route ports and the agent installs idempotent DNAT + FORWARD rules at deploy time (plus ip_forward, which egress silently depended on).

Rollout note: needs an agent release after merge; then a forge deploy of a sandboxed app (e.g. classback) should be reachable from the edge without the unsandboxed workaround unit.

🤖 Generated with Claude Code

Closes the sandbox ingress gap (documented 2026-06-08): edge routes point at host:port while sandboxed apps listen inside the netns, with no forwarding between them. The poll payload now carries the app+stage's edge-route ports and the agent installs idempotent DNAT + FORWARD rules at deploy time (plus ip_forward, which egress silently depended on). Rollout note: needs an agent release after merge; then a `forge deploy` of a sandboxed app (e.g. classback) should be reachable from the edge without the unsandboxed workaround unit. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(sandbox): host→netns ingress forwarding so sandboxed apps serve edge traffic
All checks were successful
CI / ci (pull_request) Successful in 6m15s
c2ec39baf4
A netns-sandboxed app binds inside the namespace (10.200.0.x:port) but edge
routes reverse_proxy to host:port, where nothing listens — a sandboxed app
could be perfectly healthy yet unreachable from the edge (why classback
needed a hand-written unsandboxed unit).

- Poll payload now carries ingressPorts: the edge-route target ports for
  the deployment's app+stage (server resolves them from the routes table;
  the agent previously had no way to know a route existed).
- sandbox.EnsureIngress installs, per port: a PREROUTING DNAT
  (host-iface:port → appIP:port) and a FORWARD accept for the DNATed
  connection (replies ride the existing veth→host ACCEPT). Rules are
  check-before-add (-C) so redeploys don't duplicate them, and it runs on
  every deploy since route ports can change. Also sets
  net.ipv4.ip_forward=1, which the existing MASQUERADE silently relied on
  being set out-of-band. RemoveIngress provides symmetric teardown.
- Ingress failure degrades to a warning (deploy still proceeds), matching
  the existing sandbox-degradation behavior.

Go: build/vet/test green (new rule-shape tests follow the netns_test
conventions). Web: typecheck + agent route tests green. Takes effect after
the next agent release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gmackie deleted branch feat/netns-ingress 2026-07-12 19:51:44 +00:00
Sign in to join this conversation.
No description provided.