DeepSeek Harness Hub
← 返回列表

局域网手机访问ZnFr60/dsh-lan-access-for-windows

DeepSeek Harnessspec-screened在 GitHub 查看 ↗
未验证

让手机浏览器在家庭内网完整操控 DSH 网页界面

尚未跑自动兼容性验证,可查看页面内的依赖与入口分析。 · 最近上游提交 2026/8/25 · 已提供中文文档

DeepSeek Harness 局域网访问捆绑插件:将 dsh web 绑定到 0.0.0.0 + 为手机浏览器提供 crypto.randomUUID 安全上下文 shim。

综合分
28.5
GitHub 分
28.5
用户评分
★ Stars
1
周下载量
安装插件(需先安装 dsh CLI 引擎:npm install -g @deepseek-ai/dsh)
dsh plugin --profile web add ZnFr60/dsh-lan-access-for-windows
该插件未发布到 npm,走 GitHub 源安装(pnpm 若拦截 prepare 脚本,按其提示在 pnpm-workspace.yaml 的 allowBuilds 中放行后重跑)
数据截至 2026/9/16(元数据每日更新 · 实装验证按队列轮转,单条结论的验证时间见上方)
用户评分
还没有人投票,来当第一个
订阅周报,不错过优质插件更新
每周一封 · 高评分插件 + 新用户活动

README

dsh-lan-access

这是我的第一个个人项目,开发于 2026 年暑假的业余时间。我是一名来自中国的高中生,利用空闲时间进行编程。感谢你的支持!如果你有任何建议、反馈或问题,欢迎随时联系我。

DeepSeek Harness (dsh) 局域网访问插件 — 让手机浏览器在家庭可信内网完整操控 DSH Web GUI
DeepSeek Harness 的局域网访问插件 — 在可信家庭网络上通过手机浏览器完整操控 DSH Web GUI。

中文

这是什么

兼容性:本插件通过 DSH 官方插件机制(bundle patch 层 + webServer.tapIndex)工作,
适用于 DSH web profile(实测版本:harness v0.18.x / @deepseek-ai/ 0.1.1-rc.2)。
已在本机 dsh web 完整验证:webserver 绑定 0.0.0.0、/api 信任篱笆放行局域网、
页面注入 shim 均生效。

dsh-lan-access 是一个 dsh 插件(bundle 层),解决两个官方限制,实现手机端与电脑端一致的完整操控能力(发指令、审批权限弹窗、查看编译日志):

1. 绕过 host 绑定限制:官方 dsh web 出于安全原因在 CLI 硬编码拒绝
--host 0.0.0.0(见 dsh-web-app/lib/startup.js)。本插件在官方支持的组合
(composition)层把 webserver 行的 host 覆盖为 0.0.0.0,让服务器监听所有网卡;
--port 参数仍生效。
2. 修复安全上下文导致的网页接口报错:手机浏览器经 http://:3080 访问时处于
非安全上下文,crypto.randomUUID() 是 undefined,而 DSH 客户端 mintRpcId()
直接调用它(见 deepseek-harness discussion #4209),
导致整个 RPC 层崩溃。本插件向每个 index.html 注入 shim,用 crypto.getRandomValues()
兜底实现 UUID v4(原生存在时不覆盖)。
3. 信任篱笆自动放行:绑到 0.0.0.0 后,dsh 自带 web-runtime 会自动把本机所有非内网
IPv4 加入 /api browser-trust 篱笆的 trustedHosts,手机请求无需额外 --trusted-host。

安装

方式 0 — 一键脚本(推荐):下载 install.ps1 直接运行(自动检查/补装 pnpm、安装插件、重启 dsh web、验证,可选加防火墙):

下载并运行(Windows)
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/ZnFr60/dsh-lan-access/main/install.ps1" -OutFile install.ps1
.\install.ps1                        # 默认 GitHub 源
.\install.ps1 -Source gitee          # 换 Gitee 源
.\install.ps1 -AddFirewallRule       # 同时添加局域网防火墙规则(需管理员)

方式 A — 从 git 托管仓库安装(官方 dsh plugin 机制,需 pnpm):

GitHub 托管(本仓库)
dsh plugin --profile web add github:ZnFr60/dsh-lan-access#main
Gitee 托管(镜像)
dsh plugin --profile web add git+https://gitee.com/mnrf/dsh-lan-access.git

方式 B — 本地 link 安装(开发/内网):

git clone https://gitee.com/mnrf/dsh-lan-access.git
dsh plugin --profile web add link:/绝对/路径/dsh-lan-access

方式 C — npm 包安装(发布到 npm 后):

dsh plugin --profile web add dsh-lan-access

需要 pnpm:corepack enable 或参考 pnpm 安装。

安装完成后重启 dsh web:

dsh web --no-open

使用方法(Usage)

适用对象:本插件是 web profile 专用插件,请务必安装到 --profile web。
(它需要 web profile 里的 webserver 行,若装进无 web 层的通用 profile 会提示
entry "webserver" not found,属预期警告,并非装错。)

前置条件
- 已安装 DSH 并可用 dsh web;
- 已安装 pnpm(dsh plugin 依赖,corepack enable 即可)。

完整安装步骤

1) 安装插件到 web profile(git 托管 / npm / 本地 link 三选一)bash
dsh plugin --profile web add github:ZnFr60/dsh-lan-access#main   # GitHub
或: dsh plugin --profile web add git+https://gitee.com/mnrf/dsh-lan-access.git  # Gitee
或: dsh plugin --profile web add dsh-lan-access                                 # npm(发布后)
或(本地开发): dsh plugin --profile web add link:/绝对/路径/dsh-lan-access

