Skip to content
Snippets Groups Projects
Unverified Commit bbe2ef4e authored by GyDi's avatar GyDi
Browse files

fix: use full clash config

parent dd154550
No related branches found
No related tags found
No related merge requests found
......@@ -329,7 +329,9 @@ pub async fn activate_profile(
// begin to generate the new profile config
let def_config = config::read_yaml::<Mapping>(file_path.clone());
let mut new_config = Mapping::new();
// use the clash config except 5 keys below
let mut new_config = clash_config.clone();
// Only the following fields are allowed:
// proxies/proxy-providers/proxy-groups/rule-providers/rules
......@@ -348,24 +350,6 @@ pub async fn activate_profile(
}
});
// add some of the clash `config.yaml` config to it
let valid_keys = vec![
"mixed-port",
"log-level",
"allow-lan",
"external-controller",
"secret",
"mode",
"ipv6",
];
valid_keys.iter().for_each(|key| {
let key = Value::String(key.to_string());
if clash_config.contains_key(&key) {
let value = clash_config[&key].clone();
new_config.insert(key, value);
}
});
config::save_yaml(
temp_path.clone(),
&new_config,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment