TiantianFlow/dsh-tailscale-gateway

插件Plugin ⭐ 11 MIT securitysocial

Give selected Tailnet users private browser access to a local DeepSeek Harness (DSH) Web UI—without exposing DSH on your LAN or the public Internet. This small, dependency-free DSH Web-profile bundle keeps DSH and the gateway on loopback, then uses Tailscale Serve

catalog 简介 / catalog descriptioncatalog description:Private Tailscale access for DeepSeek Harness Web: exact user allowlists, loopback-only gateway, and guarded Serve setup

编辑导读Editor's Brief

## 核心特性
- 该插件将远程 DSH Web 访问限制为 trustedLogins 中列出的精确 Tailscale 用户登录名,其他 Tailnet 用户会收到 403 响应。
- 它将网关监听器固定为 127.0.0.1:3088,且仅转发到本地 DSH 源站 127.0.0.1:3080,避免使用局域网或公网监听器。
- 它通过 Tailscale Serve 代理 DSH UI、HTTP API 和 WebSocket 事件流,并将其作为唯一远程入口。
- 引导式设置会在确认后写入一个已启用的 Web-profile 条目,将节点所有者推断为第一个受信任登录名,并选择一个可用的 HTTPS 端口。
- ensure 模式仅会在缺失时创建指向回环网关的私有根路由,对其进行校验,拒绝冲突,并且从不使用 Funnel、reset 或 off。

## 使用场景
- 与选定的 Tailscale 身份共享本地 DSH Web 实例,而不是允许每个能访问 Tailnet 节点的设备。
- 通过 HTTPS 远程访问本地 DSH Web UI,而不在本地网络中暴露 3080 或 3088 端口。
- 在 DSH 前添加身份感知边界,同时将可选的 Tailnet ACL 或 grant 规则保留为独立的网络可达性控制。

## 技术细节
- 该 bundle 是一个面向 Node.js 20 或更高版本的 DSH Web-profile 插件,并通过 dsh plugin --profile web add -w 安装到 pnpm workspace 根目录。
- 对于非安全请求、API 请求和 WebSocket 升级,该网关要求必须恰好有一个由 Tailscale 注入的 Tailscale-User-Login 头,以及预期的外部 Host 和预期的外部 Origin
- 在转发前,它会移除浏览器凭据、客户端提供的代理头和 Tailscale 头,以及逐跳头,然后将上游 HostOrigin 重写为回环值。
- 配置接受 publicOrigintrustedLogins 和可选的 tailscaleServe,同时拒绝 listener、upstream、TLS、OAuth、secret 和未知键。

## 注意事项
- 仅安装插件不会启动监听器或更改 Tailscale,生成的配置只有在用户自己的 DSH Web 进程重启后才会生效。
- 标签设备和 Funnel 流量不会提供可用的用户登录身份,因此会被网关拒绝。
- 移除插件不会自动移除持久化的 Tailscale Serve 路由,包括由 ensure 创建的路由。

## Core Features
- The plugin restricts remote DSH Web access to exact Tailscale user logins listed in trustedLogins, while other Tailnet users receive a 403 response.
- It keeps the gateway listener fixed to 127.0.0.1:3088 and forwards only to the local DSH origin at 127.0.0.1:3080, avoiding LAN or public listeners.
- It proxies the DSH UI, HTTP API, and WebSocket event streams through Tailscale Serve as the only remote ingress.
- Guided setup writes an enabled Web-profile entry after confirmation, infers the node owner as the first trusted login, and selects an available HTTPS port.
- The ensure mode creates only an absent private root route to the loopback gateway, verifies it, refuses conflicts, and never uses Funnel, reset, or off.

## Use Cases
- Share a local DSH Web instance with selected Tailscale identities instead of every device that can reach the Tailnet node.
- Access a local DSH Web UI remotely through HTTPS without exposing port 3080 or port 3088 on the local network.
- Add an identity-aware boundary in front of DSH while keeping optional Tailnet ACL or grant rules as separate network-reachability controls.

## Technical Details
- The bundle is a DSH Web-profile plugin intended for Node.js 20 or later and is installed into a pnpm workspace root with dsh plugin --profile web add -w.
- The gateway requires exactly one Tailscale-injected Tailscale-User-Login header, the expected external Host, and the expected external Origin for unsafe requests, API requests, and WebSocket upgrades.
- Before forwarding, it strips browser credentials, client-provided proxy and Tailscale headers, and hop-by-hop headers, then rewrites upstream Host and Origin to loopback values.
- Configuration accepts publicOrigin, trustedLogins, and optional tailscaleServe, while listener, upstream, TLS, OAuth, secret, and unknown keys are rejected.

## Notes
- Installation alone does not start a listener or change Tailscale, and the generated configuration becomes active only after the user-owned DSH Web process is restarted.
- Tagged devices and Funnel traffic do not provide a usable user-login identity and are rejected by the gateway.
- Removing the plugin does not automatically remove a persistent Tailscale Serve route, including a route created by ensure.

安装Install

dsh plugin --profile web add -w dsh-tailscale-gateway

TiantianFlow/dsh-tailscale-gateway 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

上一个 Prev dsh-codex-auth 下一个 Next dsh-prompt-persona