GDWhisper/dsh-web-startup-auth 预览 preview

GDWhisper/dsh-web-startup-auth

插件Plugin ⭐ 7 MIT social

DSH(DeepSeek Harness)远程 Web 启动 + 用户名/密码认证插件。 | DeepSeek Harness Remote‑Web‑Launch Plugin with Username/Password Auth

编辑导读Editor's Brief

## 核心特性
- 该插件替换了原有的 Web 启动限制,使 dsh web 可以绑定到 0.0.0.0,并在非回环网络接口上提供浏览器界面。
- 它提供登录与注册流程,在首次访问时创建管理员账户,并要求后续访问者进行身份验证。
- 已认证会话使用带签名的 dsh_sid Cookie,有效期为 14 天,并启用 HttpOnly 保护和 SameSite=Lax 行为。
- 它保护已注册的 /api/* 路由和第三方 RPC 路由,但 /api/auth/*/login 除外;当没有有效会话时,返回 401 或拒绝握手。
- 它在 DSH 设置面板中添加 Authentication 选项卡,用于退出登录和修改密码。

## 使用场景
- 它支持将 DSH Web 界面暴露到本地网络,同时要求在浏览器访问前输入用户名和密码。
- 它允许全新安装后的首个访问者注册管理员账户,之后其他用户才能登录。
- 它允许运维人员从服务器机器重置遗忘的密码,并使此前签发的所有会话失效。
- 它为已认证用户提供设置面板入口,用于退出登录或修改账户密码。

## 技术细节
- 该软件包以 DSH bundle 形式分发,其 dsh.bundle.patch 声明会在通过 dsh plugin 安装时自动应用 cordis.patch.yml
- 密码使用 Node 内置 crypto.scryptSync 并配合随机盐值存储,会话 Cookie 使用生成的密钥通过 HMAC-SHA256 签名。
- 服务端插件会重写已认证请求的 Host 和 Origin 值,使仅限回环访问的 DSH API、第三方 RPC 通道和 WebSocket 升级能够通过已注册路由。
- 通过 webServer.tapIndex 注入的浏览器端脚本会在模块加载后覆盖前端回环标志,以支持远程 HTTP 客户端上的设置镜像行为。

## 注意事项
- 该插件不提供传输加密,因此除非使用 HTTPS 反向代理,否则明文 HTTP 凭据和流量可能会在网络上被观察到。
- dsh_sid Cookie 无法单独撤销,但修改密码或运行 auth-reset 会轮换会话密钥并使所有会话失效。
- 在首个管理员账户创建之前,任何访问者都可以注册,因此在将服务暴露给不可信网络之前,应先完成初始注册。

## Core Features
- The plugin replaces the original web startup restriction so dsh web can bind to 0.0.0.0 and serve the browser interface on non-loopback network interfaces.
- It provides a login and registration flow that creates an administrator account on first access and requires subsequent visitors to authenticate.
- Authenticated sessions use a signed dsh_sid cookie with a 14-day lifetime, HttpOnly protection, and SameSite=Lax behavior.
- It protects registered /api/* routes and third-party RPC routes except /api/auth/* and /login, returning 401 or refusing handshakes when no valid session is present.
- It adds an Authentication tab to the DSH settings panel for logging out and changing the password.

## Use Cases
- It supports exposing a DSH web interface to a local network while requiring a username and password before browser access.
- It allows a first visitor on a fresh installation to register the administrator account before later users can log in.
- It lets an operator reset a forgotten password from the server machine and invalidate all previously issued sessions.
- It provides a settings-panel path for authenticated users to log out or change the account password.

## Technical Details
- The package is distributed as a DSH bundle whose dsh.bundle.patch declaration applies cordis.patch.yml automatically when installed through dsh plugin.
- Passwords are stored with Node built-in crypto.scryptSync using random salts, and session cookies are signed with HMAC-SHA256 using a generated key.
- The server-side plugin rewrites Host and Origin values for authenticated requests so loopback-only DSH APIs, third-party RPC channels, and WebSocket upgrades can pass through registered routes.
- A browser-side script injected through webServer.tapIndex overrides the frontend loopback flag after module loading to support settings mirror behavior on remote HTTP clients.

## Notes
- The plugin does not provide transport encryption, so plaintext HTTP credentials and traffic can be observed on the network unless an HTTPS reverse proxy is used.
- The dsh_sid cookie cannot be individually revoked, although changing the password or running auth-reset rotates the session key and invalidates all sessions.
- Before the first administrator account is created, any visitor can register, so initial registration should be completed before exposing the service to untrusted networks.

安装Install

dsh plugin --profile web add dsh-web-startup-auth@latest

GDWhisper/dsh-web-startup-auth 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

上一个 Prev dsh_kline 下一个 Next dsh-file-upload