Repository navigation
app/: routing by hostname (sc-8900) - #53
Merged
Merged
Conversation
VisualCIdocspring/visualci · build #207 · 331 unchanged · no changes This PR vs base: 2 changed since #194, across 3 builds Updated as builds change. Agents can review with VisualCI's MCP tools. |
ndbroadbent
force-pushed
the
laravel-sign-in
branch
from
December 2, 2026 13:00
c669c75 to
85d427c
Compare
ndbroadbent
force-pushed
the
laravel-hosts
branch
from
December 2, 2026 13:04
ac4ab44 to
d141bf4
Compare
…_URL set, the app, API and MCP hosts each serve only their own paths (a 404 page otherwise), the app's / sends a visitor without a session to the landing page, and any other host gets every path; ported from server/src/hosts.rs
ndbroadbent
force-pushed
the
laravel-hosts
branch
from
December 2, 2026 13:15
d141bf4 to
c79021c
Compare
ndbroadbent
added a commit
that referenced
this pull request
Dec 2, 2026
…fuses to boot without all four host URLs; the host check judges a normalised path (percent-decoded, repeated slashes collapsed, lowercased), so /%61pi/v1, //api/v1 and /API/v1 can't reach the API through the app host; tests
ndbroadbent
added a commit
that referenced
this pull request
Dec 2, 2026
…fuses to boot without all four host URLs; the host check judges a normalised path (percent-decoded, repeated slashes collapsed, lowercased), so /%61pi/v1, //api/v1 and /API/v1 can't reach the API through the app host; tests
ndbroadbent
added a commit
that referenced
this pull request
Dec 2, 2026
…fuses to boot without all four host URLs; the host check judges a normalised path (percent-decoded, repeated slashes collapsed, lowercased), so /%61pi/v1, //api/v1 and /API/v1 can't reach the API through the app host; tests
ndbroadbent
added a commit
that referenced
this pull request
Dec 2, 2026
…fuses to boot without all four host URLs; the host check judges a normalised path (percent-decoded, repeated slashes collapsed, lowercased), so /%61pi/v1, //api/v1 and /API/v1 can't reach the API through the app host; tests
ndbroadbent
added a commit
that referenced
this pull request
Dec 2, 2026
* Routing by hostname, hardened (sc-8900, review of #53): production refuses to boot without all four host URLs; the host check judges a normalised path (percent-decoded, repeated slashes collapsed, lowercased), so /%61pi/v1, //api/v1 and /API/v1 can't reach the API through the app host; tests * Routing by hostname, review fixes: production boots only when all four host URLs name a host and no two are the same (a bare app.visualci.com fails); in production a request for any other host reaches only /up and the renderers' /internal paths; Laravel's TrustHosts trusts every host, since it would refuse the API and MCP hosts and the pods' probes and route_by_host is the host check; tested in production for an unknown host and a boot that fails * Routing by hostname: test that a forged Host gets no URL with its name in production (sign-in's callback, OAuth metadata, the device code and redirects are unreachable from it; every other URL comes from the configured host URLs) * Routing by hostname: production boots with none of the four host URLs (one host serves everything, as a self-hosted VisualCI does, every URL from APP_URL) or all four, each naming a host and no two the same; only some of them is a boot error; tested in production for one host, the partial case, and four * Routing by hostname on main: production-mode tests get storage and OAuth settings; one Cargo.toml tracing entry; the OAuth discovery test expects the tests' APP_URL (https://app.visualci.test, since #59)
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.
Ported from today's server/src/hosts.rs, as global middleware (stacked on #52).
VISUALCI_SITE_URL,VISUALCI_APP_URL,VISUALCI_API_URLandVISUALCI_MCP_URLset, each host serves only its own paths:/api/ui;/api/v1, the webhooks and/status;/mcpand the OAuth endpoints its clients call./upanswers on every host./sends a visitor without a session cookie (SESSION_COOKIE, defaultvisualci_session) to the landing page.Tests: today's unit test of which host serves which path, plus an integration test through the middleware with the hosts configured.