taichuy/deepseek-harness-auth ↗★ 0
deepseek-harness-auth
Fail-closed password authentication proxy bundle for the DeepSeek Harness Web profile
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:taichuy/deepseek-harness-auth说明文档
阅读完整 README ↗deepseek-harness-auth
DeepSeek Harness Web profile 的树外认证 Bundle。在不修改 Harness 主仓库的条件下,它将原 WebServer 固定到 127.0.0.1 随机端口,并在同一进程中启动唯一的公共认证代理;HTTP、SPA 静态文件、RPC、SSE 与 WebSocket upgrade 只有通过认证后才会转发到 Harness。
安全模型
Browser -> public Auth Proxy -> authenticated -> 127.0.0.1: Harness WebServer
- 未初始化账号时公共代理保持 fail-closed,不生成默认账号或随机密码。
- 默认白名单为空,因此本机和远程地址都必须登录;可用 CLI 添加 IP 或 CIDR。
- 密码使用 Node.js
scrypt保存,状态目录权限为0700,状态文件为0600。 - 默认连续失败 6 次锁定 30 秒,同时按“IP + 用户名”和全局 IP 计数。
- 支持关闭验证码、始终验证、失败后验证;验证码短期有效且只能使用一次。
- 浏览器仅持有 HttpOnly、SameSite=Strict 的随机会话 token;账号、密码或白名单修改会撤销旧会话。
- 代理只接受 loopback Harness 上游,并把通过认证的上游 Host 与 Origin 改写为 loopback authority,使 Harness 的本机敏感 RPC 在认证后可用。
- HTTP 与 HTTPS 都可以使用。插件不会强制 TLS;
secureCookie由部署者选择。
当前兼容基线为 DeepSeek Harness 0.1.x(@deepseek-ai/dsh-host-webserver >=0.1.0-rc.2)。旧 0.0.x WebServer 使用不同的服务名,不在支持范围内。
安装
发布到 npm 后:
dsh plugin --profile web add deepseek-harness-auth
dsh plugin --profile web exec dsh-auth
dsh web
从 GitHub 安装源码版本时,pnpm 10 会要求显式允许依赖的 prepare 构建脚本。按照 dsh plugin 输出,把 deepseek-harness-auth: true 加入 Web profile 的 pnpm-workspace.yaml#allowBuilds,然后重新执行:
dsh plugin --profile web add github:taichuy/deepseek-harness-auth#
首次启动前运行 dsh-auth 初始化账号。密码不会显示在命令行参数或 shell history 中。
本机管理 CLI
无参数启动类似 xp 的交互菜单:
dsh plugin --profile web exec dsh-auth
也可使用子命令:
dsh plugin --profile web exec dsh-auth status
dsh plugin --profile web exec dsh-auth init
dsh plugin --profile web exec dsh-auth whitelist list
dsh plugin --profile web exec dsh-auth whitelist add localhost
dsh plugin --profile web exec dsh-auth whitelist add 192.168.1.0/24
dsh plugin --profile web exec dsh-auth whitelist remove 192.168.1.0/24
dsh plugin --profile web exec dsh-auth whitelist clear
dsh plugin --profile web exec dsh-auth revoke