Skip to content

Commit bfa1b11

Browse files
committed
feat: 正式弃用 SUB_STORE_BACKEND_CRON 和 SUB_STORE_CRON, 请使用 SUB_STORE_BACKEND_SYNC_CRON
1 parent 7d60aed commit bfa1b11

4 files changed

Lines changed: 20 additions & 9 deletions

File tree

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.19.76",
3+
"version": "2.19.77",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/core/proxy-utils/parsers/peggy/surge.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ wireguard = tag equals "wireguard" (section_name/no_error_alert/ip_version/under
105105
proxy.type = "wireguard-surge";
106106
handleShadowTLS();
107107
}
108-
hysteria2 = tag equals "hysteria2" address (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/fast_open/tfo/tls_verification/passwordk/tls_fingerprint/download_bandwidth/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
108+
hysteria2 = tag equals "hysteria2" address (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/tls_verification/passwordk/tls_fingerprint/download_bandwidth/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
109109
proxy.type = "hysteria2";
110110
handleShadowTLS();
111111
}
112-
socks5 = tag equals "socks5" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
112+
socks5 = tag equals "socks5" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
113113
proxy.type = "socks5";
114114
handleShadowTLS();
115115
}
@@ -121,7 +121,6 @@ socks5_tls = tag equals "socks5-tls" address (username password)? (usernamek pas
121121
direct = tag equals "direct" (udp_relay/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/block_quic/others)* {
122122
proxy.type = "direct";
123123
}
124-
125124
address = comma server:server comma port:port {
126125
proxy.server = server;
127126
proxy.port = port;
@@ -212,7 +211,7 @@ ws_headers = comma "ws-headers" equals headers:$[^,]+ {
212211
const result = {};
213212
pairs.forEach(pair => {
214213
const [key, value] = pair.trim().split(":");
215-
result[key.trim()] = value.trim().trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1');
214+
result[key.trim()] = value.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1');
216215
})
217216
obfs["ws-headers"] = result;
218217
}

backend/src/restful/index.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@ export default function serve() {
119119
$app.start();
120120

121121
if ($.env.isNode) {
122-
// Deprecated: SUB_STORE_BACKEND_CRON
123-
const backend_sync_cron =
124-
eval('process.env.SUB_STORE_BACKEND_SYNC_CRON') ||
125-
eval('process.env.SUB_STORE_BACKEND_CRON');
122+
// Deprecated: SUB_STORE_BACKEND_CRON, SUB_STORE_CRON
123+
const backend_sync_cron = eval(
124+
'process.env.SUB_STORE_BACKEND_SYNC_CRON',
125+
);
126+
126127
if (backend_sync_cron) {
127128
$.info(`[SYNC CRON] ${backend_sync_cron} enabled`);
128129
const { CronJob } = eval(`require("cron")`);
@@ -145,6 +146,17 @@ export default function serve() {
145146
true, // start
146147
// 'Asia/Shanghai' // timeZone
147148
);
149+
} else {
150+
if (eval('process.env.SUB_STORE_BACKEND_CRON')) {
151+
$.error(
152+
`[SYNC CRON] SUB_STORE_BACKEND_CRON 已弃用, 请使用 SUB_STORE_BACKEND_SYNC_CRON`,
153+
);
154+
}
155+
if (eval('process.env.SUB_STORE_CRON')) {
156+
$.error(
157+
`[SYNC CRON] SUB_STORE_CRON 已弃用, 请使用 SUB_STORE_BACKEND_SYNC_CRON`,
158+
);
159+
}
148160
}
149161
// 格式: 0 */2 * * *,sub,a;0 */3 * * *,col,b
150162
// 每 2 小时处理一次单条订阅 a, 每 3 小时处理一次组合订阅 b

backend/sub-store_1748083027961.json

Whitespace-only changes.

0 commit comments

Comments
 (0)