2) 重启 web 使插件生效
dsh web --no-open

验证生效
bash
① 组合配置:webserver.host 应为 0.0.0.0,且出现 lan-access 行
dsh --profile web --dump-config

② 页面 HTML 应含 randomUUID shim(说明安全上下文修复已注入)
curl -s http://127.0.0.1:3080/ | grep -o "randomUUID"

③ 手机访问(局域网 IP 换成你的):
http://:3080
应能完整操作:发指令、审批权限弹窗、查看编译日志,与电脑端一致

卸载
bash
dsh plugin --profile web remove dsh-lan-access
然后重启 dsh web 即恢复默认回环访问

手机访问地址

- 服务器本机:http://127.0.0.1:3080
- 局域网:http://:3080(手机与电脑连同一路由器/交换机、同网段)

卸载
bash
dsh plugin --profile web remove dsh-lan-access
然后重启 dsh web

原理(如何兼容 DeepSeek Harness)

dsh 用 profile + bundle patch 层组合应用。package.json 声明
dsh.bundle.patch: "./cordis.patch.yml",dsh plugin add 会把它识别为 profile 层
并自动并入 dsh.profile.bundles。cordis.patch.yml:
yaml
- id: webserver
config:
host: '0.0.0.0'
port: !!js ctx.webStartup.port ?? 3080
- insert:
- id: lan-access
name: 'dsh-lan-access'

lib/index.js 用 webServer.tapIndex() 向每个 index.html 注入 shim(在 app 模块
执行前运行,见 index.html 的  与 type="module" 延迟执行特性)。

文件结构

dsh-lan-access/
├── package.json          # 声明 dsh.bundle.patch,dsh 插件清单
├── cordis.patch.yml      # bundle patch:覆盖 webserver host + 挂载 lan-access 行
├── lib/
│   ├── index.js          # 插件主体:注入 randomUUID shim、打印 LAN URL
│   └── index.d.ts        # 类型声明
├── install.ps1           # 一键安装脚本(自动补 pnpm + 安装 + 重启 + 验证)
├── LICENSE               # MIT
└── README.md

安全注意事项

- 仅监听 0.0.0.0;不要配置任何端口转发、隧道或公网绑定。
- 建议配合防火墙只放行局域网网段(示例,Windows 以管理员执行):
powershell
netsh advfirewall firewall add rule name="dsh-lan-3080" dir=in action=allow protocol=TCP localport=3080 remoteip=LocalSubnet
- /api 信任篱笆仍会拒绝非受信 Host(DNS 重绑定防护保持有效)。

