refactor: clash-verge-rev-service-ipc (#4841)
* feat: update service installation scripts and IPC integration - Updated `Cargo.toml` to use version 2.0.8 of `clash_verge_service_ipc` with "client" feature. - Renamed service installation and uninstallation scripts in `post-install.sh` and `pre-remove.sh`. - Removed `service_ipc` module and refactored IPC handling in `service.rs` to use the new `clash_verge_service_ipc` directly. - Adjusted service version checking and core management to align with the new IPC structure. - Simplified directory checks in `dirs.rs` and updated logging configurations in `init.rs`. - Updated Linux configuration file to reflect new script names. - Enhanced service installer hook to manage state more effectively. * refactor: simplify ClashConfig instantiation and remove unused service log file function * feat: update clash_verge_service_ipc to version 2.0.9 and enhance service initialization logging * chore: update clash_verge_service_ipc to version 2.0.10 and refactor async service manager initialization * fix: update clash_verge_service_ipc to version 2.0.11 and improve service manager initialization * fix: increase sleep duration for socket readiness check to improve stability * fix: update clash_verge_service_ipc to version 2.0.12 and kode-bridge to version 0.3.4; refactor service management and IPC path checks * fix: update clash_verge_service_ipc to version 2.0.13; refactor service connection and initialization logic
This commit is contained in:
@@ -144,21 +144,6 @@ pub fn service_path() -> Result<PathBuf> {
|
||||
Ok(res_dir.join("clash-verge-service.exe"))
|
||||
}
|
||||
|
||||
// TODO 迁移 Service日志后删除
|
||||
pub fn service_log_file() -> Result<PathBuf> {
|
||||
use chrono::Local;
|
||||
|
||||
let log_dir = app_logs_dir()?.join("service");
|
||||
|
||||
let local_time = Local::now().format("%Y-%m-%d-%H%M").to_string();
|
||||
let log_file = format!("{local_time}.log");
|
||||
let log_file = log_dir.join(log_file);
|
||||
|
||||
let _ = std::fs::create_dir_all(&log_dir);
|
||||
|
||||
Ok(log_file)
|
||||
}
|
||||
|
||||
pub fn sidecar_log_dir() -> Result<PathBuf> {
|
||||
let log_dir = app_logs_dir()?.join("sidecar");
|
||||
let _ = std::fs::create_dir_all(&log_dir);
|
||||
@@ -207,7 +192,7 @@ pub fn get_encryption_key() -> Result<Vec<u8>> {
|
||||
|
||||
#[cfg(unix)]
|
||||
pub fn ensure_mihomo_safe_dir() -> Option<PathBuf> {
|
||||
["/var/tmp", "/tmp"]
|
||||
["/tmp"]
|
||||
.iter()
|
||||
.map(PathBuf::from)
|
||||
.find(|path| path.exists())
|
||||
|
||||
Reference in New Issue
Block a user