fix(cli,config): 修复 sudo 下初始化失败 + daemon 不重载问题 (#37)

* fix(cli,config): 修复 sudo 下初始化失败 + daemon 不重载问题

  - cli/transport: 新增 stop_daemon(),init 后自动停止旧 daemon
  - config: cli_dir() 优先读 SUDO_USER 环境变量,避免写到 /root/.wx-cli
  - config: auto_detect_db_dir() 按 .db 文件最新 mtime 排序,正确选最新目录
  - daemon/server: dispatch 新增 ReloadConfig 命令(预留)
  - ipc: Request 新增 ReloadConfig 变体
  - scanner/linux: 移除调试日志,清理 unused bail import

* fix(config): resolve sudo home via passwd lookup

---------

Co-authored-by: cjliu <cjliu@upointech.com>
Co-authored-by: jackwener <jakevingoo@gmail.com>
This commit is contained in:
刘传佳
2026-05-14 13:50:04 +08:00
committed by GitHub
co-authored by cjliu jackwener
parent 6659f48984
commit d750ef6e9f
6 changed files with 123 additions and 22 deletions
+3
View File
@@ -231,5 +231,8 @@ async fn dispatch(
Err(e) => Response::err(e.to_string()),
}
}
ReloadConfig => {
Response::ok(serde_json::json!({ "reloading": true }))
}
}
}