luci-app-passwall: sync upstream

last commit: 755a45d68d
This commit is contained in:
gitea-action 2024-12-11 18:30:20 +08:00
parent fd78cc0d49
commit c880f4c742
3 changed files with 19 additions and 7 deletions

View File

@ -180,7 +180,7 @@ if has_xray then
o = s_xray:option(Flag, "sniffing_override_dest", translate("Override the connection destination address")) o = s_xray:option(Flag, "sniffing_override_dest", translate("Override the connection destination address"))
o.default = 0 o.default = 0
o.description = translate("Override the connection destination address with the sniffed domain.<br />When enabled, traffic will match only by domain, ignoring IP rules.<br />If using shunt nodes, configure the domain shunt rules correctly.") o.description = translate("Override the connection destination address with the sniffed domain.<br />Otherwise use sniffed domain for routing only.<br />If using shunt nodes, configure the domain shunt rules correctly.")
local domains_excluded = string.format("/usr/share/%s/rules/domains_excluded", appname) local domains_excluded = string.format("/usr/share/%s/rules/domains_excluded", appname)
o = s_xray:option(TextValue, "excluded_domains", translate("Excluded Domains"), translate("If the traffic sniffing result is in this list, the destination address will not be overridden.")) o = s_xray:option(TextValue, "excluded_domains", translate("Excluded Domains"), translate("If the traffic sniffing result is in this list, the destination address will not be overridden."))

View File

@ -612,8 +612,15 @@ function gen_config(var)
port = tonumber(local_socks_port), port = tonumber(local_socks_port),
protocol = "socks", protocol = "socks",
settings = {auth = "noauth", udp = true}, settings = {auth = "noauth", udp = true},
sniffing = {enabled = true, destOverride = {"http", "tls", "quic"}} sniffing = {
enabled = xray_settings.sniffing_override_dest == "1" or node.protocol == "_shunt"
}
} }
if inbound.sniffing.enabled == true then
inbound.sniffing.destOverride = {"http", "tls", "quic"}
inbound.sniffing.routeOnly = xray_settings.sniffing_override_dest ~= "1" or nil
inbound.sniffing.domainsExcluded = xray_settings.sniffing_override_dest == "1" and get_domain_excluded() or nil
end
if local_socks_username and local_socks_password and local_socks_username ~= "" and local_socks_password ~= "" then if local_socks_username and local_socks_password and local_socks_username ~= "" and local_socks_password ~= "" then
inbound.settings.auth = "password" inbound.settings.auth = "password"
inbound.settings.accounts = { inbound.settings.accounts = {
@ -649,13 +656,15 @@ function gen_config(var)
settings = {network = "tcp,udp", followRedirect = true}, settings = {network = "tcp,udp", followRedirect = true},
streamSettings = {sockopt = {tproxy = "tproxy"}}, streamSettings = {sockopt = {tproxy = "tproxy"}},
sniffing = { sniffing = {
enabled = xray_settings.sniffing_override_dest == "1" or node.protocol == "_shunt", enabled = xray_settings.sniffing_override_dest == "1" or node.protocol == "_shunt"
destOverride = {"http", "tls", "quic"},
metadataOnly = false,
routeOnly = node.protocol == "_shunt" and xray_settings.sniffing_override_dest ~= "1" or nil,
domainsExcluded = xray_settings.sniffing_override_dest == "1" and get_domain_excluded() or nil
} }
} }
if inbound.sniffing.enabled == true then
inbound.sniffing.destOverride = {"http", "tls", "quic", (remote_dns_fake) and "fakedns"}
inbound.sniffing.metadataOnly = false
inbound.sniffing.routeOnly = xray_settings.sniffing_override_dest ~= "1" or nil
inbound.sniffing.domainsExcluded = xray_settings.sniffing_override_dest == "1" and get_domain_excluded() or nil
end
if tcp_redir_port then if tcp_redir_port then
local tcp_inbound = api.clone(inbound) local tcp_inbound = api.clone(inbound)

View File

@ -1645,6 +1645,9 @@ msgstr "握手服务器"
msgid "Handshake Server Port" msgid "Handshake Server Port"
msgstr "握手服务器端口" msgstr "握手服务器端口"
msgid "Override the connection destination address with the sniffed domain.<br />Otherwise use sniffed domain for routing only.<br />If using shunt nodes, configure the domain shunt rules correctly."
msgstr "用探测出的域名覆盖连接目标地址。<br />否则仅将探测得到的域名用于路由。<br />如使用分流节点,请正确设置域名分流规则。"
msgid "Override the connection destination address with the sniffed domain.<br />When enabled, traffic will match only by domain, ignoring IP rules.<br />If using shunt nodes, configure the domain shunt rules correctly." msgid "Override the connection destination address with the sniffed domain.<br />When enabled, traffic will match only by domain, ignoring IP rules.<br />If using shunt nodes, configure the domain shunt rules correctly."
msgstr "用探测出的域名覆盖连接目标地址。<br />启用后仅使用域名进行流量匹配将忽略IP规则。<br />如使用分流节点,请正确设置域名分流规则。" msgstr "用探测出的域名覆盖连接目标地址。<br />启用后仅使用域名进行流量匹配将忽略IP规则。<br />如使用分流节点,请正确设置域名分流规则。"