luci-app-passwall2: sync upstream

last commit: 5a6e8ec5a2
This commit is contained in:
gitea-action 2024-12-31 01:30:19 +08:00
parent 90942b8f22
commit c3e8fb7748
4 changed files with 18 additions and 12 deletions

View File

@ -18,7 +18,7 @@ local function _n(name)
end end
local ss_method_list = { local ss_method_list = {
"aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "xchacha20-poly1305", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" "aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305"
} }
local security_list = { "none", "auto", "aes-128-gcm", "chacha20-poly1305", "zero" } local security_list = { "none", "auto", "aes-128-gcm", "chacha20-poly1305", "zero" }

View File

@ -243,7 +243,9 @@ function gen_outbound(flag, node, tag, proxy_table)
{ {
address = node.address, address = node.address,
port = tonumber(node.port), port = tonumber(node.port),
method = node.method or nil, method = (node.method == "chacha20-ietf-poly1305" and "chacha20-poly1305") or
(node.method == "xchacha20-ietf-poly1305" and "xchacha20-poly1305") or
(node.method ~= "" and node.method) or nil,
ivCheck = (node.protocol == "shadowsocks") and node.iv_check == "1" or nil, ivCheck = (node.protocol == "shadowsocks") and node.iv_check == "1" or nil,
uot = (node.protocol == "shadowsocks") and node.uot == "1" or nil, uot = (node.protocol == "shadowsocks") and node.uot == "1" or nil,
password = node.password or "", password = node.password or "",

View File

@ -747,17 +747,19 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
dom_prefix = "xray_" dom_prefix = "xray_"
opt.set('type', "Xray"); opt.set('type', "Xray");
opt.set(dom_prefix + 'protocol', "shadowsocks"); opt.set(dom_prefix + 'protocol', "shadowsocks");
method = method.toLowerCase() === "chacha20-ietf-poly1305" ? "chacha20-poly1305" : method;
} else { } else {
if (["2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305"].includes(method)) { if (["2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305"].includes(method)) {
dom_prefix = "ssrust_" dom_prefix = "ssrust_"
opt.set('type', "SS-Rust"); opt.set('type', "SS-Rust");
method = method.toLowerCase() === "chacha20-poly1305" ? "chacha20-ietf-poly1305" : method;
} else { } else {
dom_prefix = "ss_" dom_prefix = "ss_"
opt.set('type', "SS"); 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;
}
opt.set(dom_prefix + 'address', server); opt.set(dom_prefix + 'address', server);
opt.set(dom_prefix + 'port', port); opt.set(dom_prefix + 'port', port);
opt.set(dom_prefix + 'password', password || ""); opt.set(dom_prefix + 'password', password || "");
@ -876,6 +878,7 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
var team = sstr.split('@'); var team = sstr.split('@');
var part1 = team[0].split(':'); var part1 = team[0].split(':');
var part2 = team[1].split(':'); var part2 = team[1].split(':');
var method = part1[0]
if (ss_type == "sing-box" && has_singbox) { if (ss_type == "sing-box" && has_singbox) {
dom_prefix = "singbox_" dom_prefix = "singbox_"
@ -890,11 +893,15 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
opt.set('type', "SS"); 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;
}
opt.set(dom_prefix + 'address', part2[0]); opt.set(dom_prefix + 'address', part2[0]);
opt.set(dom_prefix + 'port', part2[1]); opt.set(dom_prefix + 'port', part2[1]);
opt.set(dom_prefix + 'password', part1[1]); opt.set(dom_prefix + 'password', part1[1]);
opt.set(dom_prefix + 'method', part1[0]); opt.set(dom_prefix + 'method', method);
opt.set(dom_prefix + 'ss_method', part1[0]); opt.set(dom_prefix + 'ss_method', method);
opt.set(dom_prefix + 'plugin', "none"); opt.set(dom_prefix + 'plugin', "none");
//opt.set(dom_prefix + 'plugin_opts', ""); //opt.set(dom_prefix + 'plugin_opts', "");
if (param !== undefined) { if (param !== undefined) {

View File

@ -630,12 +630,9 @@ local function processData(szType, content, add_mode, add_from)
result.protocol = 'shadowsocks' result.protocol = 'shadowsocks'
end end
if result.type == "SS-Rust" and method:lower() == "chacha20-poly1305" then if result.type ~= "Xray" then
result.method = "chacha20-ietf-poly1305" result.method = (method:lower() == "chacha20-poly1305" and "chacha20-ietf-poly1305") or
end (method:lower() == "xchacha20-poly1305" and "xchacha20-ietf-poly1305") or method
if result.type == "Xray" and method:lower() == "chacha20-ietf-poly1305" then
result.method = "chacha20-poly1305"
end end
if result.plugin then if result.plugin then