diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua index 3227e3f1..7fdb88b1 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua @@ -483,6 +483,12 @@ if has_xray then o:value("xray", "Xray") end o:depends({ _tcp_node_bool = "1", _node_sel_other = "1" }) +o.write = function(self, section, value) + if value == "dns2socks" then + m:del(section, "v2ray_dns_mode") + end + return ListValue.write(self, section, value) +end o.remove = function(self, section) local f = s.fields["tcp_node"] local id_val = f and f:formvalue(section) or "" 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 bd206b5f..49a0d62a 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua @@ -305,6 +305,12 @@ if has_xray then end o:depends({ dns_shunt = "chinadns-ng", _node_sel_other = "1" }) o:depends({ dns_shunt = "dnsmasq", _node_sel_other = "1" }) +o.write = function(self, section, value) + if value ~= "sing-box" and value ~= "xray" then + m:del(section, "v2ray_dns_mode") + end + return ListValue.write(self, section, value) +end o.remove = function(self, section) local f = s.fields["smartdns_dns_mode"] if f and f:formvalue(section) then @@ -324,6 +330,12 @@ if api.is_finded("smartdns") then o:value("xray", "Xray") end o:depends({ dns_shunt = "smartdns", _node_sel_other = "1" }) + o.write = function(self, section, value) + if value == "socks" then + m:del(section, "v2ray_dns_mode") + end + return ListValue.write(self, section, value) + end o.remove = function(self, section) local f = s.fields["dns_mode"] if f and f:formvalue(section) then diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index 1f7d8322..06c3ec07 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -226,7 +226,7 @@ function gen_outbound(flag, node, tag, proxy_table) enabled = true, disable_sni = (node.tls_disable_sni == "1") and true or false, --不要在 ClientHello 中发送服务器名称. server_name = node.tls_serverName, --用于验证返回证书上的主机名,除非设置不安全。它还包含在 ClientHello 中以支持虚拟主机,除非它是 IP 地址。 - insecure = (node.tls_allowInsecure == "1") and true or false, --接受任何服务器证书。 + insecure = node.tls_allowInsecure == "1" or (node.tls_pinSHA256 and node.tls_pinSHA256 ~= ""), --接受任何服务器证书。(兼顾 xray 的 pinnedPeerCertSha256 ) alpn = alpn, --支持的应用层协议协商列表,按优先顺序排列。如果两个对等点都支持 ALPN,则选择的协议将是此列表中的一个,如果没有相互支持的协议则连接将失败。 --min_version = "1.2", --max_version = "1.3",