From 1cd0ab8ad1fa4c5e954dc9a2af3b0e8e88de79b2 Mon Sep 17 00:00:00 2001 From: jianf <2198972886@qq.com> Date: Mon, 17 Aug 2026 11:56:30 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=AE=B0=E5=BD=95=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=AE=A1=E6=9F=A5=E7=BB=93=E6=9E=9C=E4=B8=8E=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9B=E5=BF=BD=E7=95=A5=20.pi/=20?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E4=BB=A3=E7=90=86=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ plan.md | 23 ++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index aaa0053..1a7a137 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ data/ # 编辑器 / 系统 .DS_Store *.log + +# pi agent local state +.pi/ diff --git a/plan.md b/plan.md index 8d84eee..20f3291 100644 --- a/plan.md +++ b/plan.md @@ -21,6 +21,20 @@ - [x] 演示环境:3 本地 × 3 远程多对多全连通(tcp + http 转发实测返回数据) - [x] 后端单元测试:store / render / process / httpapi / install +## 项目现状核对(代码审查记录 2024-08 单 commit c193688) + +- 后端入口 `cmd/webui4frpc/main.go`:flag 解析(-addr/-user/-password/-workdir/-bin)→ 建数据目录 → `store.New` → `process.NewManager`(BinaryPath/AutoRestart/RestartInterval 动态闭包,AutoStartProfiles 启动已启用 worker)→ `httpapi.NewServeMux`(healthz 免认证,其余 Basic Auth)→ SIGINT/SIGTERM 优雅退出(15s 超时 + StopAll) +- 核心数据流:PUT `/api/manager/canvas` → store 全量 upsert/删除 + 事务替换 links → `SyncWorkers` 重启受影响 worker → 每台远程独立 `frpc -c configs/.json` 进程 +- 渲染器当前能力:tcp/udp 用 remotePort,http/https 用 customDomains(默认 `.local`),重名服务自动加端口后缀;transport 段仅有 protocol 字段且从未填充 +- 前端:App.vue 三页手动切换(状态/连接配置/设置),CanvasView/VueFlow 画布 + StatusView 5s 轮询 + SettingsView + +## 已知问题(审查发现,待修复) + +1. **设置保存失效(P0)**:`internal/httpapi/handlers.go` 定义了 `handleSettingsPut`,但 `server.go` 的 `NewServeMux` 只注册了 GET `/api/manager/settings`,**未注册 PUT**。PUT 请求会落入 `handleSettingsGet` 静默返回旧值,SettingsView 保存不生效。 +2. **dev proxy 端口不一致**:`web/vite.config.ts` 的 proxy 指向 `127.0.0.1:17650`,与后端默认监听 `127.0.0.1:7500` 不符,前端 dev 联调需对齐。 +3. **冗余依赖**:`vue-router` 在 package.json 依赖中但未被使用(App.vue 以视图 ref 手动切页,无路由)。 +4. **README 笔误**:架构图写 `cmds/webui4frpc`,实际目录为 `cmd/webui4frpc`。 + ## 里程碑 ### M1 高级传输参数(P0,建议优先) @@ -54,12 +68,19 @@ ### M5 运维与发布 -- [ ] git init + 首次 commit + .gitignore(排除 node_modules/dist) +- [x] git init + 首次 commit + .gitignore(排除 node_modules / web/dist;.pi/ 本地代理状态已忽略) - [ ] 一键构建脚本(web→dist→embed→单二进制) - [ ] GitHub Actions:release 构建(linux/windows/mac) - [ ] 配置导出/导入(备份) - [ ] 日志查看页(worker 日志 tail UI) +## 建议推进顺序 + +1. 修复「设置保存失效」——给 `PUT /api/manager/settings` 补注册(约 10 分钟) +2. 对齐 dev proxy 端口(vite.config.ts → 7500) +3. M1 高级传输参数(store 加列 → render 输出 → 前端折叠表单 → 单测回归) +4. M5 补一键构建脚本 / CI + ## 审查结论摘要(详见 FRPC_FEATURES_AUDIT.md) - 已支持:tcp / http(customDomains)、token 认证、多对多、worker 管理