dsh-remote-auth
DSH remote-access authorization page: one click or QR scan mints the current process's browser-session URL (no more digging tokens out of server logs). Optional authority/subnet fence and 8-char PIN gate. · DSH 远程授权页:点击链接或扫码即可铸造当前进程的浏览器会话,带 Host/网段围栏与 PIN 门禁。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:wentao75/dsh-remote-auth说明文档
阅读完整 README ↗配置
在 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) |
lockAfterFails | 5 | 锁定阈值 |
lockSeconds | 60 | 锁定秒数 |
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,需各自授权一次)。