Runs an embedded tsnet node as a sidecar so the Web GUI is reachable from tailnet devices over a Tailscale-issued TLS certificate, with no local tailscaled install; the plugin registers a connection.authentication provider that accepts only HMAC-signed identity headers from that sidecar and returns the shared owner Peer, with tailnet-wide or per-email allowlist access and automatic trustedHosts and publicUrl updates.
Install
# from npm (prebuilt)
dsh plugin --profile web add @alfredhuang211/dsh-tailscale
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:alfredhuang211/dsh-tailscale
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
dsh-tailscale
用内嵌 tsnet 节点把 DeepSeek Harness 的 Web GUI 接进 tailnet。
手机、平板、另一台电脑打开一个 .ts.net 地址就能用 —— 不用复制令牌,不用在本机安装 tailscaled,不用开端口转发。

目录
为什么用它
接入方式不少,差别在这三点:
| 需要本机装 tailscaled | 需要 root | 手机侧要做什么 | |
|---|---|---|---|
tailscale serve 类方案 |
是 | 否 | 打开链接 |
| 端口转发 / 反代 | 视方案 | 否 | 配地址、可能要开防火墙 |
| 本插件(内嵌 tsnet) | 否 | 否 | 打开链接 |
tsnet 是 Tailscale 官方的 userspace 实现:节点跑在插件自己的进程里,不碰系统网络栈、不装守护进程、不要管理员权限。证书由 Tailscale 签发,所以 HTTPS 是真的,不是自签名。
它是怎么工作的
手机 / 平板
│ HTTPS https://<节点名>.<tailnet>.ts.net/
▼
[sidecar: dsh-tsnet-helper] ← 内嵌 tsnet 节点(userspace,无需 root)
│ 保留 / 改写 Host、校验 Origin、签发身份 HMAC
▼ http://127.0.0.1:<DSH 监听端口>
[DSH Web GUI]
三段职责:
- sidecar(
bin/dsh-tsnet-helper-*)— Go +tailscale.com/tsnet。它自己就是一个 tailnet 节点,用ListenTLS拿 Tailscale 签发的证书,再用WhoIs把远端地址解析成经过 WireGuard 密钥验证的身份,最后把请求反代给 DSH。 - Host 半(
lib/)— 用ctx.subprocess托管 sidecar,从ctx.webServer.getOrigin()读出真实监听地址(Desktop 的端口是随机的,写死会错),把 tailnet 身份换成 owner Peer。 - Client 半(
client.js)— 设置 → Tailscale 面板:看状态、粘 auth key、改节点名与访问规则。
安装
# 从 npm
dsh plugin --profile <profile> add @alfredhuang211/dsh-tailscale
# 或直接从 GitHub
dsh plugin --profile <profile> add github:alfredhuang211/dsh-tailscale
装好重启后,进 设置 → Tailscale 粘贴 auth key(tskey-auth-…),节点会自动入网。
DSH 版本要求:
>=0.2.3-alpha.2 <0.3.0。 更早的版本用的是 cordis~4.1.0,与插件的 peer 范围不兼容,装的时候会报ERESOLVE。
预编译二进制
| 平台 | 文件 | 状态 |
|---|---|---|
| macOS Apple Silicon | bin/dsh-tsnet-helper-darwin-arm64 |
已提供 |
| macOS Intel | bin/dsh-tsnet-helper-darwin-x64 |
已提供(Rosetta 下实测可运行) |
| Windows x64 | bin/dsh-tsnet-helper-windows-x64.exe |
已提供 |
| Linux | — | 未提供;在该平台执行 npm run build:sidecar |
全部为 CGO_ENABLED=0 纯静态构建,Windows 版不需要额外安装 VC++ 运行库。
文件名规则是 dsh-tsnet-helper-<平台>-<arch>,其中 arch 跟随 Node 的 process.arch(即 x64,不是 Go 的 amd64);Windows 版带 .exe。重新生成全部产物:
npm run build:sidecar # 需要 Go 1.27+
首次接入
- tailnet 管理台开启 MagicDNS 与 HTTPS Certificates —— 否则拿不到证书,也不会有
.ts.net名字。 - 生成 auth key:推荐 reusable + pre-authorized,可选 ephemeral;用完之后建议删掉。
- 粘贴到设置页,等状态变「已在线」。
- 手机装 Tailscale、登录同一 tailnet,打开面板上显示的地址。
认证模型(为什么手机不用输令牌)
分两层,缺一不可:
- tailnet 层 — WireGuard 密钥 + ACL 决定「谁能连到这个端口」。
- DSH 层 — 插件在
connection.authentication注册 Provider,只接受 sidecar 用安装级共享密钥(HMAC-SHA256)签过的身份头;命中后返回同一个 owner Peer。
因此:
- 未签名的
Tailscale-User-*一律忽略 —— 本机任意进程伪造这个头拿不到 owner。 - 签名带时间戳,超过 2 分钟即失效,重放无效。
accessMode = tailnet时任何 tailnet 用户可用;allowlist时只认列出的邮箱。- 不要开 Funnel。 它会把服务暴露到公网,届时 ACL 不再是唯一边界。
配置项
| 字段 | 默认 | 说明 |
|---|---|---|
enabled |
true |
接入开关 |
hostname |
dsh |
节点名,最终地址 <name>.<tailnet>.ts.net |
mode |
tls |
tls 用 Tailscale 证书;http 仅供排查 |
port |
443 |
tailnet 监听端口;只有 443 能拿到有效证书 |
tag |
'' |
可选,如 tag:dsh;tag 节点没有用户身份 |
accessMode |
tailnet |
tailnet 或 allowlist |
allowedLogins |
[] |
allowlist 模式下的邮箱 |
allowTagged |
false |
是否接受 tag 设备 |
stateDir |
'' |
tsnet 状态目录,留空 $DSH_HOME/tsnet |
restartOnDrop |
true |
意外退出自动重启(最多 5 次) |
trustedHosts 与 publicUrl
DSH 的来源栅栏只认字面 Host,所以 tailnet 域名必须出现在 connection.trustedHosts 里。插件拿到 FQDN 后会经 configEditor 自动写入这一行,并把 web-runtime.publicUrl 公告成 https://<fqdn>/。
如果当前 profile 没有 configEditor,面板会给出需要手动添加的 authority 文本。
已知限制
- 设置页里由
isLoopback派生的入口,在 tailnet 访问时不可用(页面 authority 不是回环),这是 DSH 的既有语义。 - 入网用的是节点状态目录里的凭据;删掉
$DSH_HOME/tsnet等于退网,需要重新授权。 - 同一
hostname在 tailnet 里只能有一个节点,两份 DSH 用同一名字会互相踢下线。
开发
npm test # 无宿主接线测试(8 个用例)
npm run build:sidecar # 重新编译全部平台 sidecar
npm run release # 产出发布包,并在临时目录里验证能装能跑
发布包就是 npm pack 的产物,可直接安装:
npm install ./alfredhuang211-dsh-tailscale-0.1.3.tgz
# 或装进某个 profile:
dsh plugin --profile <profile> add ./alfredhuang211-dsh-tailscale-0.1.3.tgz
包内含 lib/、bin/(三个平台二进制)、client.js、cordis.patch.yml、locale/、icon.svg、docs/、README.md、LICENSE。sidecar/ 源码与 test/ 不入包,它们随仓库分发。
- 改版本号并提交:
npm version patch --no-git-tag-version npm run release—— 打包 + 干净安装验证- 打 tag 并推送,触发 CI 发布:
git tag v0.1.3 && git push origin v0.1.3
publish.yml 从 tag 触发,走 npm OIDC trusted publishing(不读任何 NPM_TOKEN),发布前会校验 tag 与 package.json 版本一致,并重跑测试。
.github/workflows/test.yml 做两件事:
- 跑测试与
npm pack --dry-run(Node 22 / 24 两个版本)。 - 在
macos-14、macos-13、windows-latest上分别执行对应二进制,断言它在缺失 secret 时返回 1 并输出合法 JSON 事件。二进制是随包产物,「交叉编译通过」不算数。
License
MIT © alfredhuang211
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-remote-web-ui★ 10703
Remote control of a dsh web workspace from phone or PC: QR-code pairing through a token-gated channel, SSE real-time sync, and separate mobile and full desktop GUI modes.
zhu1090093659/dsh-web#packages/dsh-ssh★ 10703
SSH ops panel for DSH: web terminal, SFTP transfer with progress, local port forwarding, and one-command cluster execution across hosts; agents share the same host config.
liguobao/ds-harness-remote★ 4109
Multi-device remote access for DeepSeek Harness and supported coding workspaces through an end-to-end encrypted channel, with adaptive Relay/WebRTC transport, device authorization, workspace files, read-only previews, terminals, and optional Codex Remote.
saya-ch/dsh-mobile★ 1033
Access DeepSeek Harness from the Android app or a mobile browser with secure LAN and remote connections, persistent device pairing, and a customizable mobile interface.
WNLUO/dsh-mobile-plugin★ 536
The DeepSeek Harness app lets you use the DeepSeek Harness on this computer or server from your phone. Phones and tablets both work, on Android and iOS. On your phone you can keep chatting, look at files and manage plugins, and the machine you are using can also connect to DeepSeek Harness on your other machines and open each one separately.
uumit-ai/dsh-uumit-remote★ 534
Open dsh web from your phone or another computer through a UUMit account, without running your own server or installing another program: a built-in tunnel client connects to UUMit's hosted tunnel, and a panel in the sidebar handles pairing and who can use it (only you, people you invite by link or phone number, or everyone), with revocation. Requires dsh web on DSH >=0.2.1-rc.2.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.