Upload 2 files
Browse files- Dockerfile +35 -0
- pref.toml +322 -0
Dockerfile
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 使用官方的基础镜像
|
2 |
+
FROM ubuntu:latest
|
3 |
+
|
4 |
+
# 安装依赖项,包括curl和wget
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
curl \
|
7 |
+
wget
|
8 |
+
|
9 |
+
# 设置工作目录
|
10 |
+
WORKDIR /sub
|
11 |
+
|
12 |
+
# 下载最新版本的 subconverter_linux64.tar.gz 文件
|
13 |
+
RUN wget -N https://github.com/tindy2013/subconverter/releases/latest/download/subconverter_linux64.tar.gz \
|
14 |
+
# 解压缩下载的 tar.gz 文件,并移除顶层目录
|
15 |
+
&& tar -xzvf subconverter_linux64.tar.gz --strip-components=1 \
|
16 |
+
# 移除已经解压的 tar.gz 文件,以节省空间
|
17 |
+
&& rm subconverter_linux64.tar.gz \
|
18 |
+
# 赋予所有用户对文件的读、写、执行权限
|
19 |
+
&& chmod 777 -R .
|
20 |
+
|
21 |
+
RUN rm -rf ./pref.toml
|
22 |
+
|
23 |
+
# 复制本地配置文件为实际配置文件
|
24 |
+
COPY pref.toml ./pref.toml
|
25 |
+
# 复制项目配置模板文件为实际配置文件
|
26 |
+
# RUN cp ./pref.example.toml ./pref.toml
|
27 |
+
|
28 |
+
# 赋予subconverter可执行权限
|
29 |
+
RUN chmod +x ./subconverter
|
30 |
+
|
31 |
+
# 开放应用访问端口(默认情况下是25500端口,如有需要可以自行更改)
|
32 |
+
EXPOSE 25500
|
33 |
+
|
34 |
+
# 启动subconverter,并将输出日志写入文件
|
35 |
+
CMD ./subconverter
|
pref.toml
ADDED
@@ -0,0 +1,322 @@
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version = 1
|
2 |
+
[common]
|
3 |
+
# API mode, set to true to prevent loading local subscriptions or serving local files directly
|
4 |
+
api_mode = false
|
5 |
+
|
6 |
+
# Access token used for performing critical action through Web interface
|
7 |
+
api_access_token = "fins1596"
|
8 |
+
|
9 |
+
# Default URLs, used when no URL is provided in request, use "|" to separate multiple subscription links, supports local files/URL
|
10 |
+
default_url = []
|
11 |
+
|
12 |
+
# Insert subscription links to requests. Can be used to add node(s) to all exported subscriptions.
|
13 |
+
enable_insert = true
|
14 |
+
# URLs to insert before subscription links, can be used to add node(s) to all exported subscriptions, supports local files/URL
|
15 |
+
insert_url = [""]
|
16 |
+
# Prepend inserted URLs to subscription links. Nodes in insert_url will be added to groups first with non-group-specific match pattern.
|
17 |
+
prepend_insert_url = true
|
18 |
+
|
19 |
+
# Exclude nodes which remarks match the following patterns. Supports regular expression.
|
20 |
+
exclude_remarks = ["(到期|剩余流量|时间|官网|产品)"]
|
21 |
+
|
22 |
+
# Only include nodes which remarks match the following patterns. Supports regular expression.
|
23 |
+
#include_remarks = ["V3.*港"]
|
24 |
+
|
25 |
+
# Enable script support for filtering nodes
|
26 |
+
enable_filter = false
|
27 |
+
# 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.
|
28 |
+
# Example: Inline script: Set value to content of script.
|
29 |
+
# Script path: Set value to "path:/path/to/script.js".
|
30 |
+
#filter_script = '''
|
31 |
+
#function filter(node) {
|
32 |
+
# const info = JSON.parse(node.ProxyInfo);
|
33 |
+
# if(info.EncryptMethod.includes('chacha20'))
|
34 |
+
# return true;
|
35 |
+
# return false;
|
36 |
+
#}
|
37 |
+
#'''
|
38 |
+
|
39 |
+
# Setting an external config file as default when none is specified, supports local files/URL
|
40 |
+
# default_external_config = "config/example_external_config.toml"
|
41 |
+
|
42 |
+
# The file scope limit of the 'rule_base' options in external configs.
|
43 |
+
base_path = "base"
|
44 |
+
|
45 |
+
# Clash config base used by the generator, supports local files/URL
|
46 |
+
clash_rule_base = "base/all_base.tpl"
|
47 |
+
|
48 |
+
# Surge config base used by the generator, supports local files/URL
|
49 |
+
surge_rule_base = "base/all_base.tpl"
|
50 |
+
|
51 |
+
# Surfboard config base used by the generator, supports local files/URL
|
52 |
+
surfboard_rule_base = "base/all_base.tpl"
|
53 |
+
|
54 |
+
# Mellow config base used by the generator, supports local files/URL
|
55 |
+
mellow_rule_base = "base/all_base.tpl"
|
56 |
+
|
57 |
+
# Quantumult config base used by the generator, supports local files/URL
|
58 |
+
quan_rule_base = "base/all_base.tpl"
|
59 |
+
|
60 |
+
# Quantumult X config base used by the generator, supports local files/URL
|
61 |
+
quanx_rule_base = "base/all_base.tpl"
|
62 |
+
|
63 |
+
# Loon config base used by the generator, supports local files/URL
|
64 |
+
loon_rule_base = "base/all_base.tpl"
|
65 |
+
|
66 |
+
# Shadowsocks Android config base used by the generator, supports local files/URL
|
67 |
+
sssub_rule_base = "base/all_base.tpl"
|
68 |
+
|
69 |
+
# Proxy used to download rulesets or subscriptions, set to NONE or empty to disable it, set to SYSTEM to use system proxy.
|
70 |
+
# Accept cURL-supported proxies (http:// https:// socks4a:// socks5://)
|
71 |
+
|
72 |
+
proxy_config = "SYSTEN"
|
73 |
+
proxy_ruleset = "SYSTEN"
|
74 |
+
proxy_subscription = "NONE"
|
75 |
+
|
76 |
+
# Append a proxy type string ([SS] [SSR] [VMess]) to node remark.
|
77 |
+
append_proxy_type = false
|
78 |
+
|
79 |
+
[[userinfo.stream_rule]]
|
80 |
+
# Rules to extract stream data from node
|
81 |
+
# Format: full_match_regex|new_format_regex
|
82 |
+
# where new_format_regex should be like "total=$1&left=$2&used=$3"
|
83 |
+
match = '^剩余流量:(.*?)\|总流量:(.*)$'
|
84 |
+
replace = 'total=$2&left=$1'
|
85 |
+
|
86 |
+
[[userinfo.stream_rule]]
|
87 |
+
match = '^剩余流量:(.*?) (.*)$'
|
88 |
+
replace = 'total=$1&left=$2'
|
89 |
+
|
90 |
+
[[userinfo.stream_rule]]
|
91 |
+
match = '^Bandwidth: (.*?)/(.*)$'
|
92 |
+
replace = 'used=$1&total=$2'
|
93 |
+
|
94 |
+
[[userinfo.stream_rule]]
|
95 |
+
match = '^.*剩余(.*?)(?:\s*?)@(?:.*)$'
|
96 |
+
replace = 'total=$1'
|
97 |
+
|
98 |
+
[[userinfo.time_rule]]
|
99 |
+
# Rules to extract expire time data from node
|
100 |
+
# Format: full_match_regex|new_format_regex
|
101 |
+
# where new_format_regex should follow this example: yyyy:mm:dd:hh:mm:ss
|
102 |
+
match = '^过期时间:(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)$'
|
103 |
+
replace = '$1:$2:$3:$4:$5:$6'
|
104 |
+
|
105 |
+
[[userinfo.time_rule]]
|
106 |
+
match = '^到期时间:(\d+)-(\d+)-(\d+)$'
|
107 |
+
replace = '$1:$2:$3:0:0:0'
|
108 |
+
|
109 |
+
[[userinfo.time_rule]]
|
110 |
+
match = '^Smart Access expire: (\d+)/(\d+)/(\d+)$'
|
111 |
+
replace = '$1:$2:$3:0:0:0'
|
112 |
+
|
113 |
+
[node_pref]
|
114 |
+
udp_flag = true
|
115 |
+
tcp_fast_open_flag = false
|
116 |
+
skip_cert_verify_flag = true
|
117 |
+
tls13_flag = false
|
118 |
+
|
119 |
+
sort_flag = false
|
120 |
+
# 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.
|
121 |
+
# Examples can be seen at the filter_script option in [common] section.
|
122 |
+
#sort_script = '''
|
123 |
+
#function compare(node_a, node_b) {
|
124 |
+
# return info_a.Remark > info_b.Remark;
|
125 |
+
#}
|
126 |
+
#'''
|
127 |
+
|
128 |
+
filter_deprecated_nodes = false
|
129 |
+
append_sub_userinfo = true
|
130 |
+
clash_use_new_field_name = true
|
131 |
+
|
132 |
+
# Generate style of the proxies section of Clash subscriptions.
|
133 |
+
# Supported styles: block, flow, compact
|
134 |
+
# Block: - name: name1 Flow: - {name: name1, key: value} Compact: [{name: name1, key: value},{name: name2, key: value}]
|
135 |
+
# key: value - {name: name2, key: value}
|
136 |
+
# - name: name2
|
137 |
+
# key: value
|
138 |
+
clash_proxies_style = "flow"
|
139 |
+
|
140 |
+
[[node_pref.rename_node]]
|
141 |
+
match = '\(?((x|X)?(\d+)(\.?\d+)?)((\s?倍率?)|(x|X))\)?'
|
142 |
+
replace = "$1x"
|
143 |
+
|
144 |
+
[managed_config]
|
145 |
+
# Append a '#!MANAGED-CONFIG' info to Surge configurations
|
146 |
+
write_managed_config = true
|
147 |
+
|
148 |
+
# Address prefix for MANAGED-CONFIG info, without the trailing "/".
|
149 |
+
managed_config_prefix = "https://qwqqer-sub.hf.space"
|
150 |
+
|
151 |
+
# Managed config update interval in seconds, determine how long the config will be updated.
|
152 |
+
config_update_interval = 86400
|
153 |
+
|
154 |
+
# If config_update_strict is set to true, Surge will require a force update after the interval.
|
155 |
+
config_update_strict = false
|
156 |
+
|
157 |
+
# Device ID to be written to rewrite scripts for some version of Quantumult X
|
158 |
+
quanx_device_id = ""
|
159 |
+
|
160 |
+
[surge_external_proxy]
|
161 |
+
#surge_ssr_path = "/usr/bin/ssr-local"
|
162 |
+
resolve_hostname = true
|
163 |
+
|
164 |
+
[emojis]
|
165 |
+
add_emoji = false
|
166 |
+
remove_old_emoji = true
|
167 |
+
|
168 |
+
[[emojis.emoji]]
|
169 |
+
#match = '(流量|时间|应急)'
|
170 |
+
#emoji = '🏳️🌈'
|
171 |
+
import = "snippets/emoji.toml"
|
172 |
+
|
173 |
+
# [[custom_groups]]
|
174 |
+
# name = "Auto"
|
175 |
+
# type = "url-test"
|
176 |
+
# rule = [".*"]
|
177 |
+
# url = "http://www.gstatic.com/generate_204"
|
178 |
+
# interval = 300
|
179 |
+
# tolerance = 150
|
180 |
+
# lazy = true
|
181 |
+
|
182 |
+
# [[custom_groups]]
|
183 |
+
# name = "Proxy"
|
184 |
+
# type = "select"
|
185 |
+
# rule = [".*", "[]DIRECT"]
|
186 |
+
# disable_udp = false
|
187 |
+
|
188 |
+
# [[custom_groups]]
|
189 |
+
# name = "LoadBalance"
|
190 |
+
# type = "load-balance"
|
191 |
+
# rule = [".*", "[]Proxy", "[]DIRECT"]
|
192 |
+
# interval = 100
|
193 |
+
# strategy = "consistent-hashing"
|
194 |
+
# url = "http://www.gstatic.com/generate_204"
|
195 |
+
|
196 |
+
[[custom_groups]]
|
197 |
+
import = "snippets/groups.toml"
|
198 |
+
|
199 |
+
[ruleset]
|
200 |
+
# Enable generating rules with rulesets
|
201 |
+
enabled = true
|
202 |
+
|
203 |
+
# Overwrite the existing rules in rule_base
|
204 |
+
overwrite_original_rules = false
|
205 |
+
|
206 |
+
# Perform a ruleset update on request
|
207 |
+
update_ruleset_on_request = false
|
208 |
+
|
209 |
+
# [[rulesets]]
|
210 |
+
# group = "Proxy"
|
211 |
+
# ruleset = "https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Unbreak.list"
|
212 |
+
# type = "surge-ruleset"
|
213 |
+
# interval = 86400
|
214 |
+
|
215 |
+
[[rulesets]]
|
216 |
+
import = "snippets/rulesets.toml"
|
217 |
+
|
218 |
+
[template]
|
219 |
+
template_path = ""
|
220 |
+
|
221 |
+
[[template.globals]]
|
222 |
+
key = "clash.http_port"
|
223 |
+
value = "7890"
|
224 |
+
|
225 |
+
[[template.globals]]
|
226 |
+
key = "clash.socks_port"
|
227 |
+
value = "7891"
|
228 |
+
|
229 |
+
[[template.globals]]
|
230 |
+
key = "clash.allow_lan"
|
231 |
+
value = "true"
|
232 |
+
|
233 |
+
[[template.globals]]
|
234 |
+
key = "clash.log_level"
|
235 |
+
value = "info"
|
236 |
+
|
237 |
+
[[aliases]]
|
238 |
+
uri = "/clash"
|
239 |
+
target = "/sub?target=clash"
|
240 |
+
|
241 |
+
[[aliases]]
|
242 |
+
uri = "/clashr"
|
243 |
+
target = "/sub?target=clashr"
|
244 |
+
|
245 |
+
[[aliases]]
|
246 |
+
uri = "/surge"
|
247 |
+
target = "/sub?target=surge"
|
248 |
+
|
249 |
+
[[aliases]]
|
250 |
+
uri = "/quan"
|
251 |
+
target = "/sub?target=quan"
|
252 |
+
|
253 |
+
[[aliases]]
|
254 |
+
uri = "/quanx"
|
255 |
+
target = "/sub?target=quanx"
|
256 |
+
|
257 |
+
[[aliases]]
|
258 |
+
uri = "/mellow"
|
259 |
+
target = "/sub?target=mellow"
|
260 |
+
|
261 |
+
[[aliases]]
|
262 |
+
uri = "/surfboard"
|
263 |
+
target = "/sub?target=surfboard"
|
264 |
+
|
265 |
+
[[aliases]]
|
266 |
+
uri = "/loon"
|
267 |
+
target = "/sub?target=loon"
|
268 |
+
|
269 |
+
[[aliases]]
|
270 |
+
uri = "/ss"
|
271 |
+
target = "/sub?target=ss"
|
272 |
+
|
273 |
+
[[aliases]]
|
274 |
+
uri = "/ssd"
|
275 |
+
target = "/sub?target=ssd"
|
276 |
+
|
277 |
+
[[aliases]]
|
278 |
+
uri = "/sssub"
|
279 |
+
target = "/sub?target=sssub"
|
280 |
+
|
281 |
+
[[aliases]]
|
282 |
+
uri = "/ssr"
|
283 |
+
target = "/sub?target=ssr"
|
284 |
+
|
285 |
+
[[aliases]]
|
286 |
+
uri = "/v2ray"
|
287 |
+
target = "/sub?target=v2ray"
|
288 |
+
|
289 |
+
[[aliases]]
|
290 |
+
uri = "/trojan"
|
291 |
+
target = "/sub?target=trojan"
|
292 |
+
|
293 |
+
[[aliases]]
|
294 |
+
uri = "/test"
|
295 |
+
target = "/render?path=templates/test.tpl"
|
296 |
+
|
297 |
+
#[[tasks]]
|
298 |
+
#name = "tick"
|
299 |
+
#cronexp = "0/10 * * * * ?"
|
300 |
+
#path = "tick.js"
|
301 |
+
#timeout = 3
|
302 |
+
|
303 |
+
[server]
|
304 |
+
listen = "0.0.0.0"
|
305 |
+
port = 25500
|
306 |
+
serve_file_root = "web"
|
307 |
+
|
308 |
+
[advanced]
|
309 |
+
log_level = "debug"
|
310 |
+
print_debug_info = false
|
311 |
+
max_pending_connections = 10240
|
312 |
+
max_concurrent_threads = 4
|
313 |
+
max_allowed_rulesets = 64
|
314 |
+
max_allowed_rules = 0
|
315 |
+
max_allowed_download_size = 0
|
316 |
+
enable_cache = true
|
317 |
+
cache_subscription = 60
|
318 |
+
cache_config = 300
|
319 |
+
cache_ruleset = 21600
|
320 |
+
script_clean_context = true
|
321 |
+
async_fetch_ruleset = false
|
322 |
+
skip_failed_links = true
|