refactor: replace hardcoded DNS config filename with constant reference (#5280)

* refactor: replace hardcoded DNS config filename with constant reference

* refactor: remove redundant import of constants in IClashTemp template method

* refactor: add conditional compilation for DEFAULT_REDIR based on OS

* refactor: simplify default TPROXY port handling and remove unused trace_err macro

* refactor: simplify default TPROXY port fallback logic
This commit is contained in:
Tunglies
2025-11-01 22:50:19 +08:00
committed by GitHub
parent c0f9920531
commit 4a7859bdae
9 changed files with 22 additions and 59 deletions
+2 -1
View File
@@ -3,6 +3,7 @@
use crate::utils::logging::NoModuleFilter;
use crate::{
config::*,
constants,
core::handle,
logging,
process::AsyncHandler,
@@ -304,7 +305,7 @@ async fn init_dns_config() -> Result<()> {
// 检查DNS配置文件是否存在
let app_dir = dirs::app_home_dir()?;
let dns_path = app_dir.join("dns_config.yaml");
let dns_path = app_dir.join(constants::files::DNS_CONFIG);
if !dns_path.exists() {
logging!(info, Type::Setup, "Creating default DNS config file");