English

功能说明

兼容性:通过官方 DSH 插件机制(bundle patch
层 + webServer.tapIndex)为 DSH web profile 工作(已在 harness
v0.18.x / @deepseek-ai/ 0.1.1-rc.2 上验证):webserver 绑定 0.0.0.0,/api 信任
篱笆接受局域网主机,页面附带 shim。

dsh-lan-access 是一个 dsh bundle 插件,它解锁两项官方限制,让你可信家庭网络中的
手机浏览器能够像桌面端一样完整操作 DSH Web GUI
(发送命令、批准权限提示、查看构建日志):

1. 绕过主机绑定守卫:官方 dsh web CLI 出于安全考虑硬性拒绝
--host 0.0.0.0。此插件在受支持的组合层将 webserver 行的 host
覆盖为 0.0.0.0;--port 仍然有效。
2. 修复安全上下文崩溃:在纯 HTTP(http://:3080)下,浏览器处于非安全上下文,此时 crypto.randomUUID() 为 undefined。
DSH 的 mintRpcId() 直接调用它(讨论 #4209),
导致整个 RPC 层崩溃。本插件会向每个 index.html 注入一个 shim,
基于 crypto.getRandomValues() 实现 UUID v4 的 polyfill(原生实现保持不变)。
3. 信任围栏自动放行:绑定 0.0.0.0 会让 dsh 自带的 web-runtime 将所有
本地 IPv4 字面量加入 /api 浏览器信任的 trustedHosts,因此无需额外的
--trusted-host。

安装

方式 0 —— 一键脚本(推荐)。下载 install.ps1 并运行
(检查/安装 pnpm、安装插件、重启 dsh web、验证;可选防火墙):
powershell
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/ZnFr60/dsh-lan-access/main/install.ps1" -OutFile install.ps1
.\install.ps1                        # 默认:GitHub 源
.\install.ps1 -Source gitee          # 或 Gitee 源
.\install.ps1 -AddFirewallRule       # 同时添加仅限局域网的防火墙规则(管理员)

目标:这是一个 web-profile 插件 —— 请安装到 --profile web。它需要
只有 web profile(通过 dsh-web-app)才提供的 webserver 行;安装到
通用 profile 会打印 entry "webserver" not found,这是预期行为。

需要 pnpm。从本仓库安装(官方 dsh plugin 机制):
bash
GitHub 托管(本仓库)
dsh plugin --profile web add github:ZnFr60/dsh-lan-access#main
Gitee 托管(镜像)
dsh plugin --profile web add git+https://gitee.com/mnrf/dsh-lan-access.git
npm(发布后)
dsh plugin --profile web add dsh-lan-access
本地链接(开发)
dsh plugin --profile web add link:/abs/path/dsh-lan-access

安装后重启 web 服务器:
bash
dsh web --no-open

使用 / 验证
bash
1) 组合配置:webserver.host 应为 0.0.0.0,且存在 lan-access 行
dsh --profile web --dump-config

2) index.html 应包含 randomUUID shim
curl -s http://127.0.0.1:3080/ | grep -o "randomUUID"

3) 从手机打开:http://:3080
完全控制:发送命令、批准权限提示、读取构建日志

手机 URL

- 本地服务器:http://127.0.0.1:3080
- 局域网:http://:3080(手机和电脑在同一局域网/子网)

卸载
bash
dsh plugin --profile web remove dsh-lan-access

安全

- 仅绑定 0.0.0.0;不进行端口转发 / 隧道 / 公网暴露。
- 考虑添加限定到本地子网的防火墙规则(示例见上)。
- /api 信任围栏仍会拒绝不受信任的 Host(DNS 重绑定防护保持开启)。

许可证

MIT

上游仓库有新提交时邮件通知你(每天最多一封,无更新不打扰),随时一键退订。

同作者(ZnFr60)的其他插件

💬 加入 DPharness 群聊

插件用法、部署报错、新插件第一时间同步——群里问,比一个人翻文档快。

点击加入 QQ 群
DPharness 群聊二维码,手机 QQ 扫码进群
扫码进群