From dc49949a23538c771e412fef12a0108e131f0774 Mon Sep 17 00:00:00 2001 From: kissshot <4530897+kkkgo@users.noreply.github.com> Date: Mon, 20 May 2024 01:00:05 +0800 Subject: [PATCH] add flushd fea.(dev) --- build_test.sh | 7 +++++++ prebuild-paopaodns/build.sh | 5 +++-- src/init.sh | 1 + src/mosdns.yaml | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build_test.sh b/build_test.sh index 0e33dcd..ee07bbf 100644 --- a/build_test.sh +++ b/build_test.sh @@ -48,6 +48,13 @@ if docker exec test1 mosdns curl http://127.0.0.1:7889 | grep -q Country-only-cn else exit fi +docker exec test1 apk add socat +docker exec test1 sh -c "echo 'example.com' | socat - UNIX-CONNECT:/tmp/flush.sock && echo flush_ok_flag >>/etc/os-release" +if docker exec test1 cat /etc/os-release | grep -q flush_ok_flag; then + echo flush_ok_flag pass. +else + exit +fi docker rm -f test1 docker run --name test2 \ -e USE_MARK_DATA=yes \ diff --git a/prebuild-paopaodns/build.sh b/prebuild-paopaodns/build.sh index 89e5c5b..666a19f 100644 --- a/prebuild-paopaodns/build.sh +++ b/prebuild-paopaodns/build.sh @@ -6,14 +6,15 @@ apk upgrade apk add build-base flex byacc musl-dev gcc make git python3-dev swig libevent-dev openssl-dev expat-dev hiredis-dev go grep bind-tools # build unbound -git clone https://github.com/NLnetLabs/unbound.git --depth 1 /unbound -b release-1.19.3 +#git clone https://github.com/NLnetLabs/unbound.git --depth 1 /unbound -b release-1.19.3 +git clone https://github.com/NLnetLabs/unbound.git --depth 1 /unbound cd /unbound || exit export CFLAGS="-O3" ./configure --with-libevent --with-pthreads --with-libhiredis --enable-cachedb \ --disable-rpath --without-pythonmodule --disable-documentation \ --disable-flto --disable-maintainer-mode --disable-option-checking --disable-rpath \ --with-pidfile=/tmp/unbound.pid \ - --prefix=/usr --sysconfdir=/etc --localstatedir=/tmp --with-username=root + --prefix=/usr --sysconfdir=/etc --localstatedir=/tmp --with-username=root --with-chroot-dir="" make make install mv /usr/sbin/unbound /src/ diff --git a/src/init.sh b/src/init.sh index be02c5e..967061c 100644 --- a/src/init.sh +++ b/src/init.sh @@ -311,6 +311,7 @@ if [ "$CNAUTO" != "no" ]; then fi if [ "$CNFALL" = "yes" ]; then sed -i "s/#cnfall//g" /tmp/mosdns.yaml + sed -i "s/#flushd_un_yes//g" /tmp/mosdns.yaml else sed -i "s/#nofall//g" /tmp/mosdns.yaml fi diff --git a/src/mosdns.yaml b/src/mosdns.yaml index 2926cee..1c4ee2c 100644 --- a/src/mosdns.yaml +++ b/src/mosdns.yaml @@ -325,5 +325,7 @@ plugins: entry: check_cache listen: :53 idle_timeout: 5 +#flushd_un_yes - tag: "flushd_server" +#flushd_un_yes type: "flushd_server" #http_file_yes - tag: "httpd_server" #http_file_yes type: "httpd_server" \ No newline at end of file