luci-app-passwall2: sync upstream

This commit is contained in:
sbwml 2023-09-16 01:45:29 +08:00
parent c61bcce23d
commit 80b78b4035
7 changed files with 39 additions and 41 deletions

View File

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

View File

@ -433,6 +433,7 @@ if singbox_tags:find("with_quic") then
end end
if singbox_tags:find("with_grpc") then if singbox_tags:find("with_grpc") then
o:value("grpc", "gRPC") o:value("grpc", "gRPC")
else o:value("grpc", "gRPC-lite")
end end
o:depends({ [option_name("protocol")] = "vmess" }) o:depends({ [option_name("protocol")] = "vmess" })
o:depends({ [option_name("protocol")] = "vless" }) o:depends({ [option_name("protocol")] = "vless" })
@ -499,25 +500,23 @@ o = s:option(Value, option_name("ws_earlyDataHeaderName"), translate("Early data
o:depends({ [option_name("ws_enableEarlyData")] = true }) o:depends({ [option_name("ws_enableEarlyData")] = true })
-- [[ gRPC部分 ]]-- -- [[ gRPC部分 ]]--
if singbox_tags:find("with_grpc") then o = s:option(Value, option_name("grpc_serviceName"), "ServiceName")
o = s:option(Value, option_name("grpc_serviceName"), "ServiceName") o:depends({ [option_name("transport")] = "grpc" })
o:depends({ [option_name("transport")] = "grpc" })
o = s:option(Flag, option_name("grpc_health_check"), translate("Health check")) o = s:option(Flag, option_name("grpc_health_check"), translate("Health check"))
o:depends({ [option_name("transport")] = "grpc" }) o:depends({ [option_name("transport")] = "grpc" })
o = s:option(Value, option_name("grpc_idle_timeout"), translate("Idle timeout")) o = s:option(Value, option_name("grpc_idle_timeout"), translate("Idle timeout"))
o.default = "10" o.default = "10"
o:depends({ [option_name("grpc_health_check")] = true }) o:depends({ [option_name("grpc_health_check")] = true })
o = s:option(Value, option_name("grpc_health_check_timeout"), translate("Health check timeout")) o = s:option(Value, option_name("grpc_health_check_timeout"), translate("Health check timeout"))
o.default = "20" o.default = "20"
o:depends({ [option_name("grpc_health_check")] = true }) o:depends({ [option_name("grpc_health_check")] = true })
o = s:option(Flag, option_name("grpc_permit_without_stream"), translate("Permit without stream")) o = s:option(Flag, option_name("grpc_permit_without_stream"), translate("Permit without stream"))
o.default = "0" o.default = "0"
o:depends({ [option_name("grpc_health_check")] = true }) o:depends({ [option_name("grpc_health_check")] = true })
end
-- [[ Mux ]]-- -- [[ Mux ]]--
o = s:option(Flag, option_name("mux"), translate("Mux")) o = s:option(Flag, option_name("mux"), translate("Mux"))

View File

@ -10,12 +10,12 @@ function gen_config_server(node)
cert = node.tls_certificateFile, cert = node.tls_certificateFile,
key = node.tls_keyFile, key = node.tls_keyFile,
}, },
obfs = { obfs = (node.hysteria2_obfs) and {
type = "salamander", type = "salamander",
salamander = { salamander = {
password = node.hysteria2_obfs password = node.hysteria2_obfs
} }
}, } or nil,
auth = { auth = {
type = "password", type = "password",
password = node.hysteria2_auth_password password = node.hysteria2_auth_password
@ -25,7 +25,7 @@ function gen_config_server(node)
down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or "1 gbps", down = node.hysteria2_down_mbps and node.hysteria2_down_mbps .. " mbps" or "1 gbps",
}, },
ignoreClientBandwidth = (node.hysteria2_ignoreClientBandwidth == "1") and true or false, ignoreClientBandwidth = (node.hysteria2_ignoreClientBandwidth == "1") and true or false,
disable_udp = (node.hysteria2_udp == "0") and true or false, disableUDP = (node.hysteria2_udp == "0") and true or false,
} }
return config return config
end end
@ -65,12 +65,12 @@ function gen_config(var)
hopInterval = node.hysteria2_hop_interval and node.hysteria2_hop_interval .. "s" or "30s" hopInterval = node.hysteria2_hop_interval and node.hysteria2_hop_interval .. "s" or "30s"
} }
}, },
obfs = { obfs = (node.hysteria2_obfs) and {
type = "salamander", type = "salamander",
salamander = { salamander = {
password = node.hysteria2_obfs password = node.hysteria2_obfs
} }
}, } or nil,
auth = node.hysteria2_auth_password, auth = node.hysteria2_auth_password,
tls = { tls = {
sni = node.tls_serverName, sni = node.tls_serverName,
@ -92,13 +92,12 @@ function gen_config(var)
listen = local_socks_address .. ":" .. local_socks_port, listen = local_socks_address .. ":" .. local_socks_port,
username = (local_socks_username and local_socks_password) and local_socks_username or nil, username = (local_socks_username and local_socks_password) and local_socks_username or nil,
password = (local_socks_username and local_socks_password) and local_socks_password or nil, password = (local_socks_username and local_socks_password) and local_socks_password or nil,
disable_udp = false, disableUDP = false,
} or nil, } or nil,
http = (local_http_address and local_http_port) and { http = (local_http_address and local_http_port) and {
listen = local_http_address .. ":" .. local_http_port, listen = local_http_address .. ":" .. local_http_port,
username = (local_http_username and local_http_password) and local_http_username or nil, username = (local_http_username and local_http_password) and local_http_username or nil,
password = (local_http_username and local_http_password) and local_http_password or nil, password = (local_http_username and local_http_password) and local_http_password or nil,
disable_udp = false,
} or nil } or nil
} }

