Repository navigation
refactor(env): reach pgweb and db-mcp only through the gateway's /svc routes - #823
Draft
andrewpark-scaleai wants to merge 4 commits into
Draft
andrewpark-scaleai wants to merge 4 commits into
andrewpark-scaleai wants to merge 4 commits into
Conversation
The gateway serves the env's SQL consoles at /svc/pgweb/ and /svc/db-mcp/ from a new CONSOLE_URLS variable, behind the deployment's control token like its other guarded routes. The deploy records db_web_gateway_url and db_mcp_gateway_url once it has checked the gateway serves both, and keeps db_web_url and db_mcp_url as they are. db-mcp binds every address family on the container path. The CLI prints the gateway URLs, and a website can no longer be named pgweb or db-mcp.
…etry the console probe - A multi env's computer can't be named pgweb or db-mcp. The gateway serves a computer at /svc/<name>/, so such a computer used to pass the env's name checks and stop the gateway at startup, after every sandbox was made. - Requests to a SQL console are forwarded without a write window. Only the control token reaches a console, so a write through one is no role's, and it no longer runs the changelog queries on the event loop. - The deploy asks each console up to four times: a dropped or refused connection is asked again, as a timeout or a 502-504 already was. - _verify_list_tools uses the MCP SDK's client (30 s, redirects), as it did before it took headers, and the tests check the record names db-mcp at the gateway before using it. - A bad CONSOLE_URLS or WEBSITE_URLS entry names its own variable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… routes The VM path exposes only the gateway's port, the compose file publishes no port for pgweb or db-mcp, and the container path creates their sandboxes with expose_externally=False. DeployedGateway drops db_web_url and db_mcp_url, so new records name the consoles only at db_web_gateway_url and db_mcp_gateway_url. DeployedGatewayEnv still reads both from older records for one release.
andrewpark-scaleai
force-pushed
the
andrewpark/gateway-only-console-ports
branch
from
November 19, 2026 20:22
fc74893 to
572b192
Compare
This branch has not been deployed
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.
Why
After #821, the gateway serves pgweb and db-mcp at
/svc/. This PR makes that the only way in, so deploys expose one port (the gateway's) and records carry one set of console URLs.What changed
env-networkstill reach them.expose_externally=False, as it already does for other sidecars.DeployedGatewaydropsdb_web_urlanddb_mcp_url, so no deploy writes them.DeployedGatewayEnvstill reads them from older records for one release.Blast Radius
db_web_urlordb_mcp_urlgets None on a new deploy's record. Every one must move todb_web_gateway_url/db_mcp_gateway_urlfirst.Verification
create_vmgets only the gateway and sidecar ports.tst/unit/env/test_env.pyloads a record from an older deploy.tst/unit/env,tst/unit/providersandtst/unit/clipass.ruff check src tstpasses.modal_vm: the consoles answer through the gateway with the token.