You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: route served projects through automatic wildcard subdomains #371
Give each served Project its primary .test hostname and automatic one-label subdomain routing. An explicitly linked hostname must take precedence over another Project's wildcard.
For example, laravel.test and tenant.laravel.test reach the Laravel Project. If another Project is linked as api.laravel.test, that exact hostname reaches the API Project regardless of Caddyfile or imported-fragment order.
Behavior
Generate primary.test and *.primary.test for every served Project in the Gateway. PHP-serving FrankenPHP workers must accept the same Host values after the Gateway proxies traffic.
A wildcard matches exactly one additional label: foo.laravel.test matches, while v1.foo.laravel.test does not match *.laravel.test. A separately linked foo.laravel.test Project may own its own wildcard.
Exact linked Project hostnames win over a parent Project's wildcard. Preserve the original Host and forwarding headers.
Use PV's local CA and Caddy-managed TLS for primary and wildcard hostnames. Resource-only Projects do not gain routes or TLS demand.
Remove the explicit Project config hostnames: alias feature and its parser, routing, state, selector, help, and documentation behavior. Arbitrary aliases are outside this feature.
Acceptance criteria
Update DESIGN.md and user documentation for automatic one-label wildcard routing, exact-host precedence, TLS, and the removal of hostnames:.
Integration tests verify real Gateway and PHP-worker requests for the primary hostname, a wildcard subdomain, an exact subproject override, and a deeper hostname that the parent wildcard must not match.
Integration tests verify locally trusted primary and wildcard certificates and that configuration order does not change routing.
Remove or update obsolete hostnames: config, state, CLI selector, and snapshot coverage.
Related: #365 (workspace config). The wildcard routing change is useful for ordinary standalone Projects and does not require workspace or proxy support.
Actionable as a standalone feature. PV already resolves all .test names to loopback, and the standalone Caddy Gateway and FrankenPHP workers generate per-Project sites. The main correctness risk is that adding wildcard sites to imported fragments alone does not establish exact-host precedence or one-label matching. #365 is not a prerequisite; it will supply additional explicitly linked Project hostnames later.
Implementation plan
Define the routing contract and remove alias documentation. Update DESIGN.md and docs/user/README.md to state that each served Project gets its exact primary hostname and its automatic one-label wildcard, that a separately linked exact hostname wins, and that deeper names require an explicitly linked intermediate Project. Document PV local-CA/Caddy TLS, preserved Host and forwarding headers, no routes or TLS demand for serve: false, and that ${url} and ${tls.*} files still refer only to the primary hostname. Remove the hostnames: examples and obsolete selector/alias descriptions. Verify: documentation has no remaining current-product claims that aliases are supported.
Remove explicit alias ownership throughout config and state. Delete hostnames: parsing/serialization and its normalizer, alias validation, reconciliation, persisted additional-hostname behavior, and alias-specific CLI selectors/help/tests. Reject hostnames: as an unknown key rather than silently accepting it, including for resource-only config. Retain exact primary-hostname collision checks and the primary-hostname lookup needed by CLI selectors. Remove existing non-primary project_hostnames rows via a migration while retaining the immediately previous app version's readable schema as required by DESIGN.md; remove alias-facing APIs and stale snapshots. Verify: old alias rows no longer select or reserve a hostname, an explicitly linked api.laravel.test is allowed beside laravel.test, and normal primary collisions still fail.
Generate deterministic Gateway and worker routes. In crates/daemon/src/gateway_config.rs and the plan/reconciliation code in gateway.rs, render each served primary and *.primary at the Gateway and on its PHP worker, using Caddy-managed internal certificates from PV's CA only at the Gateway. Make exact sites win independently of fragment filename/import order and PHP worker grouping; enforce exactly one extra label rather than relying on unverified Caddy wildcard matcher behavior. Keep the existing proxy Host/X-Forwarded-* handling, last-valid config/reload contract, and resource-only filtering. Verify: rendered-config snapshots and real Caddy validation, plus no stale wildcard routes after unlink or serve: false.
Exercise the real path and run quality checks. Extend crates/daemon/tests/real_artifact_gateway_e2e.rs (the existing opt-in real Caddy/FrankenPHP fixture) with distinct PHP responses for parent and exact subproject, HTTPS requests for the primary and one-label wildcard, an exact override, and a deeper unmatched hostname. Test both fragment/order arrangements and, if applicable, a child Project's own one-label wildcard. Verify the primary and wildcard TLS identities against the seeded PV CA without --insecure, inspect the certificate names, and check the forwarded Host/proto/forwarding headers in PHP. Use HTTP or an explicit TLS-handshake assertion for the intentionally unserved deeper name, since it need not have a certificate. Add focused config/state integration coverage for alias removal and resource-only behavior, update nearby insta snapshots, then run relevant nextest suites, the opt-in macOS real-artifact test, formatting, and workspace Clippy. Verify: all acceptance scenarios pass with actual Gateway and worker processes, not only string snapshots.
No implementation or tests were run in this planning pass.
Task list (3/3 completed)
Read issue, repository guidance, and relevant architecture
Trace serving and routing paths; identify scope and decisions
Post actionable milestones and verification plan to issue
Activity
pullfrog commentedon Sep 29, 2026
Assessment
Actionable as a standalone feature. PV already resolves all
.testnames to loopback, and the standalone Caddy Gateway and FrankenPHP workers generate per-Project sites. The main correctness risk is that adding wildcard sites to imported fragments alone does not establish exact-host precedence or one-label matching. #365 is not a prerequisite; it will supply additional explicitly linked Project hostnames later.Implementation plan
DESIGN.mdanddocs/user/README.mdto state that each served Project gets its exact primary hostname and its automatic one-label wildcard, that a separately linked exact hostname wins, and that deeper names require an explicitly linked intermediate Project. Document PV local-CA/Caddy TLS, preserved Host and forwarding headers, no routes or TLS demand forserve: false, and that${url}and${tls.*}files still refer only to the primary hostname. Remove thehostnames:examples and obsolete selector/alias descriptions. Verify: documentation has no remaining current-product claims that aliases are supported.hostnames:parsing/serialization and its normalizer, alias validation, reconciliation, persisted additional-hostname behavior, and alias-specific CLI selectors/help/tests. Rejecthostnames:as an unknown key rather than silently accepting it, including for resource-only config. Retain exact primary-hostname collision checks and the primary-hostname lookup needed by CLI selectors. Remove existing non-primaryproject_hostnamesrows via a migration while retaining the immediately previous app version's readable schema as required byDESIGN.md; remove alias-facing APIs and stale snapshots. Verify: old alias rows no longer select or reserve a hostname, an explicitly linkedapi.laravel.testis allowed besidelaravel.test, and normal primary collisions still fail.crates/daemon/src/gateway_config.rsand the plan/reconciliation code ingateway.rs, render each served primary and*.primaryat the Gateway and on its PHP worker, using Caddy-managed internal certificates from PV's CA only at the Gateway. Make exact sites win independently of fragment filename/import order and PHP worker grouping; enforce exactly one extra label rather than relying on unverified Caddy wildcard matcher behavior. Keep the existing proxy Host/X-Forwarded-*handling, last-valid config/reload contract, and resource-only filtering. Verify: rendered-config snapshots and real Caddy validation, plus no stale wildcard routes after unlink orserve: false.crates/daemon/tests/real_artifact_gateway_e2e.rs(the existing opt-in real Caddy/FrankenPHP fixture) with distinct PHP responses for parent and exact subproject, HTTPS requests for the primary and one-label wildcard, an exact override, and a deeper unmatched hostname. Test both fragment/order arrangements and, if applicable, a child Project's own one-label wildcard. Verify the primary and wildcard TLS identities against the seeded PV CA without--insecure, inspect the certificate names, and check the forwarded Host/proto/forwarding headers in PHP. Use HTTP or an explicit TLS-handshake assertion for the intentionally unserved deeper name, since it need not have a certificate. Add focused config/state integration coverage for alias removal and resource-only behavior, update nearbyinstasnapshots, then run relevant nextest suites, the opt-in macOS real-artifact test, formatting, and workspace Clippy. Verify: all acceptance scenarios pass with actual Gateway and worker processes, not only string snapshots.No implementation or tests were run in this planning pass.
Task list (3/3 completed)
GPT Sol| 𝕏