mirror of
https://github.com/bolucat/Archive.git
synced 2026-04-23 00:17:16 +08:00
Update On Fri Feb 27 19:57:56 CET 2026
This commit is contained in:
@@ -33,20 +33,15 @@ local has_xray = api.finded_com("xray")
|
||||
local has_hysteria2 = api.finded_com("hysteria")
|
||||
local allowInsecure_default = true
|
||||
-- Nodes should be retrieved using the core type (if not set on the node subscription page, the default type will be used automatically).
|
||||
local function get_core(field, candidates)
|
||||
local v = uci:get(appname, "@global_subscribe[0]", field)
|
||||
if not v or v == "" then
|
||||
for _, c in ipairs(candidates) do
|
||||
if c[1] then return c[2] end
|
||||
end
|
||||
end
|
||||
return v
|
||||
end
|
||||
local ss_type_default = get_core("ss_type", {{has_ss,"shadowsocks-libev"},{has_ss_rust,"shadowsocks-rust"},{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||
local trojan_type_default = get_core("trojan_type", {{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||
local vmess_type_default = get_core("vmess_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
||||
local vless_type_default = get_core("vless_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
||||
local hysteria2_type_default = get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||
local ss_type_default = api.get_core("ss_type", {{has_ss,"shadowsocks-libev"},{has_ss_rust,"shadowsocks-rust"},{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||
local trojan_type_default = api.get_core("trojan_type", {{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||
local vmess_type_default = api.get_core("vmess_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
||||
local vless_type_default = api.get_core("vless_type", {{has_xray,"xray"},{has_singbox,"sing-box"}})
|
||||
local hysteria2_type_default = api.get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{has_singbox,"sing-box"},{has_xray,"xray"}})
|
||||
local core_has = {
|
||||
["xray"] = has_xray, ["sing-box"] = has_singbox, ["shadowsocks-libev"] = has_ss,["shadowsocks-rust"] = has_ss_rust,
|
||||
["hysteria2"] = has_hysteria2
|
||||
}
|
||||
local domain_strategy_default = uci:get(appname, "@global_subscribe[0]", "domain_strategy") or ""
|
||||
local domain_strategy_node = ""
|
||||
local preproxy_node_group, to_node_group, chain_node_type = "", "", ""
|
||||
@@ -1429,12 +1424,17 @@ local function processData(szType, content, add_mode, group)
|
||||
end
|
||||
result.remarks = UrlDecode(alias)
|
||||
local Info = content
|
||||
if content:find("@") then
|
||||
if content:find("@", 1, true) then
|
||||
local contents = split(content, "@")
|
||||
if contents[1]:find(":") then
|
||||
local userinfo = split(contents[1], ":")
|
||||
result.uuid = UrlDecode(userinfo[1])
|
||||
result.password = UrlDecode(userinfo[2])
|
||||
local auth = contents[1] or ""
|
||||
local idx = auth:find(":", 1, true)
|
||||
if not idx then -- Fix for some links will encode the ':' between the UUID and password.
|
||||
auth = UrlDecode(auth)
|
||||
idx = auth:find(":", 1, true)
|
||||
end
|
||||
if idx then
|
||||
result.uuid = UrlDecode(auth:sub(1, idx - 1))
|
||||
result.password = UrlDecode(auth:sub(idx + 1))
|
||||
end
|
||||
Info = (contents[2] or ""):gsub("/%?", "?")
|
||||
end
|
||||
@@ -1459,6 +1459,7 @@ local function processData(szType, content, add_mode, group)
|
||||
result.address = host_port
|
||||
end
|
||||
result.tls_serverName = params.sni
|
||||
result.tls_disable_sni = params.disable_sni
|
||||
result.tuic_alpn = params.alpn or "default"
|
||||
result.tuic_congestion_control = params.congestion_control or "cubic"
|
||||
result.tuic_udp_relay_mode = params.udp_relay_mode or "native"
|
||||
@@ -2031,23 +2032,23 @@ local execute = function()
|
||||
filter_keyword_discard_list_default = value.filter_discard_list or {}
|
||||
end
|
||||
local ss_type = value.ss_type or "global"
|
||||
if ss_type ~= "global" then
|
||||
if ss_type ~= "global" and core_has[ss_type] then
|
||||
ss_type_default = ss_type
|
||||
end
|
||||
local trojan_type = value.trojan_type or "global"
|
||||
if trojan_type ~= "global" then
|
||||
if trojan_type ~= "global" and core_has[trojan_type] then
|
||||
trojan_type_default = trojan_type
|
||||
end
|
||||
local vmess_type = value.vmess_type or "global"
|
||||
if vmess_type ~= "global" then
|
||||
if vmess_type ~= "global" and core_has[vmess_type] then
|
||||
vmess_type_default = vmess_type
|
||||
end
|
||||
local vless_type = value.vless_type or "global"
|
||||
if vless_type ~= "global" then
|
||||
if vless_type ~= "global" and core_has[vless_type] then
|
||||
vless_type_default = vless_type
|
||||
end
|
||||
local hysteria2_type = value.hysteria2_type or "global"
|
||||
if hysteria2_type ~= "global" then
|
||||
if hysteria2_type ~= "global" and core_has[hysteria2_type] then
|
||||
hysteria2_type_default = hysteria2_type
|
||||
end
|
||||
local domain_strategy = value.domain_strategy or "global"
|
||||
@@ -2103,11 +2104,21 @@ local execute = function()
|
||||
filter_keyword_mode_default = uci:get(appname, "@global_subscribe[0]", "filter_keyword_mode") or "0"
|
||||
filter_keyword_discard_list_default = uci:get(appname, "@global_subscribe[0]", "filter_discard_list") or {}
|
||||
filter_keyword_keep_list_default = uci:get(appname, "@global_subscribe[0]", "filter_keep_list") or {}
|
||||
ss_type_default = uci:get(appname, "@global_subscribe[0]", "ss_type") or "shadowsocks-libev"
|
||||
trojan_type_default = uci:get(appname, "@global_subscribe[0]", "trojan_type") or "sing-box"
|
||||
vmess_type_default = uci:get(appname, "@global_subscribe[0]", "vmess_type") or "xray"
|
||||
vless_type_default = uci:get(appname, "@global_subscribe[0]", "vless_type") or "xray"
|
||||
hysteria2_type_default = uci:get(appname, "@global_subscribe[0]", "hysteria2_type") or "hysteria2"
|
||||
|
||||
ss_type = uci:get(appname, "@global_subscribe[0]", "ss_type") or ""
|
||||
ss_type_default = core_has[ss_type] and ss_type or ss_type_default
|
||||
|
||||
trojan_type = uci:get(appname, "@global_subscribe[0]", "trojan_type") or ""
|
||||
trojan_type_default = core_has[trojan_type] and trojan_type or trojan_type_default
|
||||
|
||||
vmess_type = uci:get(appname, "@global_subscribe[0]", "vmess_type") or ""
|
||||
vmess_type_default = core_has[vmess_type] and vmess_type or vmess_type_default
|
||||
|
||||
vless_type = uci:get(appname, "@global_subscribe[0]", "vless_type") or ""
|
||||
vless_type_default = core_has[vless_type] and vless_type or vless_type_default
|
||||
|
||||
hysteria2_type = uci:get(appname, "@global_subscribe[0]", "hysteria2_type") or ""
|
||||
hysteria2_type_default = core_has[hysteria2_type] and hysteria2_type or hysteria2_type_default
|
||||
end
|
||||
|
||||
if #fail_list > 0 then
|
||||
|
||||
Reference in New Issue
Block a user