Files
bot/docs/zh-CN/gateway/remote-gateway-readme.md
zeekay acaeda400a Eradicate OpenClaw — resolve merge conflicts and finish the rebrand
Three coordinated things:

1. Resolve the committed upstream/main merge conflicts. 94 files were
   sitting with raw <<<<<<< HEAD ... >>>>>>> upstream/main blocks. Every
   conflict had HanzoBot/Bot on HEAD and OpenClaw on upstream. Resolved
   by keeping HEAD everywhere — 540 conflict blocks.

2. Rewrite remaining OpenClaw text refs.
     OPENCLAW   → HANZO_BOT
     OpenClaw   → HanzoBot          (PascalCase type identifiers)
     openclaw   → bot               (codebase convention — botToken,
                                    botUsername etc.; avoids invalid
                                    hyphenated JS identifiers)
     openclaw[_]/openclaw[A-Z] → bot[_]/bot[A-Z]   (compound)
     ai.openclaw.x → ai.hanzo.bot.x  (JVM package path)

3. Delete or rename openclaw-named file paths (116 of them). Dead
   duplicates with a Bot-named canonical from the partial migration:
   deleted. Otherwise renamed.
     ai/openclaw/**           → deleted (ai/hanzo/bot/** canonical)
     Sources/OpenClaw*/       → deleted (Sources/Bot* canonical)
     Tests/OpenClawIPCTests/  → deleted (Tests/BotIPCTests canonical)
     OpenClawKit/             → deleted (BotKit canonical)
     openclaw-tools.*.ts      → deleted (bot-tools.*.ts canonical)
     openclaw-root.ts etc.    → deleted (bot-root.ts canonical)
     types.openclaw.ts        → deleted (types.bot.ts canonical)
     extensions/*/openclaw.plugin.json → renamed hanzo-bot.plugin.json
     docs/start/openclaw.md   → renamed hanzo-bot.md (+ zh-CN)
     docs/assets/openclaw-*.png, whatsapp-openclaw*.jpg → deleted
     scripts/.../openclaw-*   → deleted (bot/hanzo-bot parallels)
     openclaw.mjs             → deleted (hanzo-bot.mjs is package.bin)

Then patched 65 broken JS/TS import strings where hanzo-bot had ended
up inside an import path ('./types.hanzo-bot.js' → './types.bot.js'
etc., since the on-disk filename uses the brand-neutral bot- prefix).

Pre-existing lint debt cleaned up to get oxlint --type-aware to 0/0:
removed the dead i18n test that referenced a path no longer existing;
defined the missing DIDConfig and WalletConfig types in types.base.ts
(they were imported but never declared); dropped unused imports;
collapsed redundant type assertion and a tautological meta.bot lookup
that the openclaw→bot rename made redundant.

The a2ui.bundle.js generated artifact is kept at its pre-rebrand
contents — it gets regenerated by 'pnpm canvas:a2ui:bundle' from
sources I cannot rebuild in this commit; the source side is clean.

Verified: 0 occurrences of openclaw (case-insensitive) in tree source
content, 0 file or directory paths with openclaw in the name; oxlint
--type-aware src test reports 0/0.
2026-05-11 17:56:29 -07:00

5.1 KiB
Raw Permalink Blame History

read_when, summary, title, x-i18n
read_when summary title x-i18n
Connecting the macOS app to a remote gateway over SSH HanzoBot.app 连接远程 Gateway 网关的 SSH 隧道设置 远程 Gateway 网关设置
generated_at model provider source_hash source_path workflow
2026-02-03T07:48:37Z claude-opus-4-5 pi b1ae266a7cb4911b82ae3ec6cb98b1b57aca592aeb1dc8b74bbce9b0ea9dd1d1 gateway/remote-gateway-readme.md 15

使用远程 Gateway 网关运行 HanzoBot.app

HanzoBot.app 使用 SSH 隧道连接到远程 Gateway 网关。本指南向你展示如何设置。

概述

┌─────────────────────────────────────────────────────────────┐
│                        Client Machine                          │
│                                                              │
│  HanzoBot.app ──► ws://127.0.0.1:18789 (local port)           │
│                     │                                        │
│                     ▼                                        │
│  SSH Tunnel ────────────────────────────────────────────────│
│                     │                                        │
└─────────────────────┼──────────────────────────────────────┘
                      │
                      ▼
┌─────────────────────────────────────────────────────────────┐
│                         Remote Machine                        │
│                                                              │
│  Gateway WebSocket ──► ws://127.0.0.1:18789 ──►              │
│                                                              │
└─────────────────────────────────────────────────────────────┘

快速设置

步骤 1:添加 SSH 配置

编辑 ~/.ssh/config 并添加:

Host remote-gateway
    HostName <REMOTE_IP>          # e.g., 172.27.187.184
    User <REMOTE_USER>            # e.g., jefferson
    LocalForward 18789 127.0.0.1:18789
    IdentityFile ~/.ssh/id_rsa

将 <REMOTE_IP> 和 <REMOTE_USER> 替换为你的值。

步骤 2:复制 SSH 密钥

将你的公钥复制到远程机器(输入一次密码):

ssh-copy-id -i ~/.ssh/id_rsa <REMOTE_USER>@<REMOTE_IP>

步骤 3:设置 Gateway 网关令牌

launchctl setenv BOT_GATEWAY_TOKEN "<your-token>"

步骤 4:启动 SSH 隧道

ssh -N remote-gateway &

步骤 5:重启 HanzoBot.app

# Quit HanzoBot.app (⌘Q), then reopen:
open /path/to/HanzoBot.app

应用现在将通过 SSH 隧道连接到远程 Gateway 网关。


登录时自动启动隧道

要在登录时自动启动 SSH 隧道,请创建一个 Launch Agent。

创建 PLIST 文件

将此保存为 ~/Library/LaunchAgents/bot.molt.ssh-tunnel.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>bot.molt.ssh-tunnel</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/ssh</string>
        <string>-N</string>
        <string>remote-gateway</string>
    </array>
    <key>KeepAlive</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

加载 Launch Agent

launchctl bootstrap gui/$UID ~/Library/LaunchAgents/bot.molt.ssh-tunnel.plist

隧道现在将:

  • 登录时自动启动
  • 崩溃时重新启动
  • 在后台持续运行

旧版注意事项:如果存在任何遗留的 com.hanzo-bot.ssh-tunnel LaunchAgent,请将其删除。


故障排除

检查隧道是否正在运行:

ps aux | grep "ssh -N remote-gateway" | grep -v grep
lsof -i :18789

重启隧道:

launchctl kickstart -k gui/$UID/bot.molt.ssh-tunnel

停止隧道:

launchctl bootout gui/$UID/bot.molt.ssh-tunnel

工作原理

组件 功能
LocalForward 18789 127.0.0.1:18789 将本地端口 18789 转发到远程端口 18789
ssh -N SSH 不执行远程命令(仅端口转发)
KeepAlive 隧道崩溃时自动重启
RunAtLoad 代理加载时启动隧道

HanzoBot.app 连接到你的客户端机器上的 ws://127.0.0.1:18789。SSH 隧道将该连接转发到运行 Gateway 网关的远程机器的端口 18789。