29 lines
1014 B
Markdown
29 lines
1014 B
Markdown
|
|
# 2026-06-06 — 安装向导步骤 3 账号密码预检
|
||
|
|
|
||
|
|
## 摘要
|
||
|
|
|
||
|
|
步骤 3 新增「检测 MySQL / Redis 连接」按钮;`init-db` 在写 `.env` 前强制校验账号密码,避免 TCP 通但 Redis/MySQL 认证失败仍进入步骤 4。
|
||
|
|
|
||
|
|
## 动机
|
||
|
|
|
||
|
|
用户反馈步骤 3 仅 TCP 检测,Redis 密码错误仍初始化成功,步骤 4 才失败且无法重回步骤 3。
|
||
|
|
|
||
|
|
## 涉及文件
|
||
|
|
|
||
|
|
- `server/api/install.py` — `POST /api/install/test-credentials`、`_credential_checks`、`init-db` 前置校验
|
||
|
|
- `web/app/install.html` — 步骤 3 检测 UI,未通过禁用「初始化数据库」
|
||
|
|
- `tests/test_security_unit.py` — 新端点单测
|
||
|
|
|
||
|
|
## 验证
|
||
|
|
|
||
|
|
```bash
|
||
|
|
.venv/bin/pytest tests/test_security_unit.py -k install_test_credentials -q
|
||
|
|
bash deploy/sync-install-wizard-to-container.sh
|
||
|
|
```
|
||
|
|
|
||
|
|
向导步骤 3:错误 Redis 密码 → 检测失败;修正后检测通过 → 可初始化。
|
||
|
|
|
||
|
|
## 迁移 / 重启
|
||
|
|
|
||
|
|
无 DB 迁移。部署后 `sync-install-wizard-to-container.sh` 或 `nx update --no-cache`。
|