DSH Plugins Marketplace

DSH Plugins

Plugins

/

Security & Audit

/

dsh-remote-auth

w

dsh-remote-auth

Manifest valid

DSH remote-access authorization page that shows the current process browser-session URL as a clickable link or QR code, behind an optional authority/subnet allow-list and PIN.

hasBundlePatch

dsh-remote-auth

DSH 远程授权页:点一下链接或扫一下二维码,设备即可获得当前 dsh web 进程的浏览器会话——再也不用翻 ~/.dsh/logs/ 找 token。

One click or one QR scan mints the current process's browser-session URL for DeepSeek Harness (dsh web). No more digging the launch token out of server logs.

license npm version npm downloads

为什么需要它

dsh web 用"每次进程启动随机生成"的 launch token 授权浏览器: 访问 /?token=... 后换取 30 天签名 cookie。本机浏览器启动时自动打开没问题, 但 iPad / iPhone / 其他电脑(经 Tailscale 或家庭 Wi-Fi)要访问时,只能去 服务器日志里翻带 token 的 URL——麻烦且易错。

本插件在 webserver 上挂一个公开路由 GET /mobile-auth:设备打开后输入 PIN (可选),页面给出当前进程、且与访问所用 authority 一致的授权链接 + 二维码;点击/扫码即铸造 cookie。cookie 由持久化签名密钥签发( ~/.dsh/.credentials.yaml),重启 dsh 不会踢掉已授权设备,每 30 天 刷新一次即可。

安装

dsh plugin --profile web add dsh-remote-auth -w
# 重启 dsh web 生效(GUI 会短暂断连后自动恢复):
launchctl kickstart -k gui/501/com.dsh.web        # macOS launchd
# 或直接:dsh --profile web

安装后从任意授权设备打开:

  • 局域网:http://<Mac-name>.local:3080/mobile-auth
  • Tailscale:http://<host>.tailXXXX.ts.net:3080/mobile-auth
  • 本机:http://127.0.0.1:3080/mobile-auth

输入 PIN(若启用)→ 点"在本设备打开授权链接"(或让另一台设备扫二维码)。 PIN 只在服务端 profile 配置里保存与查看,任何页面上都不会显示 PIN。

配置

在 profile 的 cordis.patch.yml 中覆盖行配置:

- id: dsh-remote-auth
  config:
    # Host 头白名单:裸主机名(任意端口)或精确 host:port。回环恒放行。
    allowedAuthorities:
      - myhost
      - myhost.tailXXXX.ts.net
    # 源 IP 网段白名单(CIDR)。回环恒放行。
    allowedSubnets:
      - 100.64.0.0/10      # Tailscale
      - 192.168.0.0/16     # 家庭内网
    # 8 位字母数字 PIN;"" = 关闭 PIN 门禁(不推荐公网使用)。
    pin: ""
    # 当服务位于 TLS 反向代理之后时设为 "https"。
    originProtocol: "http"
字段默认说明
allowedAuthorities[]Host 头名单(bare host 匹配任意端口)
allowedSubnets[]源 IP CIDR 名单
pin""PIN 门禁;连错 5 次锁 60 秒(按源 IP)
lockAfterFails5锁定阈值
lockSeconds60锁定秒数
originProtocol"http"反代启用 TLS 后改为 "https"

访问门禁(安全模型)

OR 语义:Host ∈ allowedAuthorities 或 源 IP ∈ allowedSubnets 即放行;回环恒放行;两表皆空 = 仅回环(fail closed)。因此:

  • 想按"名字"访问 → 写 allowedAuthorities(ts.net 域名 / mDNS 名);
  • 想按"网段"放行(裸 IP 访问、整段 Tailscale/内网)→ 写 allowedSubnets。

/mobile-auth 是 webserver 公开路由(不在 /api cookie 门禁之下),它自己 的围栏 + PIN 就是防线。页面给出的授权 URL 由官方扩展点 ctx.connection.authenticatedUrl(请求origin) 生成——与设备当前使用的 authority 一致,cookie 才能正确落到该 authority(cookie 按 host:port 绑定, LAN IP 与 ts.net 域名是两张独立 cookie,需各自授权一次)。

兼容性

  • 依赖内核扩展点:ctx.webServer.register(dsh-host-webserver)与 ctx.connection.authenticatedUrl(dsh-client-connection)。
  • 已验证内核版本:0.1.2-rc.1、0.1.6-alpha.1(2026-09-17 复检:上述扩展点 与浏览器认证模型均未变化,token 交换 / cookie / 门禁全链路通过)。
  • 升级 dsh 后请运行 docs/VERIFY.md 清单复验。
  • 明文 HTTP 环境(局域网/Tailscale IP)需要 crypto.randomUUID polyfill—— 配合 dsh-web-lan-access 可自动注入(本插件不重复实现)。

开发

npm run check    # 语法自检

第三方代码:lib/qrcode.cjs 为 qrcode-generator (MIT, Kazuhiko Arase) 的 vendored 单文件。勿改成 .js——本包 "type": "module",.js 会被按 ESM 加载导致 UMD 导出成空对象、二维码空白。

License

MIT © 2026 dsh-remote-auth contributors(lib/qrcode.cjs 保留原作者版权头)

Compatibility

DSH 0.2.1-alpha.4: failedDSH 0.2.1-alpha.2: failedDSH 0.2.1-alpha.1: failed

Versions

Latest versionPublishedSize
0.1.1——
0.1.0——

Comments

Loading…

Similar plugins

dsh-lan-pair

LAN-only remote access for DSH: pair a phone or another PC by QR code or token to open the same web UI, with optional key-free access inside the LAN.

Tools & CapabilitiesManifest valid

★ 0

Apache-2.0

JavaScript

dsh plugin --profile web add dsh-lan-pair

by 1032740078

Adds a View URL page to Settings showing the running session tokenized Web address plus a stable fixed address that survives desktop restarts and is reachable from other devices on the same LAN.

Tools & CapabilitiesTerminal & ClientsManifest valid

★ 0

MIT

JavaScript

Sep 13, 2026

dsh plugin --profile web add dsh-web-url-view

by JUANWANG-BUAA

Auditable, token-gated DeepSeek Harness remote gateway: mobile QR access, per-device sessions, Host/Origin rewrite, settings/credentials/directory support.

Security & AuditManifest valid

★ 51

↓ 204/wk

MIT

TypeScript

Oct 24, 2026

dsh plugin --profile web add dsh-full-remote

by flymysql

DSH host-side bridge for the DSH Browser Client extension: a token-authenticated /ext-api RPC proxy + /ext-events.mux WebSocket event stream + bidirectional /ext-api-control channel, so a browser extension page (which cannot pass the same-origin /api trust fence) can drive the harness from a floating panel and operate the current page via page_* tools.

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Sep 21, 2026

dsh plugin --profile web add dsh-browser-host

DSH plugin: password SSH into a remote host — a natural-language tool (connect/exec/close/status) over a persistent ControlMaster session, plus a browser terminal panel (right-side floating) with a real PTY over WebSocket.

Tools & CapabilitiesTerminal & ClientsManifest valid

★ 0

dsh plugin --profile web add dsh-ssh-shell

by kinderao

Phone and remote access to the DSH Web UI: scan a LAN QR code, or reach your PC from anywhere through a self-hosted relay server you run yourself instead of a cloudflared tunnel. Per-device credential

Tools & CapabilitiesManifest valid

★ 4

↓ 121/wk

GPL-2.0

JavaScript

Sep 17, 2026

dsh plugin --profile web add dsh-pocket-relay