mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
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:
@@ -6,6 +6,7 @@ pub mod seq;
|
||||
mod tun;
|
||||
|
||||
use self::{chain::*, field::*, merge::*, script::*, seq::*, tun::*};
|
||||
use crate::constants;
|
||||
use crate::utils::dirs;
|
||||
use crate::{config::Config, utils::tmpl};
|
||||
use crate::{logging, utils::logging::Type};
|
||||
@@ -442,7 +443,7 @@ fn apply_builtin_scripts(
|
||||
|
||||
async fn apply_dns_settings(mut config: Mapping, enable_dns_settings: bool) -> Mapping {
|
||||
if enable_dns_settings && let Ok(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()
|
||||
&& let Ok(dns_yaml) = fs::read_to_string(&dns_path).await
|
||||
|
||||
Reference in New Issue
Block a user