Update On Tue Sep 23 20:37:39 CEST 2025

This commit is contained in:
github-action[bot]
2025-09-23 20:37:39 +02:00
parent 6774a15632
commit 1f6f1f8a02
154 changed files with 23222 additions and 2903 deletions

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall2
PKG_VERSION:=25.9.20
PKG_VERSION:=25.9.24
PKG_RELEASE:=1
PKG_CONFIG_DEPENDS:= \

View File

@@ -124,6 +124,11 @@ if #hysteria2_type > 0 then
end
end
if #ss_type > 0 or #trojan_type > 0 or #vmess_type > 0 or #vless_type > 0 or #hysteria2_type > 0 then
o.description = string.format("<font color='red'>%s</font>",
translate("The configured type also applies to the core specified when manually importing nodes."))
end
o = s:option(ListValue, "domain_strategy", "Sing-box " .. translate("Domain Strategy"), translate("Set the default domain resolution strategy for the sing-box node."))
o.default = ""
o:value("", translate("Auto"))

View File

@@ -122,7 +122,7 @@ function o.custom_write(self, section, value)
else
result = { value }
end
api.uci:set_list(appname, section, "balancing_node", result)
m.uci:set_list(appname, section, "balancing_node", result)
end
o = s:option(ListValue, _n("balancingStrategy"), translate("Balancing Strategy"))

View File

@@ -132,7 +132,7 @@ function o.custom_write(self, section, value)
else
result = { value }
end
api.uci:set_list(appname, section, "urltest_node", result)
m.uci:set_list(appname, section, "urltest_node", result)
end
o = s:option(Value, _n("urltest_url"), translate("Probe URL"))

View File

