Skip to content

Commit

Permalink
fix config template
Browse files Browse the repository at this point in the history
  • Loading branch information
Toperlock committed Apr 2, 2024
1 parent 6202f0e commit 40db4bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
9 changes: 2 additions & 7 deletions config_template/config_template_groups_rule_set_tun.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,8 @@
"type":"selector",
"outbounds":[
"auto",
"HongKong",
"TaiWan",
"Singapore",
"Japan",
"America",
"Others",
"direct"
"direct",
"{all}"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,8 @@
"type":"selector",
"outbounds":[
"auto",
"HongKong",
"TaiWan",
"Singapore",
"Japan",
"America",
"Others",
"direct"
"direct",
"{all}"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand 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 = []
Expand Down Expand Up @@ -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']))
Expand Down

1 comment on commit 40db4bd

@Toperlock
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#69

Please sign in to comment.