Skip to content

feat: reach portmap and its services over Tailscale - #6

Merged
RakshithBhat03 merged 1 commit into
mainfrom
feat/tailscale-support
Oct 5, 2026
Merged

RakshithBhat03 merged 1 commit into
mainfrom
feat/tailscale-support

Conversation

@RakshithBhat03

Copy link
Copy Markdown
Owner

What

portmap stays bound to 127.0.0.1. When the tailscale CLI is available (override with PORTMAP_TAILSCALE, or off to disable), it now:

  • reads this machine's tailnet name and tailscale serve mappings, and accepts names under the tailnet's MagicDNS suffix as a Host
  • gives every web service a link other tailnet devices can open: services listening on all interfaces link straight to the tailnet name; loopback-only ones get a share on tailnet button that creates/removes a tailnet-only tailscale serve mapping (never Funnel)
  • only lets this machine or the node's owner toggle sharing; mappings the user created themselves are linked but never removed

Also adds PORTMAP_ALLOWED_HOSTS for extra Host names and compose.tailscale.yaml for running a Tailscale sidecar with its own hostname. README documents all of it, including the security implications.

Why

Cards linked to localhost:<port>, which doesn't work when portmap is opened from a phone or another machine on the tailnet.

Verification

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test all pass locally (84 tests, including new tailnet and share/unshare tests).
  • Not tested against a live tailnet in this PR; the Tailscale CLI is stubbed in tests. The assets/ UI change (share button) was not covered by tests and no screenshot is attached.

portmap stays bound to loopback. When the tailscale CLI is available it
reads this machine's tailnet name and `tailscale serve` mappings, accepts
names under the tailnet's MagicDNS suffix as a Host, and gives every web
service a link other tailnet devices can open:

- services listening on all interfaces link straight to the tailnet name
- loopback-only services get a "share on tailnet" button that creates or
  removes a tailnet-only `tailscale serve` mapping (never Funnel); only
  the node's owner or this machine can toggle it
- mappings the user created themselves are linked but never removed

Also adds PORTMAP_ALLOWED_HOSTS for extra Host names, PORTMAP_TAILSCALE
to point at or disable the CLI, and compose.tailscale.yaml for running a
Tailscale sidecar with its own hostname. Documented in the README.
@RakshithBhat03
RakshithBhat03 merged commit 82d93d2 into main Oct 5, 2026
1 check passed
@RakshithBhat03
RakshithBhat03 deleted the feat/tailscale-support branch October 5, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant