From 1a5cdae8860f309e6d97e6b3d478440b099a5de3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 1 May 2026 00:01:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Sync=202026-05-01=2000:01:12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hickory-dns/Makefile | 2 +- .../files/etc/hickory-dns/forwarder.toml | 9 ++-- hickory-dns/files/etc/init.d/hickory-dns | 1 - ipv6-neigh/Makefile | 2 +- ipv6-neigh/files/etc/init.d/ipv6-neigh | 2 +- luci-app-passwall/Makefile | 2 +- .../luasrc/passwall/util_sing-box.lua | 48 ++++++++++++------- .../luasrc/passwall/util_xray.lua | 12 ++--- .../root/usr/share/passwall/app.sh | 8 +++- 9 files changed, 53 insertions(+), 33 deletions(-) diff --git a/hickory-dns/Makefile b/hickory-dns/Makefile index a9084e87a..8de8a47d2 100644 --- a/hickory-dns/Makefile +++ b/hickory-dns/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hickory-dns PKG_VERSION:=0.26.0-beta.2 -PKG_RELEASE:=17 +PKG_RELEASE:=18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/hickory-dns/hickory-dns/tar.gz/v$(PKG_VERSION)? diff --git a/hickory-dns/files/etc/hickory-dns/forwarder.toml b/hickory-dns/files/etc/hickory-dns/forwarder.toml index acfce06e4..fab22508c 100644 --- a/hickory-dns/files/etc/hickory-dns/forwarder.toml +++ b/hickory-dns/files/etc/hickory-dns/forwarder.toml @@ -1,6 +1,9 @@ -listen_addrs_ipv6 = ["::1"] -listen_port = 5335 +listen_addrs_ipv6 = ["::"] +listen_addrs_ipv4 = ["0.0.0.0"] +listen_port = 53 prometheus_listen_addr = "[::]:9000" +user = "nobody" +group = "nogroup" [[zones]] zone = "lan" @@ -24,7 +27,7 @@ zone_type = "External" [[zones.stores]] type = "forward" -options = { edns0 = true, ip_strategy = "Ipv6AndIpv4", cache_size = 0, use_hosts_file = "Never", num_concurrent_reqs = 1, server_ordering_strategy = "RoundRobin" } +options = { edns0 = true, ip_strategy = "Ipv6AndIpv4", cache_size = 10240, use_hosts_file = "Never", num_concurrent_reqs = 1, server_ordering_strategy = "RoundRobin" } [[zones.stores.name_servers]] ip = "2400:3200:baba::1" diff --git a/hickory-dns/files/etc/init.d/hickory-dns b/hickory-dns/files/etc/init.d/hickory-dns index 7cf1b58ca..b1f267785 100755 --- a/hickory-dns/files/etc/init.d/hickory-dns +++ b/hickory-dns/files/etc/init.d/hickory-dns @@ -19,7 +19,6 @@ start_service() { generate_tsig_key procd_open_instance hickory-dns procd_set_param command $PROG -c $CONF -q - procd_set_param user nobody procd_set_param stdout 1 procd_set_param stderr 1 procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}" diff --git a/ipv6-neigh/Makefile b/ipv6-neigh/Makefile index ab205ce04..dbdd198c8 100644 --- a/ipv6-neigh/Makefile +++ b/ipv6-neigh/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ipv6-neigh PKG_VERSION:=0.1.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_BUILD_DEPENDS:=rust/host PKG_BUILD_PARALLEL:=1 diff --git a/ipv6-neigh/files/etc/init.d/ipv6-neigh b/ipv6-neigh/files/etc/init.d/ipv6-neigh index 988a281b4..f50a996f4 100644 --- a/ipv6-neigh/files/etc/init.d/ipv6-neigh +++ b/ipv6-neigh/files/etc/init.d/ipv6-neigh @@ -8,7 +8,7 @@ PROG=/usr/bin/ipv6-neigh start_service() { procd_open_instance ipv6-neigh - procd_set_param command $PROG -p -d "[::1]:5335" -z lan + procd_set_param command $PROG -p -d "[::1]:53" -z lan procd_set_param stdout 1 procd_set_param stderr 1 procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}" diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index 829fd5897..71596a3f2 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=26.4.15 -PKG_RELEASE:=104 +PKG_RELEASE:=105 PKG_PO_VERSION:=$(PKG_VERSION) PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index c4c05f00d..374e5628e 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -9,7 +9,7 @@ local split = api.split local ech_domain = {} local local_version = api.get_app_version("sing-box"):match("[^v]+") -local version_ge_1_13_0 = api.compare_versions(local_version, ">=", "1.13.0") +local version_ge_1_14_0 = api.compare_versions(local_version, ">=", "1.14.0") local GLOBAL = { DNS_SERVER = {}, @@ -1464,7 +1464,7 @@ function gen_config(var) rules = {} - if node.protocol == "_shunt" then + if node and node.protocol == "_shunt" then inner_fakedns = node.fakedns or "0" local function gen_shunt_node(rule_name, _node_id) @@ -1706,7 +1706,8 @@ function gen_config(var) end end) else - COMMON.default_outbound_tag = gen_outbound_get_tag(flag, node, nil, { + local _node = node or node_id + COMMON.default_outbound_tag = gen_outbound_get_tag(flag, _node, nil, { fragment = singbox_settings.fragment == "1" or nil, record_fragment = singbox_settings.record_fragment == "1" or nil, run_socks_instance = not no_run @@ -1780,19 +1781,9 @@ function gen_config(var) end if api.datatypes.hostname(remote_dns_doh_host) then if remote_dns_doh_ip and remote_dns_doh_host ~= remote_dns_doh_ip and api.is_ip(remote_dns_doh_ip) then - local hosts_server = { - tag = "hosts", - type = "hosts", - predefined = {} - } - hosts_server.predefined[remote_dns_doh_host] = remote_dns_doh_ip + if not hosts_predefined then hosts_predefined = {} end + hosts_predefined[remote_dns_doh_host] = remote_dns_doh_ip remote_server_domain_resolver = "hosts" - table.insert(dns.servers, hosts_server) - table.insert(dns.rules, { - query_type = { "A", "AAAA" }, - domain = { remote_dns_doh_host }, - server = "hosts" - }) else GLOBAL.DNS_HOSTNAME[remote_dns_doh_host] = true remote_server_domain_resolver = "direct" @@ -1975,9 +1966,10 @@ function gen_config(var) } end + if not dns.rules then dns.rules = {} end + for i, v in pairs(GLOBAL.DNS_SERVER) do table.insert(dns.servers, v.server) - if not dns.rules then dns.rules = {} end table.insert(dns.rules, 1, { action = "route", server = v.server.tag, @@ -1990,7 +1982,6 @@ function gen_config(var) for line, _ in pairs(GLOBAL.DNS_HOSTNAME) do table.insert(hostname, line) end - if not dns.rules then dns.rules = {} end table.insert(dns.rules, 1, { query_type = { "A", "AAAA" }, domain = hostname, @@ -2004,7 +1995,6 @@ function gen_config(var) type = "https", server = "223.5.5.5" }) - if not dns.rules then dns.rules = {} end local domain = {} for line, _ in pairs(ech_domain) do domain[#domain+1] = line end table.insert(dns.rules, 1, { @@ -2013,6 +2003,28 @@ function gen_config(var) }) end + table.insert(dns.servers, { + tag = "hosts", + type = "hosts", + predefined = (hosts_predefined and next(hosts_predefined) ~= nil) and hosts_predefined or nil + }) + if not version_ge_1_14_0 then + table.insert(dns.rules, 1, { + ip_accept_any = true, + server = "hosts" + }) + else + table.insert(dns.rules, 1, { + action = "evaluate", + server = "hosts" + }) + table.insert(dns.rules, 2, { + match_response = true, + ip_accept_any = true, + action = "respond" + }) + end + if COMMON.default_outbound_tag == "block" then route.final = nil table.insert(route.rules, { diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index 9adc858d5..00b05d070 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -858,9 +858,8 @@ function gen_config(var) } or nil end - local node = node_id and uci:get_all(appname, node_id) or nil - if node_id then + local node = uci:get_all(appname, node_id) local balancers = {} local rules = {} if node then @@ -877,7 +876,7 @@ function gen_config(var) protocol = "socks", settings = {auth = "noauth", udp = true}, sniffing = { - enabled = xray_settings.sniffing_override_dest == "1" or node.protocol == "_shunt" + enabled = (xray_settings.sniffing_override_dest == "1") or (node and node.protocol == "_shunt") or false } } if inbound.sniffing.enabled == true then @@ -1265,7 +1264,7 @@ function gen_config(var) end end - if node.protocol == "_shunt" then + if node and node.protocol == "_shunt" then inner_fakedns = node.fakedns or "0" local function gen_shunt_node(rule_name, _node_id) @@ -1425,7 +1424,8 @@ function gen_config(var) rules = rules } else - COMMON.default_outbound_tag = gen_outbound_get_tag(flag, node, nil, { + local _node = node or node_id + COMMON.default_outbound_tag = gen_outbound_get_tag(flag, _node, nil, { fragment = xray_settings.fragment == "1" or nil, noise = xray_settings.noise == "1" or nil, run_socks_instance = not no_run @@ -1451,7 +1451,7 @@ function gen_config(var) settings = {network = "tcp,udp", followRedirect = true}, streamSettings = {sockopt = {tproxy = "tproxy"}}, sniffing = { - enabled = xray_settings.sniffing_override_dest == "1" or node.protocol == "_shunt" + enabled = (xray_settings.sniffing_override_dest == "1") or (node and node.protocol == "_shunt") or false } } if inbound.sniffing.enabled == true then diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index b7b817e39..cb9e4aa6b 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -581,7 +581,13 @@ run_redir() { server_host=$(config_n_get $node address) port=$(config_n_get $node port) else - type="socks" + if [ "${DNS_MODE}" = "xray" ]; then + type="xray" + elif [ "${DNS_MODE}" = "sing-box" ]; then + type="sing-box" + else + type="socks" + fi server_host="127.0.0.1" port=$node2socks_port remarks="Socks 配置($port 端口)"