Repository navigation
fix(gateway): preserve managed Tailscale ingress compatibility - #126519
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 10:33 AM ET / 14:33 UTC. ClawSweeper reviewWhat this changesThe PR accepts authenticated tailnet traffic through a managed Tailscale Funnel listener and stops the foreground Tailscale route child when its owner worker receives a terminal signal. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open for explicit Gateway-owner review. The branch repairs behavior that current main still rejects, preserves password authentication, and includes substantial real-environment evidence; its protected maintainer label and security-sensitive upstream attribution contract require human acceptance before merge. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherManaged Tailscale Serve/Funnel forwards traffic into a dedicated loopback Gateway listener, where ingress attribution determines authentication behavior. A route-owner worker keeps the foreground Tailscale route alive and must release it when Gateway exits. flowchart LR
A[Tailnet or public request] --> B[Dedicated managed Funnel listener]
B --> C[Ingress attribution]
C --> D[Gateway password authentication]
D --> E[Gateway HTTP and WebSocket routes]
F[Gateway terminal signal] --> G[Route owner worker]
G --> H[Foreground Tailscale route stopped]
Decision needed
Why: That upstream transport distinction expands accepted input on a public-facing listener, although the code retains the dedicated-listener boundary and password gate. Before merge
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +88, Docs +6. Total +99 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the dedicated-listener attribution repair only after a Gateway owner confirms the cited Tailscale public-versus-tailnet request contract and keeps password authentication mandatory for both paths. Do we have a high-confidence way to reproduce the issue? Yes—current main's managed-Funnel branch rejects an absent marker at src/gateway/ingress-attribution.ts:165, and the PR supplies focused pre/post and cross-platform runtime evidence; local execution was not performed in the read-only checkout. Is this the best way to solve the issue? Yes, subject to Gateway-owner confirmation of the cited Tailscale contract: the patch changes attribution at the dedicated listener owner and leaves password authentication outside the Serve-only header-auth bypass. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 267ffc4754a0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
ClawSweeper follow-up for the reviewed head
The dedicated managed-listener boundary and mandatory password authentication remain unchanged. |
|
Exact-head validation update for
The live cross-platform runtime proof used The candidate remains intentionally anchored to base |
…law#126519) * fix(gateway): accept tailnet peers on managed Funnel * fix(gateway): release Tailscale claim on interrupt * test(gateway): cover Funnel tailnet ingress * docs: remove Tailscale changelog entry
What Problem This Solves
Fixes two upgrade-sensitive managed Tailscale regressions found during cross-platform release testing:
Why This Change Was Made
Tailscale distinguishes public Funnel ingress from tailnet access to the same Funnel hostname: public requests carry
Tailscale-Funnel-Request: ?1, while authenticated tailnet requests use the Serve identity-header path without that marker. Managed Funnel now accepts both of those upstream-defined forms while continuing to require password authentication for both. Missing-marker acceptance remains scoped to the dedicated managed Funnel listener; malformed markers and unattributable ordinary-listener proxy traffic still fail closed.The route-owner worker now drains its detached Tailscale child when the worker itself receives a terminal signal. This preserves the existing single route owner and cleanup flow instead of adding a parallel recovery path.
Upstream contract checked directly: Tailscale Serve/Funnel request handling and tailnet identity-header coverage.
Production LOC:
+6/-1(net+5) | Tests:+98/-17| Docs/changelog:+8/-1The five added production lines are the terminal-signal handoff at the route-lifecycle owner. The Funnel attribution repair is net neutral.
User Impact
Operators can use the same managed Funnel URL from both the public internet and their tailnet after upgrading, with the configured password required in both cases. Interactive Gateway shutdown no longer leaves the managed Tailscale port claimed.
Evidence
Frozen base:
6eb9344e7df680e668152c39054bab450437107dExact tested head:
e8d12aa0a2a4bbcac795dcbbeb0cf722ca571c96403 proxy_attribution_requiredto an authenticated tailnet peer on a managed Funnel hostname; the latest stable comparison accepted the same flow.122Gateway attribution/auth tests and4route-owner worker tests pass.{ code: null, signal: "SIGINT" }, then passes on this head and verifies that the child PID is gone.82b6a99d60a23733a8da58e86b637659d67b6cc7f7b8fdab9c775c2f5ee3700f.401; password-authenticated canonical HTTP route reached (404for a deliberately nonexistent profile); password-authenticated WebSocket health returnedok: true.401; password-authenticated canonical HTTP route reached (404); password-authenticated WebSocket health returnedok: true. macOS and Windows-backed Funnel nodes were both exercised.gateway.auth.allowTailscale=true.{}route state and no route-owner/Funnel process.The Windows public DNS record had not propagated during the proof window, so public-edge requests were pinned to both active Funnel edge IPs inside the disposable Linux test guest. TLS, HTTP authentication, routing, and WebSocket health all succeeded; the temporary guest-only host mapping was restored immediately afterward.