docs(btpanel): 部署审计与 changelog

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
r
2026-06-21 09:16:54 +08:00
parent 82426b1941
commit d00294c86d
2 changed files with 108 additions and 0 deletions
@@ -0,0 +1,78 @@
# 审计 — 2026-06-21 宝塔 SSH 自动获取 API 部署
**Changelog**: `docs/changelog/2026-06-20-btpanel-ssh-api-bootstrap.md`
**Commit**: `82426b19` feat(btpanel): 独立宝塔模块与 SSH 自动获取 API
## Step 3 规则扫描
| 文件 | 规则 | 结论 |
|------|------|------|
| `ssh_bootstrap.py` | 无静默吞错、远程 JSON 校验 | PASS |
| `bootstrap_state.py` | 仅已入库服务器进 loop | PASS |
| `btpanel_service.py` | CUD 审计 `bt_panel_ssh_bootstrap` | PASS |
| `BtPanelSettingsPage.vue` | 批量操作二次确认 | PASS |
| `bootstrap_lock.py` | 同机并发 SSH 互斥 | PASS |
## Closure
| 项 | 状态 | 说明 |
|----|------|------|
| 后台 loop 误扫全库 | FIXED | `is_eligible` 需显式 `bt_panel` 块 |
| `result.success` SSH | FIXED | 改用 `status == success` |
| Permission denied 误判 | FIXED | 区分 SSH 认证与 api.json 写权限 |
| 空凭据标 ready | FIXED | `bootstrap_empty_credentials` |
| get_config 每次 SSH | FIXED | pending/installing 或 refresh 才探测 |
## 文件清单
- `frontend/src/App.vue`
- `frontend/src/api/btpanel.ts`
- `frontend/src/components/btpanel/BtPanelPageShell.vue`
- `frontend/src/components/btpanel/BtPanelServerPicker.vue`
- `frontend/src/composables/btpanel/btPanelContext.ts`
- `frontend/src/composables/btpanel/useBtPanelPageLoad.ts`
- `frontend/src/composables/btpanel/useBtPanelServer.ts`
- `frontend/src/constants/cachedPages.ts`
- `frontend/src/pages/btpanel/BtPanelCrontabPage.vue`
- `frontend/src/pages/btpanel/BtPanelDatabasesPage.vue`
- `frontend/src/pages/btpanel/BtPanelDomainsPage.vue`
- `frontend/src/pages/btpanel/BtPanelLoginPage.vue`
- `frontend/src/pages/btpanel/BtPanelMonitorPage.vue`
- `frontend/src/pages/btpanel/BtPanelServicesPage.vue`
- `frontend/src/pages/btpanel/BtPanelSettingsPage.vue`
- `frontend/src/pages/btpanel/BtPanelSiteCreatePage.vue`
- `frontend/src/pages/btpanel/BtPanelSitesPage.vue`
- `frontend/src/pages/btpanel/BtPanelSslPage.vue`
- `frontend/src/router/index.ts`
- `server/api/btpanel.py`
- `server/api/btpanel_schemas.py`
- `server/api/servers.py`
- `server/application/services/btpanel_bootstrap_schedule.py`
- `server/application/services/btpanel_service.py`
- `server/application/services/server_batch_service.py`
- `server/background/bt_panel_bootstrap_loop.py`
- `server/config.py`
- `server/infrastructure/btpanel/__init__.py`
- `server/infrastructure/btpanel/bootstrap_lock.py`
- `server/infrastructure/btpanel/bootstrap_state.py`
- `server/infrastructure/btpanel/client.py`
- `server/infrastructure/btpanel/credentials.py`
- `server/infrastructure/btpanel/source_ip.py`
- `server/infrastructure/btpanel/ssh_bootstrap.py`
- `server/infrastructure/btpanel/ssh_login.py`
- `server/infrastructure/ssh/remote_shell.py`
- `server/main.py`
- `tests/test_btpanel_bootstrap_loop.py`
- `tests/test_btpanel_client.py`
- `tests/test_btpanel_get_config.py`
- `tests/test_btpanel_ssh_bootstrap.py`
- `tests/test_btpanel_ssh_login.py`
## DoD
- [x] Step 3 规则扫描
- [x] Closure 表
- [x] 文件清单与 `git diff HEAD~1..HEAD` 对齐
- [x] `local_verify` 通过
- [x] `tests/test_btpanel_*.py` 25 passed
- [x] 需重启 API 注册 `bt_panel_bootstrap_loop`
@@ -0,0 +1,30 @@
# Changelog — 宝塔模块生产部署(2026-06-21
**日期**2026-06-21
## 摘要
将 commit `82426b19`(独立宝塔模块 + SSH 自动获取 API)部署至生产 `api.synaglobal.vip`
## 变更范围
- 后端:`/api/btpanel/*``bt_panel_bootstrap_loop`300s
- 前端:侧栏「宝塔面板」10 子页 + 连接配置(批量确认、检测缓存)
- 配置:`bt_panel_source_ip``bt_panel_auto_bootstrap_enabled`
## 涉及文件
`docs/audit/2026-06-21-btpanel-ssh-bootstrap.md` 文件清单。
## 迁移 / 重启
- 无 DB 迁移
- **必须**重启 API 容器/进程(primary worker 后台任务)
## 验证
```bash
bash deploy/pre_deploy_check.sh
curl -sS https://api.synaglobal.vip/health
# 登录 → 宝塔面板 → 连接配置 → 立即 SSH 获取 / 批量初始化
```