Repository navigation
fix: point HTTPS and Funnel serves at the target's SSL leg (1.104.4:0 → 1.104.4:1) - #24
Merged
Merged
Conversation
… → 1.104.4:1) Tailscale's serve proxy sets `X-Forwarded-Proto: https`, but the route forwarded to the target's plaintext bridge port whenever the interface had one. StartOS's proxy on that leg strips every incoming `X-Forwarded-*` header and adds no proto, so Nextcloud saw http and built `http://` redirects and CalDAV/CardDAV discovery URLs, which the HTTPS serve rejects with 400. `targetSchemeFor` now prefers the SSL bridge leg (`https+insecure`) for TLS serve modes; StartOS sets `X-Forwarded-Proto: https` there. HTTP routes keep the plaintext leg. Closes #23 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
helix-white
approved these changes
Nov 6, 2026
helix-white
left a comment
Member
There was a problem hiding this comment.
Reviewed the routing change and its callers: HTTPS/Funnel prefer the SSL bridge leg, HTTP retains plaintext preference, single-leg fallbacks and TCP behavior remain unchanged, and action eligibility is unaffected. This matches StartOS's documented forwarded-header policy. No correctness regressions found; the head merges cleanly into master and all three reported CI checks passed.
Code review only; end-to-end Nextcloud/tailnet behavior remains unverified as disclosed in the PR.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
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.
Closes #23.
Tailscale's serve proxy already sets
X-Forwarded-Proto: httpsandX-Forwarded-Host(ipn/ipnlocal/serve.go,addProxyForwardedHeaders). The header was lost one hop later: whenever the target interface had a plaintext scheme,targetSchemeForpointed the route's forwarder at the target's plaintext bridge port. StartOS's proxy on that leg strips every incomingX-Forwarded-*header and adds no proto (start-corenet/http.rs,apply_request_policy). Nextcloud, which reads the scheme per request, therefore sawhttpand builthttp://redirects and CalDAV/CardDAV discovery URLs, which the HTTPS serve answers with 400.httpsandfunnelroutes now prefer the target's SSL bridge leg (https+insecure) when the interface has one, where StartOS setsX-Forwarded-Proto: https.httproutes keep the plaintext leg, and an interface with only one leg is served as before. The actions' "can this be served" check is unchanged.Verified:
tsc --noEmitand Prettier pass. Not exercised on a box: no Nextcloud and tailnet test setup was at hand, so the serve change is unverified end to end. The SDK pin stays at 3.1.1 (4.0.0 is out); the major bump is left out of this fix.🤖 Generated with Claude Code