feat: add tailnet and auto bind mode support

OpenClaw natively supports 'tailnet' and 'auto' bind modes but the
addon rejected them in oc_config_helper.py validation and the config.yaml
schema didn't list them as valid options.

- oc_config_helper.py: expand bind_mode validation to accept 'tailnet'
  and 'auto' in addition to 'loopback' and 'lan'
- config.yaml: add 'tailnet' and 'auto' to schema and document them
  in the options comments

Users running Tailscale as a separate HA addon (non-userspace mode)
can now set gateway_bind_mode: tailnet to restrict gateway access
exclusively to their Tailscale network — no iptables rules needed.

Closes #59
This commit is contained in:
Nathan Guenther
2026-02-20 11:44:43 -05:00
parent 13417f4439
commit adbfcfee72
2 changed files with 8 additions and 6 deletions
+4 -4
View File
@@ -63,7 +63,7 @@ def apply_gateway_settings(mode: str, bind_mode: str, port: int, enable_openai_a
Args:
mode: "local" or "remote"
bind_mode: "loopback" or "lan"
bind_mode: "loopback", "lan", "tailnet", or "auto"
port: Port number to listen on (must be 1-65535)
enable_openai_api: Enable OpenAI-compatible Chat Completions endpoint
allow_insecure_auth: Allow insecure HTTP authentication
@@ -74,8 +74,8 @@ def apply_gateway_settings(mode: str, bind_mode: str, port: int, enable_openai_a
return False
# Validate bind mode
if bind_mode not in ["loopback", "lan"]:
print(f"ERROR: Invalid bind_mode '{bind_mode}'. Must be 'loopback' or 'lan'")
if bind_mode not in ["loopback", "lan", "tailnet", "auto"]:
print(f"ERROR: Invalid bind_mode '{bind_mode}'. Must be 'loopback', 'lan', 'tailnet', or 'auto'")
return False
# Validate port range
@@ -157,7 +157,7 @@ def main():
if cmd == "apply-gateway-settings":
if len(sys.argv) != 7:
print("Usage: oc_config_helper.py apply-gateway-settings <local|remote> <loopback|lan> <port> <enable_openai_api:true|false> <allow_insecure:true|false>")
print("Usage: oc_config_helper.py apply-gateway-settings <local|remote> <loopback|lan|tailnet|auto> <port> <enable_openai_api:true|false> <allow_insecure:true|false>")
sys.exit(1)
mode = sys.argv[2]
bind_mode = sys.argv[3]