fix(gateway): update Tailscale configuration and change bind address to loopback - #1855
Conversation
|
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR updates OpenClaw gateway configuration in both template and tpl files by switching network binding from ChangesOpenClaw Gateway Configuration
Possibly Related PRs
Poem
🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the gateway configuration templates to bind to the loopback interface, configures Tailscale integration in "serve" mode, and removes the port number from the Tailnet origin URL. The reviewer raised valid points regarding security and maintainability: first, setting resetOnExit to false may leave dangling endpoints, so changing it to true is recommended; second, hardcoding a specific Tailnet domain reduces reusability, and a template placeholder should be used instead; finally, openclaw.tpl.json appears to be a duplicate of openclaw.template.json and should be removed if unused.
| "bind": "loopback", | ||
| "tailscale": { | ||
| "mode": "serve", | ||
| "resetOnExit": false |
There was a problem hiding this comment.
Setting resetOnExit to false means that the Tailscale serve/funnel configuration will persist even after the OpenClaw gateway process exits. This can leave dangling public/Tailnet endpoints pointing to an inactive port, which is an operational and potential security risk if another local process binds to that port later. Consider setting resetOnExit to true to ensure clean teardown on exit.
| "resetOnExit": false | |
| "resetOnExit": true |
| "http://127.0.0.1:18789", | ||
| "https://openclaw.shunkakinoki.com", | ||
| "https://kyber.tail950b36.ts.net:18789" | ||
| "https://kyber.tail950b36.ts.net" |
There was a problem hiding this comment.
Hardcoding a specific Tailnet domain (kyber.tail950b36.ts.net) in the template file reduces the reusability of this configuration across different environments or hosts. Consider using a template placeholder (e.g., __TAILSCALE_DOMAIN__) and replacing it dynamically during the hydration process, similar to how other secrets and variables are handled.
| "https://kyber.tail950b36.ts.net" | |
| "https://__TAILSCALE_DOMAIN__" |
There was a problem hiding this comment.
Worth flagging that kyber.tail950b36.ts.net is hardcoded in several other places in this repo, so templating it only here would be an incomplete fix:
config/openclaw/hydrate.sh:111— clientwss://kyber.tail950b36.ts.nethome-manager/programs/ssh/default.nix:40— SSHhostnameconfig/k3s/activate.sh:63—TAILSCALE_DNSconfig/k3s/config.yaml:5— k3s TLS SANspec/openclaw_hydrate_spec.sh:174andspec/ssh_config_spec.sh:10— tests asserting the literal host
If you want to make this generic, the domain probably belongs in inputs.host (alongside isKyber) and should be threaded through all of the above, not just this one allow-list entry.
| "gateway": { | ||
| "mode": "local", | ||
| "bind": "lan", | ||
| "bind": "loopback", | ||
| "tailscale": { | ||
| "mode": "serve", | ||
| "resetOnExit": false | ||
| }, | ||
| "controlUi": { | ||
| "allowedOrigins": [ | ||
| "http://localhost:18789", | ||
| "http://127.0.0.1:18789", | ||
| "https://openclaw.shunkakinoki.com", | ||
| "https://kyber.tail950b36.ts.net:18789" | ||
| "https://kyber.tail950b36.ts.net" | ||
| ] | ||
| }, | ||
| "auth": { |
There was a problem hiding this comment.
This file (openclaw.tpl.json) appears to be a duplicate of openclaw.template.json. However, config/openclaw/default.nix only references openclaw.template.json. Keeping duplicate template files increases maintenance overhead and the risk of configuration drift. If openclaw.tpl.json is indeed redundant and unused, consider deleting it.
There was a problem hiding this comment.
openclaw.tpl.json is not a duplicate — it's the source-of-truth template and is referenced by scripts/llm-update.sh:
config/openclaw/openclaw.tpl.json -> config/openclaw/openclaw.template.json
openclaw.tpl.json carries placeholders like __CLAUDE_OPUS__ / __CLAUDE_OPUS_PRETTY__ for model IDs/names, and llm-update.sh renders those into the concrete model versions (claude-opus-4-7, Claude Opus 4.7, …) in openclaw.template.json, which is what config/openclaw/default.nix then consumes at activation time. A diff between the two files confirms the only differences are exactly those model-ID placeholders. Deleting openclaw.tpl.json would break the llm-update.sh rendering pipeline.
| "http://127.0.0.1:18789", | ||
| "https://openclaw.shunkakinoki.com", | ||
| "https://kyber.tail950b36.ts.net:18789" | ||
| "https://kyber.tail950b36.ts.net" |
There was a problem hiding this comment.
Origin allow-list intent is undocumented: After this PR the list spans three transports — direct loopback (http://localhost:18789, http://127.0.0.1:18789), the public site (https://openclaw.shunkakinoki.com), and the new Tailscale Serve URL (https://kyber.tail950b36.ts.net on 443). Since JSON can't carry comments, consider documenting in config/openclaw/README (or a sibling doc) that the loopback entries exist for local browser access on Kyber while the tailnet entry depends on gateway.tailscale.mode = "serve" and bind = "loopback". Otherwise, if the gateway is ever rebound back to LAN the meaning of the :18789 entries becomes ambiguous.
Summary by cubic
Tightened gateway exposure and aligned Tailscale access. Gateway now binds to loopback, uses Tailscale serve mode, and allowed origins match the Tailscale HTTPS endpoint.
gateway.tailscaleconfig:mode: "serve",resetOnExit: falsefor stable Tailscale serving.https://kyber.tail950b36.ts.net:18789tohttps://kyber.tail950b36.ts.netto match Tailscale HTTPS.Written for commit ed126e5. Summary will update on new commits. Review in cubic