luci-app-passwall: sync upstream

last commit: 87c3d9b830
This commit is contained in:
actions 2024-05-02 14:30:05 +08:00
parent fab733c71c
commit 895cb86141
4 changed files with 19 additions and 38 deletions

View File

@ -174,33 +174,20 @@ if has_xray then
o.default = "10-20"
o:depends("fragment", true)
o = s_xray:option(Flag, "sniffing", translate("Sniffing"), translate("When using the shunt, this option will be forced to be enabled."))
o.default = 1
o.rmempty = false
if has_xray then
o = s_xray:option(Flag, "route_only", translate("Sniffing Route Only"))
o = s_xray:option(Flag, "sniffing_override_dest", translate("Override the connection destination address"), translate("Override the connection destination address with the sniffed domain."))
o.default = 0
o:depends("sniffing", true)
local domains_excluded = string.format("/usr/share/%s/rules/domains_excluded", appname)
o = s_xray:option(TextValue, "no_sniffing_hosts", translate("No Sniffing Lists"), translate("Hosts added into No Sniffing Lists will not resolve again on server."))
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.rows = 15
o.wrap = "off"
o.cfgvalue = function(self, section) return fs.readfile(domains_excluded) or "" end
o.write = function(self, section, value) fs.writefile(domains_excluded, value:gsub("\r\n", "\n")) end
o.remove = function(self, section)
local route_only_value = s_xray.fields["route_only"] and s_xray.fields["route_only"]:formvalue(section) or nil
if not route_only_value or route_only_value == "0" then
fs.writefile(domains_excluded, "")
end
end
o:depends({sniffing = true, route_only = false})
o:depends({sniffing_override_dest = true})
o = s_xray:option(Value, "buffer_size", translate("Buffer Size"), translate("Buffer size for every connection (kB)"))
o.datatype = "uinteger"
end
end
if has_singbox then
s = m:section(TypedSection, "global_singbox", "Sing-Box " .. translate("Settings"))

View File

@ -616,11 +616,11 @@ function gen_config(var)
settings = {network = "tcp,udp", followRedirect = true},
streamSettings = {sockopt = {tproxy = "tproxy"}},
sniffing = {
enabled = xray_settings.sniffing == "1" or node.protocol == "_shunt",
enabled = xray_settings.sniffing_override_dest == "1" or node.protocol == "_shunt",
destOverride = {"http", "tls", "quic"},
metadataOnly = false,
routeOnly = (xray_settings.sniffing == "1" and xray_settings.route_only == "1") or (xray_settings.sniffing == "0" and node.protocol == "_shunt"),
domainsExcluded = (xray_settings.sniffing == "1" and xray_settings.route_only == "0") and get_domain_excluded() or nil
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
}
}

View File

@ -691,12 +691,6 @@ msgstr "劫持ICMPv6 (IPv6 PING)"
msgid "Sniffing"
msgstr "流量嗅探"
msgid "When using the shunt, this option will be forced to be enabled."
msgstr "使用分流时,将强制启用此选项。"
msgid "Sniffing Route Only"
msgstr "流量嗅探仅供路由使用"
msgid "TCP Proxy Way"
msgstr "TCP 代理方式"
@ -1501,11 +1495,11 @@ msgstr "无子连接时的健康检查"
msgid "Initial Windows Size"
msgstr "初始窗口大小"
msgid "No Sniffing Lists"
msgstr "不进行流量嗅探的域名列表"
msgid "Excluded Domains"
msgstr "排除域名"
msgid "Hosts added into No Sniffing Lists will not resolve again on server."
msgstr "加入的域名不会再次在服务器解析。"
msgid "If the traffic sniffing result is in this list, the destination address will not be overridden."
msgstr "如果流量嗅探结果在此列表中,则不会覆盖目标地址。"
msgid "Buffer Size"
msgstr "缓冲区大小"

View File

@ -145,7 +145,7 @@ index 55bb691..e13625a 100644
s = m:section(NamedSection, arg[1])
s.addremove = false
diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua
index 4dd6967..2068b06 100644
index 72997c3..04b70f3 100644
--- a/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua
+++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua
@@ -11,7 +11,6 @@ local port_validate = function(self, value, t)