luci-app-passwall: sync upstream

last commit: deaf534758
This commit is contained in:
gitea-action 2024-12-31 18:00:16 +08:00
parent 05088a64c4
commit dfcae4cd33
7 changed files with 19 additions and 19 deletions

View File

@ -146,7 +146,7 @@ end
sources.write = dynamicList_write sources.write = dynamicList_write
---- TCP No Redir Ports ---- TCP No Redir Ports
local TCP_NO_REDIR_PORTS = m.uci:get(appname, "@global_forwarding[0]", "tcp_no_redir_ports") local TCP_NO_REDIR_PORTS = m:get("@global_forwarding[0]", "tcp_no_redir_ports")
o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports")) o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports"))
o:value("", translate("Use global config") .. "(" .. TCP_NO_REDIR_PORTS .. ")") o:value("", translate("Use global config") .. "(" .. TCP_NO_REDIR_PORTS .. ")")
o:value("disable", translate("No patterns are used")) o:value("disable", translate("No patterns are used"))
@ -154,7 +154,7 @@ o:value("1:65535", translate("All"))
o.validate = port_validate o.validate = port_validate
---- UDP No Redir Ports ---- UDP No Redir Ports
local UDP_NO_REDIR_PORTS = m.uci:get(appname, "@global_forwarding[0]", "udp_no_redir_ports") local UDP_NO_REDIR_PORTS = m:get("@global_forwarding[0]", "udp_no_redir_ports")
o = s:option(Value, "udp_no_redir_ports", translate("UDP No Redir Ports"), o = s:option(Value, "udp_no_redir_ports", translate("UDP No Redir Ports"),
"<font color='red'>" .. "<font color='red'>" ..
translate("Fill in the ports you don't want to be forwarded by the agent, with the highest priority.") .. translate("Fill in the ports you don't want to be forwarded by the agent, with the highest priority.") ..
@ -203,7 +203,7 @@ o.value = "1"
o:depends({ udp_node = "", ['!reverse'] = true }) o:depends({ udp_node = "", ['!reverse'] = true })
---- TCP Proxy Drop Ports ---- TCP Proxy Drop Ports
local TCP_PROXY_DROP_PORTS = m.uci:get(appname, "@global_forwarding[0]", "tcp_proxy_drop_ports") local TCP_PROXY_DROP_PORTS = m:get("@global_forwarding[0]", "tcp_proxy_drop_ports")
o = s:option(Value, "tcp_proxy_drop_ports", translate("TCP Proxy Drop Ports")) o = s:option(Value, "tcp_proxy_drop_ports", translate("TCP Proxy Drop Ports"))
o:value("", translate("Use global config") .. "(" .. TCP_PROXY_DROP_PORTS .. ")") o:value("", translate("Use global config") .. "(" .. TCP_PROXY_DROP_PORTS .. ")")
o:value("disable", translate("No patterns are used")) o:value("disable", translate("No patterns are used"))
@ -212,7 +212,7 @@ o:depends({ use_global_config = true })
o:depends({ _tcp_node_bool = "1" }) o:depends({ _tcp_node_bool = "1" })
---- UDP Proxy Drop Ports ---- UDP Proxy Drop Ports
local UDP_PROXY_DROP_PORTS = m.uci:get(appname, "@global_forwarding[0]", "udp_proxy_drop_ports") local UDP_PROXY_DROP_PORTS = m:get("@global_forwarding[0]", "udp_proxy_drop_ports")
o = s:option(Value, "udp_proxy_drop_ports", translate("UDP Proxy Drop Ports")) o = s:option(Value, "udp_proxy_drop_ports", translate("UDP Proxy Drop Ports"))
o:value("", translate("Use global config") .. "(" .. UDP_PROXY_DROP_PORTS .. ")") o:value("", translate("Use global config") .. "(" .. UDP_PROXY_DROP_PORTS .. ")")
o:value("disable", translate("No patterns are used")) o:value("disable", translate("No patterns are used"))
@ -222,7 +222,7 @@ o:depends({ use_global_config = true })
o:depends({ _tcp_node_bool = "1" }) o:depends({ _tcp_node_bool = "1" })
---- TCP Redir Ports ---- TCP Redir Ports
local TCP_REDIR_PORTS = m.uci:get(appname, "@global_forwarding[0]", "tcp_redir_ports") local TCP_REDIR_PORTS = m:get("@global_forwarding[0]", "tcp_redir_ports")
o = s:option(Value, "tcp_redir_ports", translate("TCP Redir Ports"), translatef("Only work with using the %s node.", "TCP")) o = s:option(Value, "tcp_redir_ports", translate("TCP Redir Ports"), translatef("Only work with using the %s node.", "TCP"))
o:value("", translate("Use global config") .. "(" .. TCP_REDIR_PORTS .. ")") o:value("", translate("Use global config") .. "(" .. TCP_REDIR_PORTS .. ")")
o:value("1:65535", translate("All")) o:value("1:65535", translate("All"))
@ -234,7 +234,7 @@ o:depends({ use_global_config = true })
o:depends({ _tcp_node_bool = "1" }) o:depends({ _tcp_node_bool = "1" })
---- UDP Redir Ports ---- UDP Redir Ports
local UDP_REDIR_PORTS = m.uci:get(appname, "@global_forwarding[0]", "udp_redir_ports") local UDP_REDIR_PORTS = m:get("@global_forwarding[0]", "udp_redir_ports")
o = s:option(Value, "udp_redir_ports", translate("UDP Redir Ports"), translatef("Only work with using the %s node.", "UDP")) o = s:option(Value, "udp_redir_ports", translate("UDP Redir Ports"), translatef("Only work with using the %s node.", "UDP"))
o:value("", translate("Use global config") .. "(" .. UDP_REDIR_PORTS .. ")") o:value("", translate("Use global config") .. "(" .. UDP_REDIR_PORTS .. ")")
o:value("1:65535", translate("All")) o:value("1:65535", translate("All"))

View File

@ -37,7 +37,7 @@ end
local socks_list = {} local socks_list = {}
local tcp_socks_server = "127.0.0.1" .. ":" .. (m.uci:get(appname, "@global[0]", "tcp_node_socks_port") or "1070") local tcp_socks_server = "127.0.0.1" .. ":" .. (m:get("@global[0]", "tcp_node_socks_port") or "1070")
local socks_table = {} local socks_table = {}
socks_table[#socks_table + 1] = { socks_table[#socks_table + 1] = {
id = tcp_socks_server, id = tcp_socks_server,
@ -600,7 +600,7 @@ o = s:taboption("DNS", Flag, "dns_redirect", translate("DNS Redirect"), translat
o.default = "0" o.default = "0"
o.rmempty = false o.rmempty = false
if (m.uci:get(appname, "@global_forwarding[0]", "use_nft") or "0") == "1" then if (m:get("@global_forwarding[0]", "use_nft") or "0") == "1" then
o = s:taboption("DNS", Button, "clear_ipset", translate("Clear NFTSET"), translate("Try this feature if the rule modification does not take effect.")) o = s:taboption("DNS", Button, "clear_ipset", translate("Clear NFTSET"), translate("Try this feature if the rule modification does not take effect."))
else else
o = s:taboption("DNS", Button, "clear_ipset", translate("Clear IPSET"), translate("Try this feature if the rule modification does not take effect.")) o = s:taboption("DNS", Button, "clear_ipset", translate("Clear IPSET"), translate("Try this feature if the rule modification does not take effect."))

View File

@ -4,7 +4,7 @@ local appname = "passwall"
m = Map(appname, translate("Node Config")) m = Map(appname, translate("Node Config"))
m.redirect = api.url() m.redirect = api.url()
if not arg[1] or not m.uci:get(appname, arg[1]) then if not arg[1] or not m:get(arg[1]) then
luci.http.redirect(api.url("node_list")) luci.http.redirect(api.url("node_list"))
end end

View File

@ -22,7 +22,7 @@ o.rmempty = false
local auto_switch_tip local auto_switch_tip
local current_node = api.get_cache_var("socks_" .. arg[1]) local current_node = api.get_cache_var("socks_" .. arg[1])
if current_node then if current_node then
local n = m.uci:get_all(appname, current_node) local n = m:get(current_node)
if n then if n then
if tonumber(m:get(arg[1], "enable_autoswitch") or 0) == 1 then if tonumber(m:get(arg[1], "enable_autoswitch") or 0) == 1 then
if n then if n then

View File

@ -2,12 +2,12 @@
<% <%
local api = require "luci.passwall.api" local api = require "luci.passwall.api"
local appname = 'passwall' local appname = 'passwall'
local uci = self.map.uci local map = self.map
local ss_type = uci:get(appname, "@global_subscribe[0]", "ss_type") or "xray" local ss_type = map:get("@global_subscribe[0]", "ss_type") or "xray"
local trojan_type = uci:get(appname, "@global_subscribe[0]", "trojan_type") or "xray" local trojan_type = map:get("@global_subscribe[0]", "trojan_type") or "xray"
local vmess_type = uci:get(appname, "@global_subscribe[0]", "vmess_type") or "xray" local vmess_type = map:get("@global_subscribe[0]", "vmess_type") or "xray"
local vless_type = uci:get(appname, "@global_subscribe[0]", "vless_type") or "xray" local vless_type = map:get("@global_subscribe[0]", "vless_type") or "xray"
local hysteria2_type = uci:get(appname, "@global_subscribe[0]", "hysteria2_type") or "sing-box" local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sing-box"
-%> -%>
<script src="<%=resource%>/qrcode.min.js"></script> <script src="<%=resource%>/qrcode.min.js"></script>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[

View File

@ -2159,7 +2159,7 @@ ISP_DNS=$(cat $RESOLVFILE 2>/dev/null | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9
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_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 ::)
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') 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' ',') [ -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/,$//')
LOCAL_DNS="${DEFAULT_DNS:-119.29.29.29,223.5.5.5}" LOCAL_DNS="${DEFAULT_DNS:-119.29.29.29,223.5.5.5}"
IPT_APPEND_DNS=${LOCAL_DNS} IPT_APPEND_DNS=${LOCAL_DNS}

View File

@ -33,7 +33,7 @@ index 99c620f..ba84fc9 100644
if code ~= 0 then if code ~= 0 then
local use_time = luci.sys.exec("echo -n '" .. result .. "' | awk -F ':' '{print $2}'") local use_time = luci.sys.exec("echo -n '" .. result .. "' | awk -F ':' '{print $2}'")
diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
index 4168039..c4321b5 100644 index 620f3f5..1b62d0b 100644
--- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
+++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
@@ -492,6 +492,12 @@ o:value("9.9.9.9", "9.9.9.9 (Quad9)") @@ -492,6 +492,12 @@ o:value("9.9.9.9", "9.9.9.9 (Quad9)")
@ -57,7 +57,7 @@ index 4168039..c4321b5 100644
+o.default = "0" +o.default = "0"
o.rmempty = false o.rmempty = false
if (m.uci:get(appname, "@global_forwarding[0]", "use_nft") or "0") == "1" then if (m:get("@global_forwarding[0]", "use_nft") or "0") == "1" then
diff --git a/luci-app-passwall/luasrc/view/passwall/global/status.htm b/luci-app-passwall/luasrc/view/passwall/global/status.htm diff --git a/luci-app-passwall/luasrc/view/passwall/global/status.htm b/luci-app-passwall/luasrc/view/passwall/global/status.htm
index e8d76ec..a872950 100644 index e8d76ec..a872950 100644
--- a/luci-app-passwall/luasrc/view/passwall/global/status.htm --- a/luci-app-passwall/luasrc/view/passwall/global/status.htm