View File

@ -398,7 +398,7 @@ function gen_config_server(node)
if node.transport == "grpc" then if node.transport == "grpc" then
v2ray_transport = { v2ray_transport = {
type = "grpc", type = "grpc",
serviceName = node.grpc_serviceName, service_name = node.grpc_serviceName,
} }
end end

View File

@ -32,10 +32,10 @@ local api = require "luci.passwall2.api"
<div id="faq_dns"> <div id="faq_dns">
<ul> <ul>
<b class="faq-title"><%:DNS related issues:%></b> <b class="faq-title"><%:DNS related issues:%></b>
<li class="dns-item">1. <span><%:Certain browsers such as Chrome have built-in DNS service, which may affect DNS resolution settings. You can go to "Settings -> Privacy and security -> Use secure DNS" menu to turn it off.%></span></li> <li class="dns-item">1. <span><%:Certain browsers such as Chrome have built-in DNS service, which may affect DNS resolution settings. You can go to 'Settings -> Privacy and security -> Use secure DNS' menu to turn it off.%></span></li>
<li class="dns-item">2. <span><%:If you are unable to access the internet after reboot, please try clearing the cache of your terminal devices (make sure to close all open browser application windows first, this step is especially important):%></span> <li class="dns-item">2. <span><%:If you are unable to access the internet after reboot, please try clearing the cache of your terminal devices (make sure to close all open browser application windows first, this step is especially important):%></span>
<ul><li class="dns-list"><span><%:For Windows systems, open Command Prompt and run the command "ipconfig /flushdns".%></span></li> <ul><li class="dns-list"><span><%:For Windows systems, open Command Prompt and run the command 'ipconfig /flushdns'.%></span></li>
<li class="dns-list"><span><%:For Mac systems, open Terminal and run the command "sudo killall -HUP mDNSResponder".%></span></li> <li class="dns-list"><span><%:For Mac systems, open Terminal and run the command 'sudo killall -HUP mDNSResponder'.%></span></li>
<li class="dns-list"><span><%:For mobile devices, you can clear it by reconnecting to the network, such as toggling Airplane Mode and reconnecting to WiFi.%></span></li> <li class="dns-list"><span><%:For mobile devices, you can clear it by reconnecting to the network, such as toggling Airplane Mode and reconnecting to WiFi.%></span></li>
</ul> </ul>
</li> </li>

View File

