DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

chansanya /

chansanya/dsh-frp-manager

Verified

DeepSeek Harness plugin: add/remove frp tunnels without restarting frpc

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHubProject homepage
READMESource: main@ecfff72c

dsh-frp-manager

让 DeepSeek Harness 的 AI agent 在不重启 frpc 的前提下动态增删 frp 隧道。远程开发时改隧道配置,不会把自己踢下线。

解决什么问题

典型场景:开发机在内网,通过 frp 把 dsh-web(DeepSeek Harness 的远程控制隧道)暴露到公网,人在外网远程操作 DSH。问题在于——传统做法是"改 frpc 配置 → 停服务重启",重启的瞬间 dsh-web 也断了,远程控制就失联了。

这个插件把"改配置 + 重启"换成 "热重载",增删隧道只改有差异的部分,dsh-web 这类保护隧道全程不断。

功能

  • 3 个 agent 工具:
    • frp_list_tunnels — 列出隧道(配置 + 运行时在线状态)
    • frp_add_tunnel — 新增隧道(秒级生效)
    • frp_remove_tunnel — 删除隧道(受保护名单拦截)
  • 双后端自动探测:
    • store(frpc ≥ 0.68):纯 HTTP API 增删,不碰配置文件
    • file(frpc 0.52 ~ 0.67):行级编辑 frpc.toml + /api/reload 热重载
  • 设置页「FRP 隧道管理」:可视化填配置 + 一键检测现有隧道并填充保护名单
  • 安全:保护名单、写入前备份、失败自动回滚、只增删不原地改

原理

浏览器设置页(client.js)──填配置/检测隧道──▶ Host(index.js)
                                              │
                    ┌─────────────────────────┼─────────────────────────┐
                    ▼                         ▼                          ▼
            frp_list_tunnels          frp_add_tunnel              frp_remove_tunnel
                    │                         │                          │
                    ▼                         ▼                          ▼
            resolveMode() 自动探测:GET /api/store/proxies → 200=store / 404=file
                    │
        ┌───────────┴───────────┐
        ▼ (file 后端)            ▼ (store 后端)
   lib/toml.js 行级编辑       POST/DELETE /api/store/proxies
   frpc.toml + /api/reload        (即时生效,不碰文件)

file 后端的安全流程:备份 .bak → 改 frpc.toml → /api/reload 热重载 → 确认在线状态 → 失败回滚。

前置要求

  • DeepSeek Harness(支持 bundle 的版本)
  • frpc 已开启 webServer(admin API),即 frpc.toml 里有:
    webServer.addr = "127.0.0.1"   # 建议本机回环,别绑 0.0.0.0
    webServer.port = 7400
    webServer.user = "admin"
    webServer.password = "…"
    
  • 想用 store 后端:frpc ≥ 0.68,并在 frpc.toml 加 [store] path = "./db.json"

安装

以下命令中的 web 是 profile 名,按你的实际 profile 替换;dsh 若不在 PATH,用 node <DSH安装目录>/node_modules/@deepseek-ai/dsh/lib/bin.js plugin … 代替。

底层都是 pnpm add,所以 dsh plugin … add <目标> 接受 pnpm 支持的目标: 本地目录、git URL、tarball URL。

方式一:本地目录(开发/试用)

git clone https://github.com/<you>/dsh-frp-manager.git
cd dsh-frp-manager
dsh plugin --profile web add .

或图形界面:Settings → Plugins → Add plugin → 选本地目录。

方式二:GitHub 直装(git URL)

dsh plugin --profile web add github:<you>/dsh-frp-manager
# 指定 tag:
dsh plugin --profile web add github:<you>/dsh-frp-manager#v0.1.0

方式三:GitHub Release 的 .tgz

本地 npm pack 打出 dsh-frp-manager-0.1.0.tgz,上传到 GitHub Release,然后:

dsh plugin --profile web add https://github.com/<you>/dsh-frp-manager/releases/download/v0.1.0/dsh-frp-manager-0.1.0.tgz

说明:方式二/三会把包复制进 profile(非 symlink 链接),依赖解析最干净; 方式一(本地目录)是 symlink 链接,插件已声明 peerDependencies 配合 DSH 的 链接包解析,同样可用。

配置

安装后,打开 Settings → FRP 隧道管理,填写:

字段 说明
mode auto(推荐)/ store / file
frpcAdminUrl frpc admin API 地址,如 http://127.0.0.1:7400
adminUser / adminPassword 对应 webServer.user / webServer.password
frpcConfigPath 仅 file 后端;填 Windows 路径,如 E:\tools\frp\frpc.toml
protectedNames 禁止删除/覆盖的隧道名,逗号分隔

可点 「检测现有隧道并填充保护名单」 按钮,用当前填的地址/账号去连 frpc,自动把现有隧道填进保护名单,再按需删减后保存。

使用

配置好后,直接在对话里对 agent 说人话:

列出 frp 隧道
加一条 5173 端口的 http 预览隧道,子域名 preview
删掉 preview 隧道

WSL / Windows 说明

frpc 跑在 Windows 宿主机、开发服务跑在 WSL 时:

  • frpcConfigPath 填 Windows 路径,插件在 WSL 里自动转成 /mnt/e/...;
  • frpcAdminUrl 从 WSL 访问 Windows 的 7400,需要:
    • 开 .wslconfig 的 networkingMode=mirrored → 用 127.0.0.1;或
    • 保持 NAT → 用宿主机网关 IP(如 http://172.31.16.1:7400)。

纯 Windows 环境直接用 127.0.0.1,无需任何转换。

安全

  • 保护名单:默认 dsh-web/rdp-tcp/magpie 不可删除,防止误删控制隧道;
  • 热重载不重启:只应用差异,未修改的隧道不断;
  • 备份 + 回滚:写文件前存 .bak,reload 失败自动还原;
  • 只增删、不原地改:frp 的 reload 行为是"新增/删除块不断旧连接,原地改会断",插件只做增删。

文档

在线文档(由 VuePress 生成):https://chansanya.github.io/dsh-frp-manager/

本地预览:

npm --prefix docs install
npm --prefix docs run docs:dev

License

MIT

—/ 5

No ratings yet

Verified DSH bundle

Commit ecfff72c0a34

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