From 40db4bd8fe728750182a8da49b1a683c258b0c1e Mon Sep 17 00:00:00 2001 From: "@Toperlock" <861705708@qq.com> Date: Tue, 2 Apr 2024 11:35:03 +0800 Subject: [PATCH] fix config template --- config_template/config_template_groups_rule_set_tun.json | 9 ++------- .../config_template_groups_rule_set_tun_fakeip.json | 9 ++------- main.py | 6 +++--- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/config_template/config_template_groups_rule_set_tun.json b/config_template/config_template_groups_rule_set_tun.json index 82143a7df..952bb6bcc 100644 --- a/config_template/config_template_groups_rule_set_tun.json +++ b/config_template/config_template_groups_rule_set_tun.json @@ -96,13 +96,8 @@ "type":"selector", "outbounds":[ "auto", - "HongKong", - "TaiWan", - "Singapore", - "Japan", - "America", - "Others", - "direct" + "direct", + "{all}" ] }, { diff --git a/config_template/config_template_groups_rule_set_tun_fakeip.json b/config_template/config_template_groups_rule_set_tun_fakeip.json index 95025b83d..687876a2a 100644 --- a/config_template/config_template_groups_rule_set_tun_fakeip.json +++ b/config_template/config_template_groups_rule_set_tun_fakeip.json @@ -113,13 +113,8 @@ "type":"selector", "outbounds":[ "auto", - "HongKong", - "TaiWan", - "Singapore", - "Japan", - "America", - "Others", - "direct" + "direct", + "{all}" ] }, { diff --git a/main.py b/main.py index db16fbe04..a7ad29682 100644 --- a/main.py +++ b/main.py @@ -423,7 +423,7 @@ def combin_to_config(config, data): i += 1 for out in config_outbounds: if out.get("outbounds"): - if out['tag'] == 'proxy': + if out['tag'] == 'Proxy': out["outbounds"] = [out["outbounds"]] if isinstance(out["outbounds"], str) else out["outbounds"] if '{all}' in out["outbounds"]: index_of_all = out["outbounds"].index('{all}') @@ -436,7 +436,7 @@ def combin_to_config(config, data): else: for out in config_outbounds: if out.get("outbounds"): - if out['tag'] == 'proxy': + if out['tag'] == 'Proxy': out["outbounds"] = [out["outbounds"]] if isinstance(out["outbounds"], str) else out["outbounds"] out["outbounds"].append('{' + group + '}') temp_outbounds = [] @@ -477,7 +477,7 @@ def combin_to_config(config, data): else: t_o.append(oo) if len(t_o) == 0: - t_o.append('direct') + t_o.append('Proxy') print('发现 {} 出站下的节点数量为 0 ,会导致sing-box无法运行,请检查config模板是否正确。'.format( po['tag'])) # print('Sing-Box không chạy được vì không tìm thấy bất kỳ proxy nào trong outbound của {}. Vui lòng kiểm tra xem mẫu cấu hình có đúng không!!'.format(po['tag']))