Commit Graph

11 Commits

Author SHA1 Message Date
Peter Steinberger
624ff09314 test: expand gateway auth probe coverage 2026-01-16 19:16:03 +00:00
Peter Steinberger
c379191f80 chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
2026-01-14 15:02:19 +00:00
Jefferson Warrior
c851bdd47a feat: add Tailscale binary detection, IP binding modes, and health probe password fix
This PR includes three main improvements:

1. Tailscale Binary Detection with Fallback Strategies
   - Added findTailscaleBinary() with multi-strategy detection:
     * PATH lookup via 'which' command
     * Known macOS app path (/Applications/Tailscale.app/Contents/MacOS/Tailscale)
     * find /Applications for Tailscale.app
     * locate database lookup
   - Added getTailscaleBinary() with caching
   - Updated all Tailscale operations to use detected binary
   - Added TUI warning when Tailscale binary not found for serve/funnel modes

2. Custom Gateway IP Binding with Fallback
   - New bind mode "custom" allowing user-specified IP with fallback to 0.0.0.0
   - Removed "tailnet" mode (folded into "auto")
   - All modes now support graceful fallback: custom (if fail → 0.0.0.0), loopback (127.0.0.1 → 0.0.0.0), auto (tailnet → 0.0.0.0), lan (0.0.0.0)
   - Added customBindHost config option for custom bind mode
   - Added canBindTo() helper to test IP availability before binding
   - Updated configure and onboarding wizards with new bind mode options

3. Health Probe Password Auth Fix
   - Gateway probe now tries both new and old passwords
   - Fixes issue where password change fails health check if gateway hasn't restarted yet
   - Uses nextConfig password first, falls back to baseConfig password if needed

Files changed:
- src/infra/tailscale.ts: Binary detection + caching
- src/gateway/net.ts: IP binding with fallback logic
- src/config/types.ts: BridgeBindMode type + customBindHost field
- src/commands/configure.ts: Health probe dual-password try + Tailscale detection warning + bind mode UI
- src/wizard/onboarding.ts: Tailscale detection warning + bind mode UI
- src/gateway/server.ts: Use new resolveGatewayBindHost
- src/gateway/call.ts: Updated preferTailnet logic (removed "tailnet" mode)
- src/commands/onboard-types.ts: Updated GatewayBind type
- src/commands/onboard-helpers.ts: resolveControlUiLinks updated
- src/cli/*.ts: Updated bind mode casts
- src/gateway/call.test.ts: Removed "tailnet" mode test
2026-01-13 05:20:02 +00:00
Peter Steinberger
1eb50ffac4 feat(status): improve status output 2026-01-10 23:32:07 +01:00
Peter Steinberger
7f0f82e869 ci: enforce lf line endings 2026-01-08 02:29:20 +00:00
Peter Steinberger
440a5b82cf fix(gateway): honor local auth password for CLI (PR #301, thanks @jeffersonwarrior) 2026-01-08 02:59:06 +01:00
Peter Steinberger
2f707ad4ad style: format gateway call helpers 2026-01-08 01:53:28 +00:00
Peter Steinberger
6aa6c837e7 fix: add gateway connection debug output 2026-01-08 02:51:39 +01:00
Peter Steinberger
2fe3b483b1 fix: add gateway close context 2026-01-08 02:42:32 +01:00
Peter Steinberger
995f5959af fix: stage sandbox media for inbound attachments 2026-01-05 06:18:11 +01:00
Peter Steinberger
0c632f4855 fix: prefer tailnet IP for local gateway calls 2026-01-05 02:19:26 +01:00