Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/luci-app-passwall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-passwall
PKG_VERSION:=25.9.19
PKG_VERSION:=25.9.23
PKG_RELEASE:=1

PKG_CONFIG_DEPENDS:= \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@
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");
Expand Down Expand Up @@ -874,6 +875,8 @@
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)
Expand Down Expand Up @@ -912,14 +915,14 @@
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");
Expand All @@ -932,10 +935,14 @@
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 || "");
Expand Down Expand Up @@ -1329,16 +1336,13 @@
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('?')
Expand All @@ -1351,6 +1355,16 @@
}
}

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") {
Expand Down Expand Up @@ -1390,7 +1404,6 @@

}

queryParam.type = queryParam.type.toLowerCase();
if (queryParam.type === "kcp") {
queryParam.type = "mkcp";
}
Expand Down
3 changes: 3 additions & 0 deletions applications/luci-app-passwall/po/zh_Hans/passwall.po
Original file line number Diff line number Diff line change
Expand Up @@ -1986,3 +1986,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 "配置的类型同样适用于手动导入节点时所指定的核心程序。"
4 changes: 2 additions & 2 deletions applications/luci-app-passwall/root/usr/share/passwall/app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2280,8 +2280,8 @@ get_config() {
RESOLVFILE=/tmp/resolv.conf.d/resolv.conf.auto
[ -f "${RESOLVFILE}" ] && [ -s "${RESOLVFILE}" ] || RESOLVFILE=/tmp/resolv.conf.auto

ISP_DNS=$(cat $RESOLVFILE 2>/dev/null | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" | sort -u | grep -v 0.0.0.0 | grep -v 127.0.0.1)
ISP_DNS6=$(cat $RESOLVFILE 2>/dev/null | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | awk -F % '{print $1}' | awk -F " " '{print $2}'| sort -u | grep -v -Fx ::1 | grep -v -Fx ::)
ISP_DNS=$(cat $RESOLVFILE 2>/dev/null | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" | grep -v -E '^(0\.0\.0\.0|127\.0\.0\.1)$' | awk '!seen[$0]++')
ISP_DNS6=$(cat $RESOLVFILE 2>/dev/null | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | awk -F % '{print $1}' | awk -F " " '{print $2}' | grep -v -Fx ::1 | grep -v -Fx :: | awk '!seen[$0]++')

DEFAULT_DNS=$(uci show dhcp.@dnsmasq[0] | grep "\.server=" | awk -F '=' '{print $2}' | sed "s/'//g" | tr ' ' '\n' | grep -v "\/" | head -2 | sed ':label;N;s/\n/,/;b label')
[ -z "${DEFAULT_DNS}" ] && [ "$(echo $ISP_DNS | tr ' ' '\n' | wc -l)" -le 2 ] && DEFAULT_DNS=$(echo -n $ISP_DNS | tr ' ' '\n' | head -2 | tr '\n' ',' | sed 's/,$//')
Expand Down
Loading
Loading