Skip to content

fix(gateway): detect tailscale in desktop installs - #1248

Merged
nixuuu merged 4 commits into
devfrom
fix/tailscale-detection
Nov 24, 2026
Merged

nixuuu merged 4 commits into
devfrom
fix/tailscale-detection

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Changes

  • On macOS, set TAILSCALE_BE_CLI=1 only for the child process so the app bundle responds to scripted calls in CLI mode. The gateway can call the bundled CLI without an installed launcher. Tailscale CLI documentation
  • On Windows gateways, find tailscale.exe in its standard Program Files install when it is missing from the gateway’s PATH. Tailscale MSI documentation
  • Ignore directories that look like executables and report a failed CLI launch as “Not running.”

Thanks to @marcinniewinski for reporting the detection failure on a macOS gateway without a separate CLI launcher. Connect to Gateway on Windows reads the macOS host’s status. The Windows installation lookup addresses a separate case for gateways running on Windows.

Fixes: #219

Verification

  • Linux local, bec02d84e: 48 tests passed via check:tmp across desktop CLI detection, the paired Remote client, Tailscale status, network access, HTTPS and the mobile route hint. The opt-in macOS live test was skipped. The two detection regressions failed before the fix. Gateway typecheck, lint and formatting checks for the edited files passed.
  • CI passed on bec02d84e. The native detection fixtures passed on Apple Silicon macOS, Intel macOS and Windows x64. On Windows, the paired Remote client read Tailscale status from a gateway fixture over the production pinned TLS transport. CI results
  • The earlier ARM64 attempt with a freshly extracted standalone Tailscale 1.104.7 bundle timed out without output. The opt-in test exercises the gateway status probe on a Mac with Tailscale already connected. The live test and the reporter’s installation still need verification.

@nixuuu
nixuuu merged commit 6795c1f into dev Nov 24, 2026
22 checks passed
@nixuuu
nixuuu deleted the fix/tailscale-detection branch November 24, 2026 19:51
nixuuu added a commit that referenced this pull request Nov 27, 2026
…1339)

## Changes

runCli settled only from execFile's callback, and its timeout only sent
SIGTERM. A child that ignores SIGTERM, cannot be reaped yet (macOS holds
a just-written executable in exec during its first-launch assessment),
or has a descendant holding its output kept the promise pending. The
Tailscale reading is single flight, so one such call stalled every later
refresh. The macOS native check hit this: it hung past its 15 s budget
although runCli had a 10 s deadline.

runCli now owns the deadline: it sends SIGKILL and resolves a failed
result whether or not the exit is reported.

The macOS test now links the bundle CLI path to the system shell and
keeps its checks in a plain script that shell reads, so it still checks
the bundle location, forced CLI mode, the fixed arguments and the empty
PATH without launching a new file. A new test shows that a CLI ignoring
SIGTERM, with a child holding its output, now fails at the deadline
instead of hanging.

Related: #1248
Related: #1292

## Verification

- `tests/integration/tailscale-desktop-detection.test.ts` repeated on
Linux; the new SIGTERM-ignoring CLI test times out with the old `runCli`
and passes with the fix.
- Not run on macOS locally: the macOS native check in CI covers it.
- Gateway typecheck, oxlint and oxfmt on edited files. Copy audit: no UI
text changed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
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