docs: 记录代码审查结果与已知问题;忽略 .pi/ 本地代理状态

This commit is contained in:
2026-08-17 11:56:30 +08:00
parent c1936887a2
commit 1cd0ab8ad1
2 changed files with 25 additions and 1 deletions

3
.gitignore vendored
View File

@ -17,3 +17,6 @@ data/
# 编辑器 / 系统
.DS_Store
*.log
# pi agent local state
.pi/

23
plan.md
View File

@ -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/<name>.json` 进程
- 渲染器当前能力tcp/udp 用 remotePorthttp/https 用 customDomains默认 `<name>.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 Actionsrelease 构建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 / httpcustomDomains、token 认证、多对多、worker 管理