From 05088a64c47fde1a463d4a73551054528a839936 Mon Sep 17 00:00:00 2001 From: gitea-action Date: Tue, 31 Dec 2024 17:30:21 +0800 Subject: [PATCH] luci-app-passwall2: sync upstream last commit: https://github.com/xiaorouji/openwrt-passwall2/commit/234bdce2291e27c574e42cc32c070d98eb85b8d1 --- luci-app-passwall2/luasrc/passwall2/util_xray.lua | 12 +++++++++++- luci-app-passwall2/root/usr/share/passwall2/app.sh | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/luci-app-passwall2/luasrc/passwall2/util_xray.lua b/luci-app-passwall2/luasrc/passwall2/util_xray.lua index 68cc72ff4..f7dd5c35e 100644 --- a/luci-app-passwall2/luasrc/passwall2/util_xray.lua +++ b/luci-app-passwall2/luasrc/passwall2/util_xray.lua @@ -654,11 +654,21 @@ function gen_config(var) } } if inbound.sniffing.enabled == true then - inbound.sniffing.destOverride = {"http", "tls", "quic", (remote_dns_fake) and "fakedns"} + inbound.sniffing.destOverride = {"http", "tls", "quic"} 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 remote_dns_fake then + inbound.sniffing.enabled = true + if not inbound.sniffing.destOverride then + inbound.sniffing.destOverride = {"fakedns"} + inbound.sniffing.metadataOnly = true + else + table.insert(inbound.sniffing.destOverride, "fakedns") + inbound.sniffing.metadataOnly = false + end + end local tcp_inbound = api.clone(inbound) tcp_inbound.tag = "tcp_redir" diff --git a/luci-app-passwall2/root/usr/share/passwall2/app.sh b/luci-app-passwall2/root/usr/share/passwall2/app.sh index 9a3e6457a..905007dd1 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/app.sh +++ b/luci-app-passwall2/root/usr/share/passwall2/app.sh @@ -1363,7 +1363,7 @@ ISP_DNS6=$(cat $RESOLVFILE 2>/dev/null | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-F DEFAULT_DNSMASQ_CFGID=$(uci show dhcp.@dnsmasq[0] | awk -F '.' '{print $2}' | awk -F '=' '{print $1}'| head -1) DEFAULT_DNS=$(uci show dhcp.@dnsmasq[0] | grep "\.server=" | awk -F '=' '{print $2}' | sed "s/'//g" | tr ' ' '\n' | grep -v "\/" | head -2 | sed ':label;N;s/\n/,/;b label') -[ -z "${DEFAULT_DNS}" ] && DEFAULT_DNS=$(echo -n $ISP_DNS | tr ' ' '\n' | head -2 | tr '\n' ',') +[ -z "${DEFAULT_DNS}" ] && DEFAULT_DNS=$(echo -n $ISP_DNS | tr ' ' '\n' | head -2 | tr '\n' ',' | sed 's/,$//') AUTO_DNS=${DEFAULT_DNS:-119.29.29.29} DNSMASQ_CONF_DIR=/tmp/dnsmasq.d