@ -190,17 +190,17 @@ msgstr "你确定要隐藏吗?"
msgid "DNS related issues:" msgid "DNS related issues:"
msgstr "DNS相关问题" msgstr "DNS相关问题"
msgid "Certain browsers such as Chrome have built-in DNS service, which may affect DNS resolution settings. You can go to "Settings -> Privacy and security -> Use secure DNS" menu to turn it off." msgid "Certain browsers such as Chrome have built-in DNS service, which may affect DNS resolution settings. You can go to 'Settings -> Privacy and security -> Use secure DNS' menu to turn it off."
msgstr "某些浏览器如Chrome等内置此功能,这会影响设置的DNS解析。您可以进入"设置->私隐和安全->使用安全DNS"菜单,将其关闭。" msgstr "某些浏览器如Chrome等内置此功能,这会影响设置的DNS解析。您可以进入 '设置->私隐和安全->使用安全DNS' 菜单,将其关闭。"
msgid "If you are unable to access the internet after reboot, please try clearing the cache of your terminal devices (make sure to close all open browser application windows first, this step is especially important):" msgid "If you are unable to access the internet after reboot, please try clearing the cache of your terminal devices (make sure to close all open browser application windows first, this step is especially important):"
msgstr "如果在重启后无法上网,请尝试清除终端设备的缓存(先关闭所有正在使用的浏览器应用程序,这一步尤其重要):" msgstr "如果在重启后无法上网,请尝试清除终端设备的缓存(先关闭所有正在使用的浏览器应用程序,这一步尤其重要):"
msgid "For Windows systems, open Command Prompt and run the command "ipconfig /flushdns"." msgid "For Windows systems, open Command Prompt and run the command 'ipconfig /flushdns'."
msgstr "对于Windows系统,请在命令提示符中运行命令"ipconfig /flushdns"." msgstr "对于Windows系统,请在命令提示符中运行命令 'ipconfig /flushdns'."
msgid "For Mac systems, open Terminal and run the command "sudo killall -HUP mDNSResponder"." msgid "For Mac systems, open Terminal and run the command 'sudo killall -HUP mDNSResponder'."
msgstr "对于Mac系统在终端中运行命令"sudo killall -HUP mDNSResponder"." msgstr "对于Mac系统在终端中运行命令 'sudo killall -HUP mDNSResponder'."
msgid "For mobile devices, you can clear it by reconnecting to the network, such as toggling Airplane Mode and reconnecting to WiFi." msgid "For mobile devices, you can clear it by reconnecting to the network, such as toggling Airplane Mode and reconnecting to WiFi."
msgstr "对于移动设备,可通过重新接入网络的方式清除。比如开关一次飞行模式,重新连接WiFi。" msgstr "对于移动设备,可通过重新接入网络的方式清除。比如开关一次飞行模式,重新连接WiFi。"

View File

@ -1129,25 +1129,25 @@ start() {
local use_nft=$(config_t_get global_forwarding use_nft 0) local use_nft=$(config_t_get global_forwarding use_nft 0)
local USE_TABLES local USE_TABLES
if [ "$use_nft" == 0 ]; then if [ "$use_nft" == 0 ]; then
if [ -z "$(command -v iptables-legacy || command -v iptables)" ] || [ -z "$(command -v ipset)" ] || [ -z "$(dnsmasq --version | grep 'Compile time options:.* ipset')" ]; then if [ -n "$(command -v iptables-legacy || command -v iptables)" ] && [ -n "$(command -v ipset)" ] && [ -n "$(dnsmasq --version | grep 'Compile time options:.* ipset')" ]; then
if [ -n "$(command -v nft)" ] && [ -n "$(dnsmasq --version | grep 'Compile time options:.* nftset')" ]; then USE_TABLES="iptables"
else
if [ -n "$(command -v fw4)" ] && [ -n "$(command -v nft)" ] && [ -n "$(dnsmasq --version | grep 'Compile time options:.* nftset')" ]; then
echolog "检测到fw4使用nftables进行透明代理。" echolog "检测到fw4使用nftables进行透明代理。"
USE_TABLES="nftables" USE_TABLES="nftables"
nftflag=1 nftflag=1
config_t_set global_forwarding use_nft 1 config_t_set global_forwarding use_nft 1
uci commit uci commit ${CONFIG}
else else
echolog "系统未安装iptables或ipset或Dnsmasq没有开启ipset支持无法透明代理" echolog "系统未安装iptables或ipset或Dnsmasq没有开启ipset支持无法透明代理"
fi fi
else
USE_TABLES="iptables"
fi fi
else else
if [ -z "$(dnsmasq --version | grep 'Compile time options:.* nftset')" ]; then if [ -n "$(dnsmasq --version | grep 'Compile time options:.* nftset')" ]; then
echolog "Dnsmasq软件包不满足nftables透明代理要求如需使用请确保dnsmasq版本在2.87以上并开启nftset支持。"
elif [ -n "$(dnsmasq --version | grep 'Compile time options:.* nftset')" ]; then
USE_TABLES="nftables" USE_TABLES="nftables"
nftflag=1 nftflag=1
else
echolog "Dnsmasq软件包不满足nftables透明代理要求如需使用请确保dnsmasq版本在2.87以上并开启nftset支持。"
fi fi
fi fi