diff --git a/luci-app-passwall2/Makefile b/luci-app-passwall2/Makefile index f473ed261..cfcfe3629 100644 --- a/luci-app-passwall2/Makefile +++ b/luci-app-passwall2/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall2 -PKG_VERSION:=1.26-1 +PKG_VERSION:=1.26-2 PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua index d605ce27f..11c4b4a1e 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua @@ -237,8 +237,7 @@ o = s:option(Value, "remote_dns_client_ip", translate("Remote DNS EDNS Client Su o.description = translate("Notify the DNS server when the DNS query is notified, the location of the client (cannot be a private IP address).") .. "
" .. translate("This feature requires the DNS server to support the Edns Client Subnet (RFC7871).") o.datatype = "ipaddr" -o:depends("remote_dns_protocol", "tcp") -o:depends("remote_dns_protocol", "doh") +o:depends({ __hide = true }) o = s:option(ListValue, "remote_dns_detour", translate("Remote DNS Outbound")) o.default = "remote" @@ -264,11 +263,26 @@ o:depends("remote_dns_protocol", "tcp") o:depends("remote_dns_protocol", "doh") o:depends("remote_dns_protocol", "udp") -hosts = s:option(TextValue, "dns_hosts", translate("Domain Override")) -hosts.rows = 5 -hosts.wrap = "off" -hosts:depends("remote_dns_protocol", "tcp") -hosts:depends("remote_dns_protocol", "doh") -hosts:depends("remote_dns_protocol", "udp") +o = s:option(TextValue, "dns_hosts", translate("Domain Override")) +o.rows = 5 +o.wrap = "off" +o:depends({ __hide = true }) +o.remove = function(self, section) + local node_value = node:formvalue(arg[1]) + if node_value ~= "nil" then + local node_t = m:get(node_value) or {} + if node_t.type == "Xray" then + AbstractValue.remove(self, section) + end + end +end + +for k, v in pairs(nodes_table) do + if v.type == "Xray" then + s.fields["remote_dns_client_ip"]:depends({ node = v.id, remote_dns_protocol = "tcp" }) + s.fields["remote_dns_client_ip"]:depends({ node = v.id, remote_dns_protocol = "doh" }) + s.fields["dns_hosts"]:depends({ node = v.id }) + end +end return m diff --git a/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua b/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua index 0182d7141..d5d63bfc8 100644 --- a/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua +++ b/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua @@ -1201,7 +1201,7 @@ function gen_config(var) if node.iface then outbound = { type = "direct", - tag = "outbound", + tag = node_id, bind_interface = node.iface, routing_mark = 255, } @@ -1236,9 +1236,8 @@ function gen_config(var) if outbound then default_outTag = outbound.tag table.insert(outbounds, outbound) + route.final = default_outTag end - - route.final = node_id end end diff --git a/luci-app-passwall2/root/usr/share/passwall2/nftables.sh b/luci-app-passwall2/root/usr/share/passwall2/nftables.sh index c59ed8809..bbd9c2470 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/nftables.sh +++ b/luci-app-passwall2/root/usr/share/passwall2/nftables.sh @@ -288,7 +288,7 @@ load_acl() { [ "$tcp_no_redir_ports" != "disable" ] && { nft "add rule inet fw4 $nft_prerouting_chain ${_ipt_source} ip protocol tcp $(factor $tcp_no_redir_ports "tcp dport") counter return comment \"$remarks\"" - nft "add rule inet fw4 PSW2_MANGLE_V6 comment ${_ipt_source} meta l4proto tcp $(factor $tcp_no_redir_ports "tcp dport") counter return comment \"$remarks\"" + nft "add rule inet fw4 PSW2_MANGLE_V6 ${_ipt_source} meta l4proto tcp $(factor $tcp_no_redir_ports "tcp dport") counter return comment \"$remarks\"" msg2="${msg2}[$?]除${tcp_no_redir_ports}外的" } msg2="${msg2}所有端口"