DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

hsushjk /

hsushjk/dsh-uriauth

Verified

DeepSeek Harness(DSH)插件,给 DSH Web UI 一个固定的免 token 入口

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@81c3fe36

dsh-uriauth

DeepSeek Harness(DSH)插件,给 DSH Web UI 一个固定的免 token 入口,插件装好后处于关闭状态,需在设置里手动开启

为什么需要它

dsh web 的鉴权是「一次性引导凭证 + 长期 cookie」:

  1. 每次启动现生成一个随机 launch token,只打印在日志里:dsh web: http://<host>:<port>/?token=<随机串>
  2. 带着 token 访问一次根路径 /,服务端回 303 + Set-Cookie: dsh-auth-<id>=…; HttpOnly; SameSite=Strict(30 天)
  3. 之后靠 cookie 通行

dsh web 也没有关闭鉴权的开关,遇到这些场景只能回日志里翻 token:

  • 换浏览器、清 cookie、无痕窗口
  • 换端口、换访问地址(cookie 绑定 authority)
  • 另一台机器第一次访问
  • 每隔 30 天 cookie 过期

该插件把「token → cookie」这一步做进服务端进程内:入口每次请求现读当前进程的 token,所以服务重启后入口依然有效,设置一次长期使用

因为入口等价于「把机器交给拿到链接的人」,它默认关闭:装好插件不会监听任何新路径,必须由人在设置页开启,并先读完一段警告再确认

安装

插件安装在 DSH 的 profile 里(下例为 web profile)

# 1) 克隆到 ~/plugins
git clone https://github.com/hsushjk/dsh-uriauth.git ~/plugins/dsh-uriauth

# 2) 装到 profile
cd ~/.dsh/profiles/web
pnpm add file:~/plugins/dsh-uriauth

3)把 dsh-uriauth 追加到 ~/.dsh/profiles/web/package.json 的 dsh.profile.bundles:

{
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-web-app",
        "dsh-uriauth"
      ]
    }
  }
}

4)重启 DSH

使用

设置 → URI 入口 → 开启入口 → 读警告 → 确认开启

配置文件

设置文件 <DSH_HOME>/uri-auth.json:

字段 默认值 说明
enabled false 入口总开关,false 时不注册任何入口路由(路径返回 404),改为 true 需在设置页确认警告,或调用 API 时带 "confirm": true
entry trustme 入口路径名(单段),仅允许字母、数字、.、_、~、-,长度 1–64,api、plugins、assets、connect、favicon.ico、index.html、__uriauth 被保留
mode exchange exchange:token 不进入浏览器地址栏(推荐),redirect:302 到带 token 的 URL(兼容模式,token 会留在访问记录里)
allowCrossSiteNavigation false 允许被浏览器标记为跨站/PWA 启动的导航使用入口

设置页的修改会写回设置文件,删除该文件即回到默认值(包括关闭开关)

安全建议

  • 只在可信网络内使用,若需要暴露到公网,请在前面套一层真正的认证(反代 basic auth、VPN、Cloudflare Access 等)
  • 需要「用户名 + 密码」登录而不是「固定 URL」,请改用认证网关类插件,本插件不提供账号体系

兼容性

  • 依赖 Host 侧的 webServer 与 connection 服务,使用 requestRejection / authenticatedUrl / authorizeIndex 这些既有 API
  • 开发与验证环境:@deepseek-ai/dsh 0.2.1-rc.5、Node 22+
  • 前端半边按 dsh.client 模块格式加载(loader id 必须等于包名 dsh-uriauth),注册一个 settings.section
—/ 5

No ratings yet

Verified DSH bundle

Commit 81c3fe367189

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout