Skip to content

feat: Allow custom port configuration for tailscale serve #516

Closed

Description

@babhishek21

Problem

Currently, the plugin startup flow will try to run something like tailscale serve --bg --https=? http://127.0.0.1:7317 with one of the following ports for the HTTPS port param:

https://github.com/devswha/herdr-web-ui/blob/258fc7a36c018f851584d5e8ddd29791a6a08a71/server/tailscale.ts#L13-L14

By default, this captures port 443, which is the general HTTPS port.

I like to keep port 443 free for short-lived funnels or my own custom workflows. Since herdr (and consequently herdr-web-ui is meant to be long-lived / permanent, it will almost certainly block 443 on my machine in the tailnet in perpetuity.

Proposal

Having a TAILSCALE_SERVE_PORT config option would be great to have a dedicated https exposed port that I can reliably assign to herdr-web-ui.

If the TAILSCALE_SERVE_PORT is occupied, then the plugin can fallback to the hardcoded HTTPS_PORTS list, similar to how it's done while looking for a local port for the web-ui service itself.

https://github.com/devswha/herdr-web-ui/blob/258fc7a36c018f851584d5e8ddd29791a6a08a71/scripts/plugin-port.ts#L4-L5

Where

Other

Workarounds and alternatives

No good workarounds currently.

  1. If herdr was already running:
  • shut down herdr server. Suspends running agents 🚨 ⚠️
  • then kill web-ui bun process (doesn't terminate automatically ?!)
  • reset tailscale serve config via tailscale serve reset 🚨 ⚠️
  • let another service do tailscale serve --https 443 and takeover port :443
  • restart herdr 🫠
  1. If herdr wasn't running already:
  • another service takes over :443 on my machine via tailscale serve
  • start herdr; web-ui tries to bind :443, fails and falls back to :8443
  • now my installed PWA won't load (expected :443) 😢

Activity

  1. added
    enhancement
    on Oct 6, 2026
  2. devswha commented on Oct 19, 2026

    @devswha
    Owner

    Thanks for the report. #1433 adds HERDR_WEB_TAILSCALE_HTTPS_PORT: the installer and the phone step publish the app on that HTTPS port only. If another service already holds it, they stop and say so rather than falling back to 8443, because the fallback would move the address an installed app opens, which is the case you hit.

    Two notes on the current behaviour:

    • 443 is taken only when the installer (or bun scripts/plugin.ts phone) runs. The server and herdr startup only read tailscale serve status.
    • Moving an existing address needs no herdr restart or serve reset: run tailscale serve --https=443 off, then tailscale serve --bg --https=9443 http://127.0.0.1:7317. The app picks up the new address. The phone app has to be installed again from it, since its origin changes.
  3. added a commit that references this issue on Oct 20, 2026
    e046675
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions