返回顶部
o

openclaw-tailscale-remote-accessTailscale远程访问配置

Configure or repair OpenClaw remote access over Tailscale with a directly executable workflow: inspect state, apply the gateway config, enable Tailscale Serve over HTTPS, validate browser access, and handle origin, DNS, or pairing failures.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
280
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

openclaw-tailscale-remote-access

OpenClaw Tailscale 远程访问

当 Codex 需要通过 Tailscale 使 OpenClaw 网关可达,且结果必须可直接配置而不仅仅是描述时,使用此技能。

浏览器访问优先使用 Tailscale Serve + HTTPS。推荐配置如下:

  • - OpenClaw 绑定到 127.0.0.1
  • 浏览器访问通过 https://..ts.net
  • auth.mode 为 token
  • auth.allowTailscale 为 true

必需输入

在进行更改前收集以下值:

  • - 访问 Linux 主机的非 Tailscale 路径
优先使用云控制台或公共 SSH
  • - OpenClaw 配置文件路径
默认:~/.openclaw/openclaw.json
  • - 最终的 MagicDNS 主机名
示例:..ts.net
  • - 要放入配置中的网关令牌

技能资源

先解析技能目录,以便 Codex 能调用捆绑脚本,即使技能仍在 ~/Downloads 中:

bash
export SKILLDIR=${CODEXHOME:-$HOME/.codex}/skills/openclaw-tailscale-remote-access
if [ ! -d $SKILL_DIR ] && [ -d $HOME/Downloads/openclaw-tailscale-remote-access ]; then
export SKILL_DIR=$HOME/Downloads/openclaw-tailscale-remote-access
fi

export OPENCLAWCONFIG=${OPENCLAWCONFIG:-$HOME/.openclaw/openclaw.json}
export GATEWAYPORT=${GATEWAYPORT:-18789}
export TS_HOSTNAME=..ts.net
export GATEWAY_TOKEN=

安全规则

  1. 1. 不要从 Tailscale SSH 会话中运行 tailscale up。
  2. 如果需要更改 Tailscale 状态,优先使用云控制台或公共 SSH 会话。
  3. 除非用户明确接受仅 HTTP 访问和较弱的浏览器行为,否则不要将 OpenClaw 切换到 bind: tailnet。
  4. 在 Mac 客户端上,如果浏览器必须解析 *.ts.net,请保持 Tailscale DNS 启用。

直接工作流程

1. 检查当前状态

首先运行捆绑的检查器:

bash
bash $SKILLDIR/scripts/inspectremoteaccess.sh $OPENCLAWCONFIG

在进行任何更改前,使用输出来回答以下问题:

  • - openclaw-gateway 是否正在运行
  • Tailscale 是否正在运行
  • 是否已存在 HTTPS Serve 处理程序
  • 是否有待处理的配对请求

2. 确认会话对 tailscale up 安全

使用以下检查:

bash
printf SSHCONNECTION=%s\n ${SSHCONNECTION:-}
hostname
tailscale ip -4 2>/dev/null || true

如果当前 shell 是通过 Tailscale SSH 或 Tailscale IP 访问的,请停止并在更改 Tailscale 状态前切换到云控制台或公共 SSH。

3. 应用 OpenClaw 网关配置

捆绑脚本会创建带时间戳的备份,并仅更新远程访问所需的网关字段:

bash
python3 $SKILLDIR/scripts/applygateway_config.py \
--config $OPENCLAW_CONFIG \
--ts-hostname $TS_HOSTNAME \
--token $GATEWAY_TOKEN \
--port $GATEWAY_PORT

脚本强制执行以下配置格式:

json
{
gateway: {
port: 18789,
mode: local,
bind: loopback,
controlUi: {
allowedOrigins: [
http://localhost:18789,
http://127.0.0.1:18789,
https://..ts.net
]
},
auth: {
mode: token,
token: ,
allowTailscale: true
},
tailscale: {
mode: serve,
resetOnExit: false
}
}
}

4. 重启网关

bash
systemctl --user restart openclaw-gateway
systemctl --user status openclaw-gateway --no-pager

如果服务未恢复到 active (running) 状态,请在操作 Tailscale Serve 前修复此问题。

5. 以低影响模式启动或修复 Tailscale

仅在安全会话中使用此命令:

bash
tailscale up --accept-dns=false --accept-routes=false --ssh=false

如果 Tailscale 提示必须重新声明所有非默认标志,请使用现有非默认标志加上上述标志重新运行 tailscale up。不要盲目使用 --reset。

6. 配置 HTTPS Serve

使用捆绑的辅助脚本:

bash
bash $SKILLDIR/scripts/configuretailscaleserve.sh --port $GATEWAYPORT

如果节点已有需要替换的 Serve 配置,请重新运行:

bash
bash $SKILLDIR/scripts/configuretailscaleserve.sh --reset-first --port $GATEWAYPORT

预期映射:

text
https://..ts.net/ -> http://127.0.0.1:18789/

7. 端到端验证

按顺序运行以下检查:

bash
tailscale status --json
tailscale serve status --json
systemctl --user status openclaw-gateway --no-pager
tailscale ip -4
curl -vkI --resolve $TSHOSTNAME:443:$(tailscale ip -4 | head -n1) https://$TSHOSTNAME/

预期结果:

  • - Tailscale 后端状态为 Running
  • Serve 报告 TCP 443 上有 HTTPS 处理程序
  • openclaw-gateway 状态为 active (running)
  • HTTPS 请求到达服务,且 DNS 和 TLS 握手未失败

客户端修复

如果浏览器客户端是 Mac,且 Tailscale 更改后 *.ts.net 停止解析,不要更改服务器绑定模式。先修复客户端:

bash
tailscale set --accept-routes=false
tailscale set --accept-dns=true
scutil --dns | grep -E ts.net|tailscale
nslookup $TS_HOSTNAME

需要配对

如果仪表板加载但报告 pairing required:

bash
cat ~/.openclaw/devices/pending.json
openclaw devices list
openclaw devices approve

如果 CLI 路径损坏,请检查主机上安装的 OpenClaw CLI 或 Python 包,并调用其内置的批准路径。除非用户明确要求作为最后手段恢复,否则不要手动编辑 pending.json 或 paired.json。

故障排除优先级

  • - origin not allowed
controlUi.allowedOrigins 错误;使用正确的 TS_HOSTNAME 重新运行配置脚本。
  • - ERRSSLPROTOCOL_ERROR、invalid response 或 TLS 握手失败
检查 tailscale serve status,然后检查主机 DNS 和证书颁发。
  • - 客户端上 *.ts.net 出现 NXDOMAIN
修复客户端 MagicDNS;不要仅仅为了绕过 DNS 而将服务器切换到 bind: tailnet。
  • - pairing required
在网关主机上批准待处理的设备。

参考

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 openclaw-tailscale-remote-access-1776191368 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 openclaw-tailscale-remote-access-1776191368 技能

通过命令行安装

skillhub install openclaw-tailscale-remote-access-1776191368

下载

⬇ 下载 openclaw-tailscale-remote-access v1.0.1(免费)

文件大小: 14.05 KB | 发布时间: 2026-4-15 12:47

v1.0.1 最新 2026-4-15 12:47
- Added metadata to SKILL.md, including version, homepage, and required dependencies.
- Added CHANGELOG.md, README.md, and README.zh-CN.md for improved documentation.
- Introduced agents/openai.yaml configuration file.
- Improved skill packaging and required bin/config discovery.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部