7cb07fe6-0f3a-4941-b428-07945377a4user: A new session was started via /new or /reset. Say hi briefly (1-2 sentences) and ask what the user wants to do next. If the runtime model differs from default_model in the system prompt, mention the default model in the greeting. Do not mention internal steps, files, tools, or reasoning.
[message_id: 161d7259-4f7d-41fe-a2d5-53b508d3f6]
assistant: Hey! I'm here and ready to help. What would you like to do next?
user: 告诉我如何通过收集连接这个服务
[message_id: de5f041d-c241-41ca-a65a-357bb6d1f2]
assistant: 你提到的“收集连接”具体是指什么服务?可以提供更多上下文吗?比如:
这样我可以更准确地帮你。
user: 我想要用收集访问web端的http://8.215.84.197:18789/
[message_id: 3ffffca2-088b-47d7-9854-e6bcf01805]
assistant: 你提到的“收集”可能是指 Collect(一个开源的移动端数据采集工具,常用于 ODK/ODK-X 生态),而你想通过它访问 Web 端服务 http://8.215.84.197:18789/。
不过 Collect 本身是 Android 应用,主要用于填写表单、提交数据到服务器(如 ODK Aggregate、Central 或其他兼容后端)。它不能直接作为浏览器访问任意 Web 页面。
但如果你的目标是:
那么你需要在 Collect App 中配置服务器 URL:
http://8.215.84.197:18789⚠️ 注意:确保你的手机和该服务器在同一网络(或服务器公网可访问),且端口 18789 未被防火墙拦截。
Collect 不支持浏览网页。你应该用手机浏览器直接访问:
http://8.215.84.197:18789/
先确认这个服务到底是什么类型:
你可以先在电脑或手机浏览器中打开 http://8.215.84.197:18789/,看看页面内容,再决定如何对接 Collect。
需要我帮你判断这个服务类型吗?或者你已经有账号信息了?
user: no,no,你再想想, http://8.215.84.197:18789/ 就是你自己,我想要访问你,如何设置
[message_id: b395d324-1643-467e-857c-9fbf1ca2d4]
assistant: 啊,明白了!你说得对 —— http://8.215.84.197:18789/ 就是我(Moltbot)当前运行的 Web 服务地址。
但目前这个地址只能在本地或内网访问,而且默认的 Web 界面是通过 Moltbot 的 WebChat 插件提供的,不是公开网页。
你已经在和我对话了,说明你已经连上了!
你当前使用的应该就是 Moltbot 内置的 Web 界面(通过浏览器访问 http://8.215.84.197:18789/)。
🔍 你可以直接在浏览器中打开:
👉 http://8.215.84.197:18789/
就会看到一个聊天窗口,和你现在用的一样。
ssh -L 18789:localhost:18789 user@your-server)告诉我你的目标,我可以给你具体设置步骤。
user: 前面我们尝试了,我们发现目前我们没法用 微信,钉钉,飞书,甚至telegram来访问,只能先考虑web端来访问呢
[message_id: 48b4fdb2-ab0e-45db-ac76-b010f3b0ea]
assistant: 明白了!既然目前只能通过 Web 端访问(http://8.215.84.197:18789/),那我们就优化这个 Web 访问体验,并确保它稳定可用。
你已经能通过浏览器打开 http://8.215.84.197:18789/ 并和我对话,说明:
Moltbot 默认不会自动启动。你可以设置 systemd 服务:
# 创建服务文件
sudo tee /etc/systemd/system/moltbot.service <<EOF
[Unit]
Description=Moltbot AI Assistant
After=network.target
[Service]
Type=simple
User=admin
WorkingDirectory=/home/admin/clawd
ExecStart=/usr/bin/npm start --prefix /opt/moltbot
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
# 启用并启动
sudo systemctl daemon-reload
sudo systemctl enable moltbot
sudo systemctl start moltbot
这样服务器重启后,Moltbot 会自动恢复。
虽然不能直接加登录页,但可以用 Nginx 反向代理 + Basic Auth:
# 安装 Nginx
sudo apt update && sudo apt install nginx apache2-utils -y
# 创建密码文件(替换 yourname 为你想要的用户名)
sudo htpasswd -c /etc/nginx/.moltbot_htpasswd yourname
# 配置反向代理
sudo tee /etc/nginx/sites-available/moltbot <<EOF
server {
listen 80;
server_name _;
location / {
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/.moltbot_htpasswd;
proxy_pass http://127.0.0.1:18789;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
}
}
EOF
sudo ln -sf /etc/nginx/sites-available/moltbot /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
之后访问
http://8.215.84.197/(不带端口)就会弹出登录框,更安全!
如果你没有公网 IP 或想避免暴露端口,Cloudflare Tunnel 是最佳选择:
# 安装 cloudflared
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared.deb
# 登录(会弹出浏览器)
cloudflared tunnel login
# 创建隧道
cloudflared tunnel create moltbot-web
# 配置路由到本地 18789
echo "url: http://localhost:18789
tunnel: $(cloudflared tunnel list --output json | jq -r '.[0].ID')
credentials-file: /root/.cloudflared/$(cloudflared tunnel list --output json | jq -r '.[0].ID').json" | sudo tee /etc/cloudflared/config.yml
# 启动隧道
sudo cloudflared tunnel run --config /etc/cloudflared/config.yml
然后在 Cloudflare DNS 添加一条 CNAME 记录,指向隧道,就能通过 https://yourname.yourdomain.com 安全访问!
http://8.215.84.197:18789/ 访问我(已可用)需要我帮你执行其中哪一步吗?比如先设置开机自启,或者生成 Nginx 配置?
user: 手机浏览器显示 disconnected from gateway, 1008, device identity rquired
[message_id: 9f8bef23-05d3-4934-97f5-85529cf53d]
assistant: 这个错误 “disconnected from gateway, 1008, device identity required” 表明 Moltbot 的 WebChat 网关要求设备身份验证,但手机浏览器没有提供有效的身份标识。
Moltbot 默认在 WebChat 中启用了 设备身份绑定(device identity) 安全机制:
localStorage 中http://8.215.84.197:187898.215.84.197 → 清除数据 → 重新打开重新打开后,应该会自动注册新设备身份,不再报错。
如果你在内网使用且信任所有用户,可以关闭身份验证:
# 编辑 Moltbot 配置
nano /home/admin/clawd/moltbot.config.json
找到 webchat 部分,添加或修改:
{
"plugins": {
"webchat": {
"enabled": true,
"requireDeviceIdentity": false // ← 关键:设为 false
}
}
}
然后重启 Moltbot:
cd /opt/moltbot
npm start
之后所有设备都能直接访问,无需身份绑定。
如果你希望保留安全但允许特定设备访问,可以手动注入设备 ID:
在 Console 执行:
localStorage.getItem('moltbotDeviceId')
复制返回的 ID(如 "abc123...")
在手机浏览器 Console 中执行:
localStorage.setItem('moltbotDeviceId', 'abc123...'); location.reload()
这样手机就“冒充”了桌面设备,可绕过验证。
需要我帮你修改配置文件关闭验证吗?或者你更倾向保留安全机制?
user: 好的手机链接成功
[message_id: 4a2b8fed-213f-4e67-81cf-07b495794e]
assistant: 太好了!手机能连上说明问题解决了 🎉
如果之后又遇到类似断开的情况,大概率是浏览器清除了本地存储(比如清理缓存、用了隐私模式),可以:
需要我帮你设置密码保护或者优化其他配置吗?