fix(server): route Compose proxy through host mappings - #1698
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 536490dd43
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
536490d to
102567a
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Make the repository's Docker Compose example use host-mapped sandbox proxy
targets and make
host.docker.internalresolve on Linux. Clarify the samenetwork-topology requirement in the server and single-host networking docs.
Motivation
The Compose lifecycle server is attached to
opensandbox-net, while sandboxescreated through the mounted Docker socket use Docker's separate default bridge.
With the historical/default
proxy.resolve_internal = true, server-proxiedrequests to a sandbox without an egress sidecar target its
172.17.x.xaddress.That address is not normally routable from the lifecycle server container on
Linux, so
/proxy/44772/pingwaits until the client times out.This can be masked when a request includes
networkPolicy: those sandboxes usethe egress sidecar path, for which Docker endpoint resolution already falls back
to a host-mapped port. Switching between the two sandbox shapes can therefore
look like an intermittent lifecycle or connection-pool failure.
proxy.resolve_internal = falseis the existing supported control for thistopology. The example now selects it explicitly and supplies the Linux
host-gatewaymapping required by its configureddocker.host_ip.This is a follow-up to #1631: that PR introduced the routing control; this PR selects the correct mode for the repository's shipped Compose topology.
Related: #252, #404, and #1631.
Changes
[proxy] resolve_internal = falseinserver/docker-compose.example.yamlhost.docker.internal:host-gatewayto both example containers[proxy] resolve_internalValidation
cd server && uv run pytest -q tests/test_docker_compose_example.py tests/test_config.py tests/test_docker_endpoint.py tests/test_routes_proxy.py(241 passed)cd server && uv run ruff check tests/test_docker_compose_example.pycd server && uv run pyright tests/test_docker_compose_example.pydocker compose -f server/docker-compose.example.yaml configcd docs && pnpm install --frozen-lockfile && pnpm docs:buildsandbox passed after selecting host-mapped proxy targets:
https://github.com/yanpgwang/mango/actions/runs/33511967527
Breaking Changes
Security
This does not add a new published port or change the example's existing Docker
port exposure. It changes only which existing path the lifecycle server uses to
reach a sandbox. Deployments should continue to restrict host-published sandbox
ports with host firewall and network policy appropriate to their trust model.
Checklist