openclaw/src/gateway
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
..
protocol feat: cron ISO at + delete-after-run 2026-01-13 04:55:48 +00:00
server-methods Cron: accept jobId in gateway cron params 2026-01-12 21:35:43 -06:00
auth.test.ts Fix tailscale allowTailscale bypass in token mode 2026-01-13 04:34:28 +00:00
auth.ts Fix tailscale allowTailscale bypass in token mode 2026-01-13 04:34:28 +00:00
call.test.ts feat: add Tailscale binary detection, IP binding modes, and health probe password fix 2026-01-13 05:20:02 +00:00
call.ts feat: add Tailscale binary detection, IP binding modes, and health probe password fix 2026-01-13 05:20:02 +00:00
chat-abort.ts fix(gateway): harden chat abort semantics 2026-01-10 17:23:27 +01:00
chat-attachments.test.ts test: add image attachment regression coverage 2026-01-10 20:25:38 +01:00
chat-attachments.ts fix: sniff chat attachment mime (#670) (thanks @cristip73) 2026-01-10 20:06:33 +01:00
client.maxpayload.test.ts Gateway: enable canvas host + inject action bridge 2025-12-18 23:32:22 +01:00
client.test.ts refactor: lint cleanups and helpers 2025-12-23 00:28:55 +00:00
client.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
config-reload.test.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
config-reload.ts feat: add plugin architecture 2026-01-11 12:11:12 +00:00
control-ui.ts fix: drop explicit ui:install step 2026-01-09 07:02:42 +00:00
gateway-cli-backend.live.test.ts fix(cli): keep build/lint green 2026-01-11 02:44:24 +01:00
gateway-models.profiles.live.test.ts fix: apply lint fixes 2026-01-13 03:36:53 +00:00
gateway.tool-calling.mock-openai.test.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
gateway.wizard.e2e.test.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
hooks-mapping.test.ts feat: allow hook model overrides 2026-01-08 09:33:42 +00:00
hooks-mapping.ts refactor: share hook provider types 2026-01-09 17:45:42 +01:00
hooks.test.ts refactor: normalize hook agent providers 2026-01-09 17:40:36 +01:00
hooks.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
live-image-probe.ts feat(gateway): add agent image attachments + live probe 2026-01-10 20:44:23 +00:00
net.ts feat: add Tailscale binary detection, IP binding modes, and health probe password fix 2026-01-13 05:20:02 +00:00
openai-http.e2e.test.ts Gateway: disable OpenAI HTTP chat completions by default (#686) 2026-01-10 21:55:54 +00:00
openai-http.ts style(gateway): format openai-http 2026-01-10 22:11:15 +01:00
probe.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
server-bridge-subscriptions.test.ts test(gateway): cover helper registries 2026-01-03 19:37:09 +01:00
server-bridge-subscriptions.ts refactor(gateway): split server helpers 2026-01-03 19:37:09 +01:00
server-bridge.ts refactor(gateway): use canonical session store keys 2026-01-12 02:06:43 +00:00
server-browser.ts chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
server-chat-registry.test.ts test(gateway): cover helper registries 2026-01-03 19:37:09 +01:00
server-chat.ts fix(gateway): harden chat abort semantics 2026-01-10 17:23:27 +01:00
server-constants.ts refactor: split gateway server methods 2026-01-03 18:14:07 +01:00
server-discovery.ts refactor: simplify cli commands 2026-01-08 07:16:12 +01:00
server-http.ts feat(gateway): add config toggle for chat completions endpoint 2026-01-10 22:39:06 +01:00
server-methods.ts feat: add plugin architecture 2026-01-11 12:11:12 +00:00
server-providers.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
server-shared.ts refactor(gateway): split server helpers 2026-01-03 19:37:09 +01:00
server-utils.test.ts refactor: split gateway server methods 2026-01-03 18:14:07 +01:00
server-utils.ts fix(gateway): format status/code errors 2026-01-03 19:37:09 +01:00
server.agent.test.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
server.agents.test.ts test: update heartbeat and agent list thresholds 2026-01-12 17:14:04 +00:00
server.auth.test.ts fix(sandbox): avoid sandboxing main DM sessions 2026-01-12 01:24:44 +00:00
server.chat.test.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
server.config-apply.test.ts feat: add gateway config/update restart flow 2026-01-08 01:30:02 +01:00
server.cron.test.ts Cron: persist enabled=false patches 2026-01-12 22:16:17 -06:00
server.health.test.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
server.hooks.test.ts refactor: centralize main session key resolution 2026-01-09 22:13:20 +01:00
server.misc.test.ts style: fix linting order and formatting 2026-01-05 02:33:59 +01:00
server.models-voicewake.test.ts fix: voicewake respects state dir override (#666) (thanks @roshanasingh4) 2026-01-10 18:32:09 +01:00
server.node-bridge.test.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
server.providers.test.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
server.reload.test.ts Move provider to a plugin-architecture (#661) 2026-01-11 11:45:25 +00:00
server.sessions-send.test.ts fix: keep build green after main rebase (#570) (thanks @azade-c) 2026-01-09 15:40:36 +01:00
server.sessions.test.ts test(gateway): cover main alias resolve 2026-01-12 02:06:43 +00:00
server.ts feat: add Tailscale binary detection, IP binding modes, and health probe password fix 2026-01-13 05:20:02 +00:00
server.update-run.test.ts feat: add gateway config/update restart flow 2026-01-08 01:30:02 +01:00
session-utils.test.ts fix(sandbox): canonicalize agent main alias 2026-01-12 02:23:02 +00:00
session-utils.ts fix: keep main agent in list output 2026-01-12 17:24:03 +00:00
sessions-patch.test.ts test: add elevated mode regressions 2026-01-10 05:31:48 +01:00
sessions-patch.ts fix: persist elevated off override 2026-01-10 05:23:46 +01:00
sessions-resolve.ts refactor(sessions): dedupe sessions.resolve 2026-01-09 17:13:38 +01:00
test-helpers.ts fix(logging): honor silent console level 2026-01-12 18:46:40 +00:00
ws-log.test.ts refactor: split gateway server helpers and tests 2026-01-03 17:34:52 +01:00
ws-log.ts fix: serialize claude cli runs 2026-01-09 04:58:21 +00:00
ws-logging.ts Gateway: optimize ws logs in normal mode 2025-12-18 13:27:52 +00:00