Files

42 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

# Changelog — 2026-06-11 推送默认目标 /www/wwwroot(未设路径 UI 不变)
## 摘要
未配置 `target_path` 的服务器,推送/预览/诊断回退目录由 `/tmp/sync` 改为 `/www/wwwroot`(宝塔站点根)。**「未设路径」**筛选与面板逻辑不变(仍为空或精确 `/www/wwwroot`)。
## 动机
- 非 root 子机普遍无 `/tmp/sync`,导致 44 台验证失败
- 运维确认:`/www/wwwroot` 可作为推送目标,与「未设路径」管理状态不冲突
## 变更
| 文件 | 说明 |
|------|------|
| `server/utils/posix_paths.py` | `DEFAULT_PUSH_TARGET_PATH``resolve_push_target_path()` |
| `server/application/services/sync_engine_v2.py` | 推送/预览使用 resolve |
| `scripts/verify_push_elevation.py` | 同上 |
| `scripts/batch_detect_target_path.py` | 批量 detect-path`--unset-only` |
| `tests/test_posix_paths.py` | 回退与 unset UI 分离单测 |
## 行为说明
| `target_path` | 未设路径 UI | 实际推送目标 |
|---------------|-------------|--------------|
| 空 | 是 | `/www/wwwroot` |
| `/www/wwwroot` | 是 | `/www/wwwroot` |
| `/www/wwwroot/site` | 否 | `/www/wwwroot/site` |
推送页填写目标路径仍覆盖全部选中机。
## 迁移 / 重启
需重启 API / 重建 Docker 镜像。无 DB 迁移。
## 验证
```bash
pytest tests/test_posix_paths.py -q
bash scripts/batch_detect_target_path.sh --unset-only --dry-run
```