b76295aaec
Co-authored-by: Cursor <cursoragent@cursor.com>
2.6 KiB
2.6 KiB
Changelog: 2026-06-01 全量 Bug 修复
变更摘要
一次性修复交接文件第八节 P0~P3 项及审查发现的认证/数据流问题。
动机
- Vue
ServersPage批量 Agent 操作因 Vuetifyitem-value返回 ID 而非对象导致server_ids无效 - Access Token 30 天与 Refresh Cookie 架构不一致;SPA 未使用
credentials与自动 refresh - Agent 心跳直写 MySQL 与 Redis→10min 刷库设计冲突
- script-callback 缺少
X-API-Key层防护
涉及文件
前端
frontend/src/pages/ServersPage.vuefrontend/src/api/index.tsfrontend/src/stores/auth.tsfrontend/src/router/index.tsfrontend/src/pages/TerminalPage.vuefrontend/src/utils/serverSelection.ts(新)frontend/src/utils/apiError.ts(新)
后端
server/api/agent.pyserver/application/services/auth_service.pyserver/config.pyserver/application/services/script_jobs.pyserver/application/services/script_service.pyserver/domain/models/__init__.pyserver/infrastructure/database/admin_repo.pyserver/infrastructure/database/migrations.pyserver/main.pyserver/api/settings.py(ruff 清理)
测试
tests/test_api.pytests/test_nexus_v6.pytests/test_step1to5_features.py
文档
docs/design/specs/2026-06-01-bug-remediation-design.mddocs/design/plans/2026-06-01-bug-remediation.mddocs/audit/2026-06-01-bug-remediation.md
是否需迁移/重启
- 需要重启 Nexus 后端(认证、Agent、迁移 DROP 列)
- 需要重新构建并部署前端 SPA
- 启动时自动执行
admins表 DROP 废弃列(已存在则跳过)
生产部署记录(2026-06-01)
- Git:
8311821→origin/main - 后端:
supervisorctl restart nexus,/health→ok - 前端: Vite build + tar/scp,
index.html→index-ngtHwr8t.js,ServersPage-Vzm34hgn.js - 浏览器: 登录成功进入仪表盘与服务器列表
- API:
expires_in=3600(60 分钟 access token)
验证方式
ruff check server/
python -c "import server.main"
cd frontend && npm run type-check
pytest tests/test_nexus_v6.py tests/test_step1to5_features.py -q
- 服务器页:勾选多台 → 批量安装 Agent → 提示
N/M 成功 - 登录后刷新页面:HttpOnly refresh 恢复会话(无 localStorage token)
- 未知 server_id 心跳:200
discarded,日志 debug 级 422
未改项说明
- WebSSH JWT 在 URL:仍用 15 分钟专用 token + query(需 WS 协议改造,单独迭代)
- sysctl 命令注入:当前
sync_engine_v2已无 sysctl 拼接路径