Skip to content

fix: openclaw gateway bind lan and correct controlUi origin - #1356

Merged
shunkakinoki merged 1 commit into
mainfrom
fix/openclaw-gateway-bind-lan
Apr 5, 2026
Merged

fix: openclaw gateway bind lan and correct controlUi origin#1356
shunkakinoki merged 1 commit into
mainfrom
fix/openclaw-gateway-bind-lan

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Apr 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Change gateway bind from loopback to lan to allow LAN/Tailscale access (was causing startup failures when config drifted)
  • Remove unused tailscale.mode: serve config (not used by current OpenClaw version)
  • Add :18789 port to Tailscale controlUi origin to match actual gateway port

Context

The live openclaw.json on kyber drifted from the declarative template — gateway mode was overwritten to remote (client mode), causing crash loops. The template already had the correct model config (minimax-m2.7), but gateway.bind was set to loopback instead of lan, which doesn't match the working production config.

Test plan

  • Hydrated config from updated template on kyber
  • openclaw-gateway.service starts and stays running
  • Gateway accessible on LAN/Tailscale

🤖 Generated with Claude Code


Summary by cubic

Switch the OpenClaw gateway to bind on LAN and fix the controlUi origin port to match :18789, preventing crash loops and enabling LAN/Tailscale access.

  • Bug Fixes
    • Set gateway.bind from loopback to lan for LAN/Tailscale reachability.
    • Removed unused Tailscale mode: serve config.
    • Added :18789 to kyber.tail950b36.ts.net in controlUi.allowedOrigins to match the gateway port.

Written for commit 66c6720. Summary will update on new commits.

Copilot AI review requested due to automatic review settings April 5, 2026 05:09
@mesa-dot-dev

mesa-dot-dev Bot commented Apr 5, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@coderabbitai

coderabbitai Bot commented Apr 5, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 691a1ce3-8820-4d61-b6c4-4bfd16639d82

📥 Commits

Reviewing files that changed from the base of the PR and between 58f5672 and 66c6720.

📒 Files selected for processing (2)
  • config/openclaw/openclaw.template.json
  • config/openclaw/openclaw.tpl.json

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated gateway network binding configuration
    • Removed Tailscale configuration block
    • Modified control UI allowed origins with port specification

Walkthrough

Configuration updates to the OpenClaw gateway: network binding changes from loopback to LAN, Tailscale configuration block is removed, and the allowed origin is updated with port 18789.

Changes

Cohort / File(s) Summary
Gateway Configuration
config/openclaw/openclaw.template.json, config/openclaw/openclaw.tpl.json
Changed gateway.bind from "loopback" to "lan", removed gateway.tailscale configuration block, and updated gateway.controlUi.allowedOrigins from https://kyber.tail950b36.ts.net to https://kyber.tail950b36.ts.net:18789.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

bug

Poem

🐰 The gateway hops from loopback's quiet burrow,
To LAN's bustling warren wide and bright,
Port 18789 marks the way tomorrow,
Tailscale recedes as we adjust our sight! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: binding the gateway to LAN and correcting the controlUi origin, which directly matches the file changes in both configuration files.
Description check ✅ Passed The description is well-related to the changeset, providing clear context about the changes, the problem being fixed (config drift causing crashes), and a detailed test plan that validates the solution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/openclaw-gateway-bind-lan

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mesa-dot-dev

mesa-dot-dev Bot commented Apr 5, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Fixed OpenClaw gateway binding from loopback to lan for LAN/Tailscale access and corrected the controlUi origin port.

What changed?

  • Changed gateway bind from loopback to lan to enable LAN/Tailscale access, resolving startup failures.
  • Removed unused tailscale.mode: serve configuration.
  • Added :18789 port to the Tailscale controlUi origin to match the actual gateway port.

Description generated by Mesa. Update settings

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the OpenClaw gateway configuration templates to match the known-working production setup for LAN/Tailscale access and corrects the Control UI CORS origin for the Tailscale hostname.

Changes:

  • Switch gateway.bind from loopback to lan to allow non-local access.
  • Remove unused gateway.tailscale.mode: serve configuration.
  • Update controlUi.allowedOrigins to include the Tailscale hostname with the correct :18789 port.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
config/openclaw/openclaw.tpl.json Updates the source OpenClaw config template for LAN binding and Control UI allowed origins; removes unused tailscale block.
config/openclaw/openclaw.template.json Updates the generated OpenClaw config output to reflect the same gateway binding and Control UI origin changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the gateway configuration in openclaw.template.json and openclaw.tpl.json by changing the bind mode to lan, removing the Tailscale serve configuration, and updating the allowed origins. The review feedback identifies a potential protocol mismatch where https is used with port 18789, suggesting a switch to http to avoid connection failures and noting inconsistencies with other client configurations.

"http://127.0.0.1:18789",
"https://openclaw.shunkakinoki.com",
"https://kyber.tail950b36.ts.net"
"https://kyber.tail950b36.ts.net:18789"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The Tailscale origin uses https with port 18789. If the gateway is serving plain HTTP (as suggested by the localhost entries and the openclaw gateway command in hydrate.sh), this protocol should likely be http. Using https on an HTTP port will cause connection failures in the browser.

Additionally, there is an inconsistency with the client configuration in hydrate.sh (line 105) and its test in spec/openclaw_hydrate_spec.sh (line 169), which both expect the gateway to be accessible via wss:// on the default port (443). If the gateway is now accessed via port 18789 and the Tailscale proxy is removed, the client configuration should also be updated to include the port.

Suggested change
"https://kyber.tail950b36.ts.net:18789"
"http://kyber.tail950b36.ts.net:18789"

"http://127.0.0.1:18789",
"https://openclaw.shunkakinoki.com",
"https://kyber.tail950b36.ts.net"
"https://kyber.tail950b36.ts.net:18789"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The Tailscale origin uses https with port 18789. If the gateway is serving plain HTTP (as suggested by the localhost entries and the openclaw gateway command in hydrate.sh), this protocol should likely be http. Using https on an HTTP port will cause connection failures in the browser.

Additionally, there is an inconsistency with the client configuration in hydrate.sh (line 105) and its test in spec/openclaw_hydrate_spec.sh (line 169), which both expect the gateway to be accessible via wss:// on the default port (443). If the gateway is now accessed via port 18789 and the Tailscale proxy is removed, the client configuration should also be updated to include the port.

Suggested change
"https://kyber.tail950b36.ts.net:18789"
"http://kyber.tail950b36.ts.net:18789"

@shunkakinoki
shunkakinoki merged commit 04654b1 into main Apr 5, 2026
40 of 42 checks passed
@shunkakinoki
shunkakinoki deleted the fix/openclaw-gateway-bind-lan branch April 5, 2026 06:23
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.

2 participants