dsh-remote-link
Authenticated LAN gateway for DeepSeek Harness: reverse-proxies the official web UI with Basic Auth, advertises via mDNS, and adds a fork_session tool.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:BotonJ/dsh-remote-link说明文档
阅读完整 README ↗dsh-remote-link
把 DeepSeek Harness(DSH)的官方 Web UI 安全地暴露到局域网——手机扫码即遥控电脑上的 agent——并给模型增加 fork_session 会话分叉工具。零核心改动、零运行时依赖。
v1.5:QR 一次性配对 + HMAC 挑战-响应 + HttpOnly Cookie 会话 + 设备注册表(v1 的 ?token= 明文折衷已删除,设计见 docs/PAIRING-DESIGN.md)。
手机扫码(→ /pair#p=sid.secret, secret 留在 fragment)
→ GET /pair/challenge?sid → {nonce, ts}
→ proof = HMAC(secret, sid|nonce|ts)
→ POST /pair/verify → Set-Cookie rls= (HttpOnly, SameSite=Strict, 30d)
→ 官方 UI / /api RPC / WS 事件流全部走 cookie,无密码无弹窗
为什么这样设计
- 主 webserver 保持 loopback:DSH 官方 CLI 明确拒绝
--host 0.0.0.0("would expose remote code execution to the network")。本插件是"被认可的远程暴露方式":网关在独立端口做认证,反代到 loopback。 - 官方前端直接复用:不做自己的 UI(dsh-desktop 也是 Electron 壳 loadURL 官方 UI),聊天框就是遥控器。
?token=查询参数认证:浏览器 WebSocket/EventSource API 无法携带Authorization头,官方 UI 的事件流(/api/events.mux)在手机上必须有这条通路(与 MiMo 移动端方案一致)。
安装
dsh plugin --profile web add ./dsh-remote-link # 本地目录
# 或 dsh plugin --profile web add github:/dsh-remote-link
在 $DSH_HOME/profiles/web/cordis.patch.yml 的 remote-link 行配置:
| 配置 | 默认 | 说明 |
|---|---|---|
host | 0.0.0.0 | 网关绑定地址 |
port | 3081 | 网关端口;0 为系统随机分配 |
username / password | dsh / 空 | Basic Auth 后备(curl/桌面浏览器便利);配对启用时可留空 |
pairing.enabled | true | QR/短码配对 + cookie 会话;关闭后非 loopback 必须设 password |
pairing.ttlMs | 300000 | 配对秘密有效期(5 分钟、一次性) |
pairing.sessionMaxAgeDays | 30 | cookie 会话最长寿命 |
pairing.deviceIdleExpiryDays | 90 | 设备闲置自动出局 |
pairing.devicesFile | $DSH_HOME/remote-link/devices.json |