Enhancements

Fix base sing-box configuration.
Add support for adding Clash modes to sing-box configs.
Optimize codes.
This commit is contained in:
Tindy X committed 2023-11-10 18:23:43 +08:00
1 parent 8b45e06d0d
commit 51b65ec437
9 files changed
+306 -98

No files matched your search

+4 -1
View File
@@ -376,6 +376,7 @@ void readYAMLConf(YAML::Node &node)
section["append_sub_userinfo"] >> global.appendUserinfo;
section["clash_use_new_field_name"] >> global.clashUseNewField;
section["clash_proxies_style"] >> global.clashProxiesStyle;
section["singbox_add_clash_modes"] >> global.singBoxAddClashModes;
}
if(section["rename_node"].IsSequence())
@@ -634,7 +635,8 @@ void readTOMLConf(toml::value &root)
"filter_deprecated_nodes", global.filterDeprecated,
"append_sub_userinfo", global.appendUserinfo,
"clash_use_new_field_name", global.clashUseNewField,
"clash_proxies_style", global.clashProxiesStyle
"clash_proxies_style", global.clashProxiesStyle,
"singbox_add_clash_modes", global.singBoxAddClashModes
);
auto renameconfs = toml::find_or<std::vector<toml::value>>(section_node_pref, "rename_node", {});
@@ -878,6 +880,7 @@ void readConf()
ini.get_bool_if_exist("append_sub_userinfo", global.appendUserinfo);
ini.get_bool_if_exist("clash_use_new_field_name", global.clashUseNewField);
ini.get_if_exist("clash_proxies_style", global.clashProxiesStyle);
ini.get_bool_if_exist("singbox_add_clash_modes", global.singBoxAddClashModes);
if(ini.item_prefix_exist("rename_node"))
{
ini.get_all("rename_node", tempArray);
+1 -1
View File
@@ -46,7 +46,7 @@ struct Settings
bool addEmoji = false, removeEmoji = false, appendType = false, filterDeprecated = true;
tribool UDPFlag, TFOFlag, skipCertVerify, TLS13Flag, enableInsert;
bool enableSort = false, updateStrict = false;
bool clashUseNewField = false;
bool clashUseNewField = false, singBoxAddClashModes = true;
std::string clashProxiesStyle = "flow";
std::string proxyConfig, proxyRuleset, proxySubscription;
int updateInterval = 0;