AcidGr/dsh-web-lan-access ↗★ 1
dsh-web-lan-access
LAN / remote access support for the DeepSeek Harness Web UI: polyfills crypto.randomUUID on insecure (plain-HTTP) origins so the frontend survives LAN or Tailscale IP direct links. Host-side index-tap plugin.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:AcidGr/dsh-web-lan-access说明文档
阅读完整 README ↗dsh-web-lan-access
DeepSeek Harness Web UI 的局域网/远程访问支持插件。
问题
Web UI 在启动关键路径上调用 crypto.randomUUID()(RPC id 生成、消息 id、草稿附件)。该 Web API 只在安全上下文存在(HTTPS,或 http://localhost / http://127.0.0.1)。当界面通过纯 HTTP 从非回环地址(局域网 IP、Tailscale IP、主机名)提供服务时,crypto.randomUUID 是 undefined,所有 RPC 抛错,会话和模型完全无法显示。
原理
宿主端插件使用 webserver 官方扩展点(webServer.tapIndex),在每次返回的 index.html 的 `` 之后注入一段 polyfill(基于 crypto.getRandomValues 的 RFC 4122 v4 实现——该 API 在非安全上下文可用),位置在启动清单和 shell 入口之前。安全上下文下 polyfill 为空操作。
- 不修改产品源码,完全可逆
- 与版本无关(只转换下发的 index.html)
- 跨平台(Linux / macOS / Windows / Android)
安装
方式一:bundle 安装(推荐)
从 npm 安装:
dsh plugin --profile web add dsh-web-lan-access
(不走 npm / 本地开发时,可用仓库地址:
dsh plugin --profile web add github:AcidGr/dsh-web-lan-access
)
重启 dsh web,浏览器硬刷新。
方式二:手动安装(无 pnpm / 离线)
PROFILE="$DSH_HOME/profiles/web" # 按实际修改 DSH_HOME 和 profile 名
mkdir -p "$PROFILE/plugins" "$PROFILE/node_modules/@dsh-profile"
cp -r dsh-web-lan-access "$PROFILE/plugins/lan-access"
ln -sfn ../../plugins/lan-access "$PROFILE/node_modules/@dsh-profile/lan-access"
# 在 $PROFILE/cordis.patch.yml 追加:
# - insert:
# - id: lan-access
# name: '@dsh-profile/lan-access'
使用
-
绑定所有网卡,让其他设备可连接:
dsh --profile web --host 0.0.0.0 --port 3080绑定
0.0.0.0后,harness 会自动把本机所有非内部 IPv4 加入/api信任围栏(resolveLanTrust)——局域网 IP 访问零额外配置。 -
域名/远程(如 Tailscale)——把你自己的入口加进
trustedHosts:- id: web-runtime config: trustedHosts: - # 如 myhost —— 必须单独列出! - .tailXXXX.ts.net # 完整域名 - 100.x.x.x # tailnet IP