Repository navigation
feat: support reverse-proxy public URLs - #1266
Merged
Merged
Conversation
Whamp
force-pushed
the
feat/plannotator-public-url
branch
from
August 13, 2026 20:43
702a2bc to
c79ac55
Compare
Whamp
force-pushed
the
feat/plannotator-public-url
branch
from
September 17, 2026 20:42
99ee32a to
c987b56
Compare
A reverse proxy that forwards the browser's Host (Cloudflare Tunnel, Caddy) got 403 unless the user also listed the hostname in PLANNOTATOR_ALLOWED_HOSTS. Both Host guards now add the hostname of PLANNOTATOR_PUBLIC_URL to the remote-mode names, with Bun and Pi scenarios, and the docs say so.
--tailscale binds loopback, so a configured publicUrl brought back the "set PLANNOTATOR_REMOTE=1" warning mid-run. Clear it there like urlHost. The remote guide now says a plain-http public URL behind a Host-rewriting proxy also needs PLANNOTATOR_ALLOWED_HOSTS.
…ode effects PLANNOTATOR_PORT=0 binds a port no proxy can target, so the port-less public origin pointed nowhere; it now falls back to the normal address with the real port. Docs say a same-machine tunnel needs PLANNOTATOR_REMOTE=1 (all interfaces, Ask this session off) and that live app annotation stays on localhost.
backnotprop
added a commit
to utpalsinghdev/plannotator
that referenced
this pull request
Oct 28, 2026
Resolve conflicts with backnotprop#1266 (reverse-proxy public URLs). The localhost rule moves into the shared resolveAdvertisedSessionUrl so both runtimes keep parity: a remote session advertises the public URL on the port it fronts and ignores a *.localhost urlHost; a local session ignores the public URL and honors plannotator.localhost. Co-Authored-By: Claude <[email protected]>
1 task
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 this exists
I typically use Plannotator from Pi inside Herdr, with Herdr exposed through a Cloudflare Tunnel and Access. Some machines I work from cannot join my tailnet, so the browser-facing and local addresses differ:
PLANNOTATOR_URL_HOSTcannot represent this setup. It accepts only a hostname and appends Plannotator's runtime port, producinghttp://plannotator.example.com:19432. Cloudflare instead terminates HTTPS on port 443 and forwards requests internally to port 19432.This PR adds a separate public URL setting:
Plannotator still listens on the local runtime address and uses loopback URLs for same-machine agent communication. It uses the public URL only when advertising or opening the review session.
A port range also supports concurrent directly reachable sessions while one reverse-proxy origin remains mapped to the first port:
The session on
19432advertises the public origin. Sessions on later ports advertisehttp://my-machine.tailnet.ts.net:<port>. Concurrent public sessions still require a session-aware proxy.The same public/local distinction applies to nginx, Caddy, Kubernetes ingress, SSH gateways, and other reverse proxies.
Summary
PLANNOTATOR_PUBLIC_URLandpublicUrlfor remote sessions behind a reverse proxyPLANNOTATOR_URL_HOST:<port>Validation
oxlintandoxfmt: clean for the new shared moduleaislop: 0 errorsslop-scan delta: 234 → 234 findings, 0 added or worsened occurrences