luci-app-passwall: sync upstream

last commit: 99d59d16b1
This commit is contained in:
gitea-action 2025-04-09 01:01:24 +08:00
parent e9f8d235e2
commit 9bc1b75cf3
2 changed files with 20 additions and 8 deletions

View File

@ -11,7 +11,7 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
-%>
<script src="<%=resource%>/qrcode.min.js"></script>
<script type="text/javascript">//<![CDATA[
let has_singbox = "<%=api.finded_com("singbox")%>"
let has_singbox = "<%=api.finded_com("sing-box")%>"
let has_xray = "<%=api.finded_com("xray")%>"
let has_hysteria2 = "<%=api.finded_com("hysteria")%>"
let ss_type = "<%=ss_type%>"
@ -511,6 +511,10 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
params += "&obfs=" + "salamander";
params += opt.query("obfs-password", "hysteria2_obfs");
}
var dom_ports = opt.get(dom_prefix + "hop");
if (dom_ports && dom_ports.value != "") {
params += opt.query("mport", dom_prefix + "hop");
}
} else {
v_password = opt.get(dom_prefix + "hysteria2_auth_password");
var dom_obfs_type = opt.get(dom_prefix + "hysteria2_obfs_type");
@ -518,7 +522,12 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
params += opt.query("obfs", dom_prefix + "hysteria2_obfs_type");
params += opt.query("obfs-password", dom_prefix + "hysteria2_obfs_password");
}
var dom_ports = opt.get(dom_prefix + "hysteria2_ports");
if (dom_ports && dom_ports.value != "") {
params += opt.query("mport", dom_prefix + "hysteria2_ports");
}
}
params = params.replace(/^&/, "");
url =
_address + ":" +
v_port.value + "?" +
@ -1306,6 +1315,7 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
opt.set(dom_prefix + 'hysteria2_obfs_type', "salamander");
opt.set(dom_prefix + 'hysteria2_obfs_password', queryParam["obfs-password"]);
}
opt.set(dom_prefix + 'hysteria2_ports', queryParam.mport || "");
} else if (has_hysteria2) {
opt.set('type', "Hysteria2");
dom_prefix = "hysteria2_"
@ -1316,12 +1326,13 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
if (queryParam.pinSHA256) {
opt.set(dom_prefix + 'tls_pinSHA256', queryParam.pinSHA256);
}
opt.set(dom_prefix + 'hop', queryParam.mport || "");
}
opt.set(dom_prefix + 'address', m.hostname);
opt.set(dom_prefix + 'port', m.port || "443");
opt.set(dom_prefix + 'tls_serverName', queryParam.sni);
opt.set(dom_prefix + 'tls_serverName', queryParam.sni || "");
if (queryParam.insecure && queryParam.insecure == "1") {
opt.set(dom_prefix + 'tls_allowInsecure', true);
}

View File

@ -1223,12 +1223,6 @@ local function processData(szType, content, add_mode, add_from)
end
result.hysteria2_tls_pinSHA256 = params.pinSHA256
if has_hysteria2 then
result.type = "Hysteria2"
if params["obfs-password"] then
result.hysteria2_obfs = params["obfs-password"]
end
end
if hysteria2_type_default == "sing-box" and has_singbox then
result.type = 'sing-box'
result.protocol = "hysteria2"
@ -1236,6 +1230,13 @@ local function processData(szType, content, add_mode, add_from)
result.hysteria2_obfs_type = "salamander"
result.hysteria2_obfs_password = params["obfs-password"]
end
result.hysteria2_ports = params.mport
elseif has_hysteria2 then
result.type = "Hysteria2"
if params["obfs-password"] then
result.hysteria2_obfs = params["obfs-password"]
end
result.hysteria2_hop = params.mport
end
elseif szType == 'tuic' then
local alias = ""