@@ -793,6 +793,7 @@ local hysteria2_type = get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{
if (ssrurl === null || ssrurl === "") {
return false;
}
ssrurl = ssrurl.replace(/&amp;/gi, '&').replace(/\s*#\s*/, '#').trim(); //一些奇葩的链接用"&amp;"当做"&""#"前后带空格
s.innerHTML = "";
var ssu = ssrurl.split('://');
var event = document.createEvent("HTMLEvents");
@@ -870,6 +871,8 @@ local hysteria2_type = get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{
if (userInfoSplitIndex !== -1) {
method = userInfo.substr(0, userInfoSplitIndex);
password = userInfo.substr(userInfoSplitIndex + 1);
} else {
password = url0.substr(0, sipIndex); //一些链接用明文uuid做密码
}
} else {
// base64(method:pass@host:port)
@@ -908,14 +911,14 @@ local hysteria2_type = get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{
pluginOpts = pluginParams.join(";");
}
if (ss_type == "sing-box" && has_singbox) {
dom_prefix = "singbox_"
opt.set('type', "sing-box");
opt.set(dom_prefix + 'protocol', "shadowsocks");
} else if (ss_type == "xray" && has_xray) {
if (has_xray && ((ss_type !== "xray" && ss_type !== "sing-box" && queryParam.type) || ss_type == "xray")) {
dom_prefix = "xray_"
opt.set('type', "Xray");
opt.set(dom_prefix + 'protocol', "shadowsocks");
} else if (has_singbox && ((ss_type !== "xray" && ss_type !== "sing-box" && queryParam.type) || ss_type == "sing-box")) {
dom_prefix = "singbox_"
opt.set('type', "sing-box");
opt.set(dom_prefix + 'protocol', "shadowsocks");
} else if (ss_type == "shadowsocks-rust") {
dom_prefix = "ssrust_"
opt.set('type', "SS-Rust");
@@ -928,10 +931,14 @@ local hysteria2_type = get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{
opt.set('type', "SS");
}
}
if (ss_type !== "xray") {
method = method.toLowerCase() === "chacha20-poly1305" ? "chacha20-ietf-poly1305" : method;
method = method.toLowerCase() === "xchacha20-poly1305" ? "xchacha20-ietf-poly1305" : method;
}
const _method = (method || "none").toLowerCase();
const mapping = {
"chacha20-poly1305": "chacha20-ietf-poly1305",
"xchacha20-poly1305": "xchacha20-ietf-poly1305",
};
method = mapping[_method] || _method;
opt.set(dom_prefix + 'address', unbracketIP(server));
opt.set(dom_prefix + 'port', port);
opt.set(dom_prefix + 'password', password || "");
@@ -1324,16 +1331,13 @@ local hysteria2_type = get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{
dom_prefix = "xray_"
opt.set('type', "Xray");
}
opt.set(dom_prefix + 'protocol', "vless");
var m = parseNodeUrl(ssrurl);
var password = m.passwd;
if (password === "") {
s.innerHTML = "<font color='red'><%:Invalid Share URL Format%></font>";
return false;
}
opt.set(dom_prefix + 'uuid', password);
opt.set(dom_prefix + 'address', unbracketIP(m.hostname));
opt.set(dom_prefix + 'port', m.port || "443");
var queryParam = {};
if (m.search.length > 1) {
var query = m.search.replace('/?', '?').split('?')
@@ -1346,6 +1350,16 @@ local hysteria2_type = get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{
}
}
queryParam.type = queryParam.type.toLowerCase();
if (["xhttp", "kcp", "mkcp"].includes(queryParam.type) && vless_type !== "xray" && has_xray) {
dom_prefix = "xray_"
opt.set('type', "Xray");
}
opt.set(dom_prefix + 'protocol', "vless");
opt.set(dom_prefix + 'uuid', password);
opt.set(dom_prefix + 'address', unbracketIP(m.hostname));
opt.set(dom_prefix + 'port', m.port || "443");
opt.set(dom_prefix + 'encryption', queryParam.encryption || "none");
if (queryParam.security) {
if (queryParam.security == "tls") {
@@ -1385,7 +1399,6 @@ local hysteria2_type = get_core("hysteria2_type", {{has_hysteria2,"hysteria2"},{
}
queryParam.type = queryParam.type.toLowerCase();
if (queryParam.type === "kcp" || queryParam.type === "mkcp") {
queryParam.type = "mkcp";
}

View File

@@ -1833,3 +1833,6 @@ msgstr "客户端版本"
msgid "Random version will be used if empty."
msgstr "如留空,则使用随机版本。"
msgid "The configured type also applies to the core specified when manually importing nodes."
msgstr "配置的类型同样适用于手动导入节点时所指定的核心程序。"

View File

@@ -688,8 +688,13 @@ local function processData(szType, content, add_mode, add_from)
else
userinfo = base64Decode(hostInfo[1])
end
local method = userinfo:sub(1, userinfo:find(":") - 1)
local password = userinfo:sub(userinfo:find(":") + 1, #userinfo)
local method, password
if userinfo:find(":") then
method = userinfo:sub(1, userinfo:find(":") - 1)
password = userinfo:sub(userinfo:find(":") + 1, #userinfo)
else
password = hostInfo[1] --一些链接用明文uuid做密码
end
-- 判断密码是否经过url编码
local function isURLEncodedPassword(pwd)
@@ -704,12 +709,20 @@ local function processData(szType, content, add_mode, add_from)
if isURLEncodedPassword(password) and decoded then
password = decoded
end
local _method = (method or "none"):lower()
method = (_method == "chacha20-poly1305" and "chacha20-ietf-poly1305") or
(_method == "xchacha20-poly1305" and "xchacha20-ietf-poly1305") or _method
result.method = method
result.password = password
if result.type ~= "Xray" then
result.method = (method:lower() == "chacha20-poly1305" and "chacha20-ietf-poly1305") or
(method:lower() == "xchacha20-poly1305" and "xchacha20-ietf-poly1305") or method
if has_xray and (result.type ~= 'Xray' and result.type ~= 'sing-box' and params.type) then
result.type = 'Xray'
result.protocol = 'shadowsocks'
elseif has_singbox and (result.type ~= 'Xray' and result.type ~= 'sing-box' and params.type) then
result.type = 'sing-box'
result.protocol = 'shadowsocks'
end
if result.plugin then
@@ -1115,6 +1128,9 @@ local function processData(szType, content, add_mode, add_from)
if not params.type then params.type = "tcp" end
params.type = string.lower(params.type)
if ({ xhttp=true, kcp=true, mkcp=true })[params.type] and result.type ~= "Xray" and has_xray then
result.type = "Xray"
end
if result.type == "sing-box" and params.type == "raw" then
params.type = "tcp"
elseif result.type == "Xray" and params.type == "tcp" then
@@ -1810,9 +1826,9 @@ local function parse_link(raw, add_mode, add_from, cfgid)
else
-- ssd 外的格式
if add_mode == "1" then
nodes = split(raw:gsub(" ", "\n"), "\n")
nodes = split(raw, "\n")
else
nodes = split(base64Decode(raw):gsub(" ", "\n"), "\n")
nodes = split(base64Decode(raw):gsub("\r\n", "\n"), "\n")
end
end
@@ -1830,7 +1846,8 @@ local function parse_link(raw, add_mode, add_from, cfgid)
local link = api.trim(dat[2]:gsub("#.*$", ""))
result = processData(dat[1], base64Decode(link), add_mode, add_from)
else
result = processData(dat[1], dat[2], add_mode, add_from)
local link = dat[2]:gsub("&amp;", "&"):gsub("%s*#%s*", "#") -- 一些奇葩的链接用"&amp;"当做"&""#"前后带空格
result = processData(dat[1], link, add_mode, add_from)
end
end
else