chore(center): 下线第一代中心机并清除旧公网信息

- 删除 desktop/controlplane(FastAPI 旧中心机)全部代码,历史见 git

- 移除依赖旧中心机模块的两个失效测试

- AGENTS/README/docs 表述改为「已移除/只有内网一套」,去掉旧公网地址与宝塔部署信息

- agent_cli 去掉旧库拦截逻辑,--base 帮助指向内网生产;electron-shell .env.example 默认地址改内网
This commit is contained in:
2026-11-06 15:40:37 +08:00
parent 4bac1248ad
commit 1d66167156
76 changed files with 40 additions and 10922 deletions
+5 -14
View File
@@ -3,8 +3,7 @@
> 对象:内网中心机 `172.30.30.243` 上的**现役服务端**——控制面 `desktop/controlplane-next`(Midway + cool-admin 8 + Art Design Pro)与文件服务器 `desktop/fileserver`(FastAPI)。
> 用途:改完服务端代码后按本文部署,无需重新勘察。
> 最后更新:2026-10-31(依据 2026-10-22 实际部署记录 + 当前代码核对)。
> ⚠️ `desktop/controlplane/`(第一代 FastAPI 中心机)已 **DEPRECATED**,仅在存量排查时参考,见文末附录 A。
> 公网 `117.72.191.188`(宝塔)已停更,不再部署。
> ⚠️ 第一代 FastAPI 中心机(原 `desktop/controlplane/`)已于 2026-11 从仓库移除,历史排查看 git 记录。
---
@@ -59,7 +58,7 @@ mysql -h 127.0.0.1 -u <user> -p <db> < schema_prod_intranet.sql
mysql -h 127.0.0.1 -u <user> -p <db> < migrations/20261029_plugin_notes.sql
```
> `schema_prod.sql` 是公网旧库快照(仅历史参考),`schema_cool_tables.sql` 是 cool 框架自带表 DDL。
> `schema_prod.sql` 是旧库快照(仅历史参考),`schema_cool_tables.sql` 是 cool 框架自带表 DDL。
### 2. 后端构建与上传
@@ -174,7 +173,7 @@ curl -s http://127.0.0.1:8802/
* 常用子命令:`publish` / `grant` / `revoke` / `plugins` / `plugin-status` / `users` / `user-add` / `user-reset-pwd` / `shell-release` / `file push` / `file list` / `file rm` / `stats` / `ping` / `me`。
* 鉴权:`--admin <账号> --password <密码>`(换 1 小时管理票据),或中心机本机用 `.admin_secret` HMAC 自签。
> ⚠️ 内网 8800 与公网 117.72.191.188:8800 是**两套不同步的库**。发到公网库的症状:执行机永远"已是最新版本"。详见 [插件发版规范](../插件/发版规范.md)。
> ⚠️ 控制面只有内网 `172.30.30.243:8800` 一套(执行机唯一连接源),发版/授权/登记一律指向它。详见 [插件发版规范](../插件/发版规范.md)。
---
@@ -184,17 +183,9 @@ curl -s http://127.0.0.1:8802/
|---|---|
| 所有请求 500 | `server/public` 空目录缺失 → `mkdir -p` 后重启 |
| 启动报 typescript 缺失 | 安装时用了 `--omit=dev` → 重新 `npm install --production=false` |
| 执行机拉不到插件 | ①`--base` 发到了公网旧库 ②`CONTROLPLANE_TOKEN` 两端不一致 ③账号未 `grant` |
| 执行机拉不到插件 | ①`--base` 指错地址(应为 `http://172.30.30.243:8800`)②`CONTROLPLANE_TOKEN` 两端不一致 ③账号未 `grant` |
| 壳子检测不到更新 | `file_sources(category='shell')` 未登记或 `url` 指向文件服务器不可达(执行机必须能直连 8802) |
| 前端页面 401/白屏 | nginx `/api` 未反代到 8800;或站点文件权限不足(`www-data` 可读) |
| 文件服务器告警离线 | `37du-fileserver` 未起、`CONTROLPLANE_URL/TOKEN` 配错、或 60s 心跳被防火墙拦截 |
| 钉钉扫码建号失败 | 回调仍登记在公网旧库;内网切换后扫码建号不可用,密码登录不受影响 |
| 钉钉扫码建号失败 | 回调地址未指向内网中心机;此时扫码建号不可用,密码登录不受影响 |
---
## 附录 A:旧 FastAPI 控制面(DEPRECATED,仅历史参考)
* 代码:`desktop/controlplane/`(文件头已标 DEPRECATED),启动 `python -m controlplane.app`(cwd = `desktop/`),端口 8800,MySQL 库 `37du_center`。
* 旧部署(已停更,不再执行):宝塔服务器 `117.72.191.188`,后端 gunicorn `/www/wwwroot/controlplane/controlplane/`,前端静态站 8090 `/www/wwwroot/controlplane-web`,伪静态 `html_117.72.191.188.conf` 反代 `/api`。
* 该库线上仍有数据,但**执行机不再连接**;任何发版、授权、登记都不允许再写这套。
* 旧命令行 `python -m controlplane.tools.agent_cli` 已删除,统一用仓库根 `tools/agent_cli.py`。