-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
pref.example.toml
348 lines (270 loc) · 9.05 KB
/
pref.example.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
version = 1
[common]
# API mode, set to true to prevent loading local subscriptions or serving local files directly
api_mode = false
# Access token used for performing critical action through Web interface
api_access_token = "password"
# Default URLs, used when no URL is provided in request, use "|" to separate multiple subscription links, supports local files/URL
default_url = []
# Insert subscription links to requests. Can be used to add node(s) to all exported subscriptions.
enable_insert = true
# URLs to insert before subscription links, can be used to add node(s) to all exported subscriptions, supports local files/URL
insert_url = [""]
# Prepend inserted URLs to subscription links. Nodes in insert_url will be added to groups first with non-group-specific match pattern.
prepend_insert_url = true
# Exclude nodes which remarks match the following patterns. Supports regular expression.
exclude_remarks = ["(到期|剩余流量|时间|官网|产品)"]
# Only include nodes which remarks match the following patterns. Supports regular expression.
#include_remarks = ["V3.*港"]
# Enable script support for filtering nodes
enable_filter = false
# Script used for filtering nodes. Supports inline script and script path. A "filter" function with 1 argument which is a node should be defined in the script.
# Example: Inline script: set value to content of script.
# Script path: set value to "path:/path/to/script.js".
#filter_script = '''
#function filter(node) {
# const info = JSON.parse(node.ProxyInfo);
# if(info.EncryptMethod.includes('chacha20'))
# return true;
# return false;
#}
#'''
# Setting an external config file as default when none is specified, supports local files/URL
# default_external_config = "config/example_external_config.toml"
# The file scope limit of the 'rule_base' options in external configs.
base_path = "base"
# Clash config base used by the generator, supports local files/URL
clash_rule_base = "base/all_base.tpl"
# Surge config base used by the generator, supports local files/URL
surge_rule_base = "base/all_base.tpl"
# Surfboard config base used by the generator, supports local files/URL
surfboard_rule_base = "base/all_base.tpl"
# Mellow config base used by the generator, supports local files/URL
mellow_rule_base = "base/all_base.tpl"
# Quantumult config base used by the generator, supports local files/URL
quan_rule_base = "base/all_base.tpl"
# Quantumult X config base used by the generator, supports local files/URL
quanx_rule_base = "base/all_base.tpl"
# Loon config base used by the generator, supports local files/URL
loon_rule_base = "base/all_base.tpl"
# Shadowsocks Android config base used by the generator, supports local files/URL
sssub_rule_base = "base/all_base.tpl"
# sing-box config base used by the generator, supports local files/URL
singbox_rule_base = "base/all_base.tpl"
# Proxy used to download rulesets or subscriptions, set to NONE or empty to disable it, set to SYSTEM to use system proxy.
# Accept cURL-supported proxies (http:// https:// socks4a:// socks5://)
proxy_config = "SYSTEM"
proxy_ruleset = "SYSTEM"
proxy_subscription = "NONE"
# Append a proxy type string ([SS] [SSR] [VMess]) to node remark.
append_proxy_type = false
# When requesting /sub, reload this config file first.
reload_conf_on_request = false
[[userinfo.stream_rule]]
# Rules to extract stream data from node
# Format: full_match_regex|new_format_regex
# where new_format_regex should be like "total=$1&left=$2&used=$3"
match = '^剩余流量:(.*?)\|总流量:(.*)$'
replace = 'total=$2&left=$1'
[[userinfo.stream_rule]]
match = '^剩余流量:(.*?) (.*)$'
replace = 'total=$1&left=$2'
[[userinfo.stream_rule]]
match = '^Bandwidth: (.*?)/(.*)$'
replace = 'used=$1&total=$2'
[[userinfo.stream_rule]]
match = '^.*剩余(.*?)(?:\s*?)@(?:.*)$'
replace = 'total=$1'
[[userinfo.time_rule]]
# Rules to extract expire time data from node
# Format: full_match_regex|new_format_regex
# where new_format_regex should follow this example: yyyy:mm:dd:hh:mm:ss
match = '^过期时间:(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)$'
replace = '$1:$2:$3:$4:$5:$6'
[[userinfo.time_rule]]
match = '^到期时间:(\d+)-(\d+)-(\d+)$'
replace = '$1:$2:$3:0:0:0'
[[userinfo.time_rule]]
match = '^Smart Access expire: (\d+)/(\d+)/(\d+)$'
replace = '$1:$2:$3:0:0:0'
[node_pref]
#udp_flag = false
#tcp_fast_open_flag = false
#skip_cert_verify_flag = false
#tls13_flag = false
sort_flag = false
# Script used for sorting nodes. A "compare" function with 2 arguments which are the 2 nodes to be compared should be defined in the script. Supports inline script and script path.
# Examples can be seen at the filter_script option in [common] section.
#sort_script = '''
#function compare(node_a, node_b) {
# return info_a.Remark > info_b.Remark;
#}
#'''
filter_deprecated_nodes = false
append_sub_userinfo = true
clash_use_new_field_name = true
# Generate style of the proxies and proxy groups section of Clash subscriptions.
# Supported styles: block, flow, compact
# Block: - name: name1 Flow: - {name: name1, key: value} Compact: [{name: name1, key: value},{name: name2, key: value}]
# key: value - {name: name2, key: value}
# - name: name2
# key: value
clash_proxies_style = "flow"
clash_proxy_groups_style = "block"
# add Clash mode to sing-box rules, and add a GLOBAL group to end of outbounds
singbox_add_clash_modes = true
[[node_pref.rename_node]]
match = '\(?((x|X)?(\d+)(\.?\d+)?)((\s?倍率?)|(x|X))\)?'
replace = "$1x"
[managed_config]
# Append a '#!MANAGED-CONFIG' info to Surge configurations
write_managed_config = true
# Address prefix for MANAGED-CONFIG info, without the trailing "/".
managed_config_prefix = "http://127.0.0.1:25500"
# Managed config update interval in seconds, determine how long the config will be updated.
config_update_interval = 86400
# If config_update_strict is set to true, Surge will require a force update after the interval.
config_update_strict = false
# Device ID to be written to rewrite scripts for some version of Quantumult X
quanx_device_id = ""
[surge_external_proxy]
#surge_ssr_path = "/usr/bin/ssr-local"
resolve_hostname = true
[emojis]
add_emoji = false
remove_old_emoji = true
[[emojis.emoji]]
#match = '(流量|时间|应急)'
#emoji = '🏳️🌈'
import = "snippets/emoji.toml"
# [[custom_groups]]
# name = "Auto"
# type = "url-test"
# rule = [".*"]
# url = "http://www.gstatic.com/generate_204"
# interval = 300
# tolerance = 150
# lazy = true
# [[custom_groups]]
# name = "Proxy"
# type = "select"
# rule = [".*", "[]DIRECT"]
# disable_udp = false
# [[custom_groups]]
# name = "LoadBalance"
# type = "load-balance"
# rule = [".*", "[]Proxy", "[]DIRECT"]
# interval = 100
# strategy = "consistent-hashing"
# url = "http://www.gstatic.com/generate_204"
[[custom_groups]]
import = "snippets/groups.toml"
[ruleset]
# Enable generating rules with rulesets
enabled = true
# Overwrite the existing rules in rule_base
overwrite_original_rules = false
# Perform a ruleset update on request
update_ruleset_on_request = false
# [[rulesets]]
# group = "Proxy"
# ruleset = "https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Unbreak.list"
# type = "surge-ruleset"
# interval = 86400
[[rulesets]]
import = "snippets/rulesets.toml"
[template]
template_path = ""
[[template.globals]]
key = "clash.http_port"
value = "7890"
[[template.globals]]
key = "clash.socks_port"
value = "7891"
[[template.globals]]
key = "clash.allow_lan"
value = "true"
[[template.globals]]
key = "clash.log_level"
value = "info"
[[template.globals]]
key = "clash.external_controller"
value = "127.0.0.1:9090"
[[template.globals]]
key = "singbox.allow_lan"
value = "true"
[[template.globals]]
key = "singbox.mixed_port"
value = "2080"
[[aliases]]
uri = "/clash"
target = "/sub?target=clash"
[[aliases]]
uri = "/clashr"
target = "/sub?target=clashr"
[[aliases]]
uri = "/surge"
target = "/sub?target=surge"
[[aliases]]
uri = "/quan"
target = "/sub?target=quan"
[[aliases]]
uri = "/quanx"
target = "/sub?target=quanx"
[[aliases]]
uri = "/mellow"
target = "/sub?target=mellow"
[[aliases]]
uri = "/surfboard"
target = "/sub?target=surfboard"
[[aliases]]
uri = "/loon"
target = "/sub?target=loon"
[[aliases]]
uri = "/singbox"
target = "/sub?target=singbox"
[[aliases]]
uri = "/ss"
target = "/sub?target=ss"
[[aliases]]
uri = "/ssd"
target = "/sub?target=ssd"
[[aliases]]
uri = "/sssub"
target = "/sub?target=sssub"
[[aliases]]
uri = "/ssr"
target = "/sub?target=ssr"
[[aliases]]
uri = "/v2ray"
target = "/sub?target=v2ray"
[[aliases]]
uri = "/trojan"
target = "/sub?target=trojan"
[[aliases]]
uri = "/test"
target = "/render?path=templates/test.tpl"
#[[tasks]]
#name = "tick"
#cronexp = "0/10 * * * * ?"
#path = "tick.js"
#timeout = 3
[server]
listen = "0.0.0.0"
port = 25500
serve_file_root = "web"
[advanced]
log_level = "debug"
print_debug_info = true
max_pending_connections = 10240
max_concurrent_threads = 4
max_allowed_rulesets = 64
max_allowed_rules = 0
max_allowed_download_size = 0
enable_cache = true
cache_subscription = 60
cache_config = 300
cache_ruleset = 21600
script_clean_context = true
async_fetch_ruleset = false
skip_failed_links = true