xbzbing/dsh-auth-gateway
为DeepSeek Harness添加安全远程访问功能,支持密码认证和TOTP双因素认证(2FA)。
Project Overview项目介绍
dsh-auth-gateway is a native Cordis plugin built exclusively for DeepSeek Harness (DSH) to add authentication gatekeeping functionality to DSH Web. It can be installed directly from the npm registry using the official DSH plugin CLI command, with alternative options for installing from GitHub or a local source directory. To install, users run dsh plugin --profile web add dsh-auth-gateway, then launch DSH Web with the desired external port, and the plugin automatically moves the internal webserver to a loopback-only port one higher than the external port. It is tested and confirmed compatible with all DSH versions from 0.1.2 up to the latest 0.1.6-alpha.2, and relies on official DSH extension points to function.
This plugin is intended for users who need to expose their DSH Web instance to a public network or local area network for remote access. Every incoming request passes through the gateway’s authentication check first, and unauthenticated requests are blocked immediately: API requests return a 401 status, page routes redirect to the login page, and WebSocket upgrade requests are rejected outright. Only authenticated requests are transparently forwarded to the internal DSH web service running on the loopback interface, so attackers cannot bypass the gateway to connect directly to the backend. The entire authentication flow is transparent to both end-user browsers and common reverse proxy deployment setups.
dsh-auth-gateway is released under the open-source MIT license, and it runs as a host-only plugin with no additional external runtime dependencies required after installation. If users forget their password, they can reset it using the included dsh-auth-gateway-reset command that prints a new temporary initial password to the console after restart. It is important to note that the plugin only provides entry authentication and login auditing, and does not support multi-tenant isolation or fine-grained role-based access control. Those capabilities require OS-level or container-level isolation that is outside the scope of this plugin.
dsh-auth-gateway 是专为 DeepSeek Harness (DSH) Web 开发的原生 Cordis 认证网关插件,提供密码登录、TOTP 双因素认证、多层防暴力破解、会话管理、登录审计等完整能力。它填补了官方 DSH Web 原生不支持公开远程访问认证的空白,以进程内网关形态成为 DSH Web 的唯一入口,通过补丁将内部 Web 服务绑定到回环地址,确保所有未认证流量都无法直接访问后端服务。
该插件主要面向需要将 DSH Web 暴露到公网或局域网供远程访问的用户,所有请求都会先经过网关的认证检查,未认证请求会被直接拦截:API 返回 401,页面重定向到登录页,WebSocket 连接直接拒绝。只有通过认证的请求才会被透明转发到内部回环的 DSH Web 服务,整个流程对浏览器和部署方式透明,目前已经验证兼容最新的 DSH 0.1.6 版本。
该插件采用 MIT 许可证开源,可通过官方 DSH 插件命令从 npm 直接安装,也支持从 GitHub 或本地源码安装,忘记密码可通过专用命令重置。它作为 host-only 插件没有额外运行时依赖,需要注意的是它仅提供访问认证与审计能力,不支持多租户隔离和细粒度角色权限控制,这需要操作系统或容器级的隔离来实现。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-auth-gateway(xbzbing/dsh-auth-gateway)
仓库:https://github.com/xbzbing/dsh-auth-gateway
本站详情页:https://www.yhbd.top/plugins/xbzbing-dsh-auth-gateway/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 14 · 最近提交 2026-10-03 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- 14 stars - an early-stage project星标 14,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-auth-gateway
把 xbzbing/dsh-auth-gateway 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-auth-gateway
Language: 简体中文 | English
为 DeepSeek Harness Web 提供认证门禁的 Cordis 插件:密码认证 + TOTP 双因素认证 + 多层防爆破 + 会话管理 + 登录审计,并在网关层真实拦截每一个请求(HTTP 与 WebSocket),未认证流量无法触及后端。
dsh web 的官方认证只面向本机回环:dsh 0.1.2 起内部 webserver 启用内置浏览器认证(BrowserAuth),但其设计说明明确写道「没有登出操作」("There is no logout operation"),并声明「认证不意味着支持网络部署、TLS、转发头解释或代理配置」("Authentication does not imply supported network deployment, TLS, forwarding-header interpretation, or proxy configuration"),CLI 依旧拒绝 --host 0.0.0.0——dsh 从未预想或支持远程访问,也没有为「前端再套一层网关」预留任何集成通道。本插件以进程内网关的形态补上这层缺失的远程访问认证:对外端口由网关独占,内部 webserver 由 bundle patch 绑定在本地回环,网关是唯一入口。
本项目支持 0.1.5-rc.2 <= dsh <= 0.2.1-alpha.1,均已实测。
安装和卸载
# 安装(从 npm registry)
dsh plugin --profile web add dsh-auth-gateway
# 启动(对外端口 8080,内部 webserver 自动挪到 8081)
dsh web --port 8080
# 卸载(先清凭据,再移除插件)
~/.dsh/profiles/web/node_modules/.bin/dsh-auth-gateway-uninstall
dsh plugin --profile web remove dsh-auth-gateway
- 支持从 GitHub / 本地目录安装,见 docs/zh/INSTALL.md;
- 忘记密码用
dsh-auth-gateway-reset重置(重启后控制台打印新初始密码); - 部署指南:docs/zh/DEPLOYMENT.md
功能特性
- 密码认证:首次部署自动生成初始密码(控制台打印,一次性),登录后引导设置个人密码(scrypt 哈希存储),之后每次访问需登录;
- 双因素认证(TOTP):可选启用,兼容 Google Authenticator、Authy、1Password 等主流认证器;含一次性备份代码(scrypt 哈希存储、单次使用),设备丢失时可恢复访问;OTP 密钥以 AES-256-GCM 加密存储(主密钥来自环境变量
DSH_AUTH_GATEWAY_MASTER_KEY或自动生成的auth-gateway/otp-master.key),磁盘泄露不再直接暴露第二因素根密钥; - 真实请求拦截:未认证
/api/*返回 401、页面类路径 302 到登录页、WebSocket 升级直接拒绝;认证通过后请求透明转发(Host/Origin 规范化,兼容内部 trust fence); - 登录审计:登录成功 / 失败 / 登出 / 改密与暴力破解告警(锁定/限流)均输出审计日志(
ctx.logger.info/warn,含来源 IP 与失败原因,不记录任何凭据),并持久化落盘$DSH_HOME/auth-gateway/log/audit.log(JSONL,按天轮转、保留 90 天),形成完整可审计闭环; - 多层防爆破:密码失败按来源锁定(默认 5 次/5 分钟)+ 全局速率限制(默认 60 次/分钟)+ OTP/备份码独立限流(默认 10 次/分钟),scrypt 在 libuv 线程池异步执行,登录洪峰不阻塞事件循环;
- 会话管理:内存 256-bit token(30 天),HttpOnly + SameSite=Strict Cookie,修改密码/禁用 OTP 吊销全部会话;
- 合规形态:host-only 插件(零构建、零运行时依赖)+ 可选 client 半(设置面板,源码构建),主体全部经 dsh 官方扩展点(
ctx.effect、webServer.tapIndex、ctx.slots);唯有一项记录在案的安全例外——LAN trust(为域名/反代访问下模型设置页可用而对 connection 注册做最小介入,见 TROUBLESHOOTING §1)。
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
toby-bridges/api-relay-audit
saya-ch/dsh-mobile
liguobao/ds-harness-remote
wenbin-wb/dsh-bridge
summer1238/dsh-remote-web-gateway
sorsama/deepseek-harness-mobile
Blank-not-black/dsh-Remote
PlutoKeating/dsh-lark-bot