From 1c394131072739926a558343ca91457e8ef87980 Mon Sep 17 00:00:00 2001 From: kev Date: Tue, 27 Feb 2024 19:20:48 +0800 Subject: [PATCH] update ftldns --- ftldns/Dockerfile | 13 ++++++++++--- ftldns/README.md | 21 +++++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ftldns/Dockerfile b/ftldns/Dockerfile index b1a6441..35a09d7 100644 --- a/ftldns/Dockerfile +++ b/ftldns/Dockerfile @@ -3,13 +3,12 @@ # FROM alpine:3 -#FROM debian:12-slim MAINTAINER EasyPi Software Foundation ARG FTL_VERSION=v5.25.1 ARG FTL_FILE=pihole-FTL-musl-linux-x86_64 -#ARG FTL_FILE=pihole-FTL-aarch64-linux-gnu -ARG FTL_URL=https://github.com/pi-hole/FTL/releases/download/${FTL_VERSION}/${FTL_FILE} +ARG FTL_GIT=https://github.com/pi-hole +ARG FTL_URL=${FTL_GIT}/FTL/releases/download/${FTL_VERSION}/${FTL_FILE} RUN set -xe \ && apk add --no-cache curl \ @@ -17,6 +16,14 @@ RUN set -xe \ && curl -sSL ${FTL_URL} -o /usr/bin/pihole-FTL \ && chmod +x /usr/bin/pihole-FTL \ && pihole-FTL --version \ + && mkdir -p /opt/pihole \ + && cd /opt/pihole \ + && curl -sSL -O ${FTL_GIT}/pi-hole/raw/master/advanced/Scripts/list.sh \ + -O ${FTL_GIT}/pi-hole/raw/master/advanced/Scripts/utils.sh \ + -O ${FTL_GIT}/pi-hole/raw/master/advanced/Scripts/COL_TABLE \ + && cd /usr/local/bin \ + && curl -sSL ${FTL_GIT}/pi-hole/raw/master/pihole -o /usr/local/bin/pihole \ + && chmod +x /usr/local/bin/pihole /opt/pihole/list.sh \ && apk del curl VOLUME /etc/pihole diff --git a/ftldns/README.md b/ftldns/README.md index 6f20247..dd0a687 100644 --- a/ftldns/README.md +++ b/ftldns/README.md @@ -10,10 +10,18 @@ $ docker compose up -d $ dig @127.0.0.1 -p 53 www.youtube.com -$ docker compose exec ftldns pihole-FTL sql -h gravity.db ->>> .schema domainlist ->>> insert into domainlist(type, domain) values (3, '(\.|^)youtube\.com$'); ->>> .quit +$ docker compose exec ftldns bash +>>> pihole-FTL sql -h gravity.db + .schema domainlist + insert into domainlist(type, domain) values (3, '(\.|^)youtube\.com$'); + .quit +>>> pihole-FTL regex-test www.youtube.com + Checking domain against blacklist... + (\.|^)youtube\.com$ matches (regex blacklist, DB ID 1) + Time: 0.019 msec +>>> pihole -b --regex '(\.|^)baidu\.com$' +>>> pihole-FTL regex-test www.baidu.com +>>> exit $ docker compose kill -s RTMIN ftldns @@ -28,7 +36,8 @@ $ telnet 127.0.0.1 4711 >quit ``` -> Read more about [telnet-api][2]. +> Read more about [domainlist][2] and [telnet-api][3]. [1]: https://github.com/pi-hole/FTL -[2]: https://docs.pi-hole.net/ftldns/telnet-api/ +[2]: https://docs.pi-hole.net/database/gravity/#domain-tables-domainlist +[3]: https://docs.pi-hole.net/ftldns/telnet-api/