From bf256aa5a77ed94115eb7496a3128733fe0b3bf3 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 14 Sep 2022 22:38:41 +0100 Subject: [PATCH 01/11] If docker version env var is set, store it in /etc/pihole/versions file for later use Signed-off-by: Adam Warner --- advanced/Scripts/updatecheck.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index 37211cc6..f003739b 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -84,4 +84,8 @@ else FTL_VERSION="$(pihole-FTL version)" addOrEditKeyValPair "${VERSION_FILE}" "FTL_VERSION" "${FTL_VERSION}" + if [[ "${PIHOLE_DOCKER_TAG}" ]]; then + addOrEditKeyValPair "${VERSION_FILE}" "DOCKER_VERSION" "${PIHOLE_DOCKER_TAG}" + fi + fi From 760325eb76f3a518b818abfb6e546284e9fa66e1 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 14 Sep 2022 22:49:37 +0100 Subject: [PATCH 02/11] Update piholeDebug to source versions file for DOCKER_VERSION instead of reading PIHOLE_DOCKER_TAG Signed-off-by: Adam Warner --- advanced/Scripts/piholeDebug.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 6543efbb..d016b24d 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -41,6 +41,9 @@ else #OVER="\r\033[K" fi +# shellcheck disable=SC1091 +. /etc/pihole/versions + OBFUSCATED_PLACEHOLDER="" # FAQ URLs for use in showing the debug log @@ -465,8 +468,8 @@ diagnose_operating_system() { # Display the current test that is running echo_current_diagnostic "Operating system" - # If the PIHOLE_DOCKER_TAG variable is set, include this information in the debug output - [ -n "${PIHOLE_DOCKER_TAG}" ] && log_write "${INFO} Pi-hole Docker Container: ${PIHOLE_DOCKER_TAG}" + # If DOCKER_VERSION is set (Sourced from /etc/pihole/versions at start of script), include this information in the debug output + [ -n "${DOCKER_VERSION}" ] && log_write "${INFO} Pi-hole Docker Container: ${DOCKER_VERSION}" # If there is a /etc/*release file, it's probably a supported operating system, so we can if ls /etc/*release 1> /dev/null 2>&1; then @@ -802,7 +805,7 @@ check_networking() { ping_gateway "6" # Skip the following check if installed in docker container. Unpriv'ed containers do not have access to the information required # to resolve the service name listening - and the container should not start if there was a port conflict anyway - [ -z "${PIHOLE_DOCKER_TAG}" ] && check_required_ports + [ -z "${DOCKER_VERSION}" ] && check_required_ports } check_x_headers() { From c1a927fff1090c9d3dcc32138ba36cc858f6bc26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 15 Sep 2022 10:59:34 +0200 Subject: [PATCH 03/11] Run test workflows on python 3.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- .github/workflows/test.yml | 4 ++-- test/setup.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 318cfcc4..7725ecc3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,10 +51,10 @@ jobs: name: Checkout repository uses: actions/checkout@v3.0.2 - - name: Set up Python 3.8 + name: Set up Python 3.10 uses: actions/setup-python@v4.2.0 with: - python-version: 3.8 + python-version: '3.10' - name: Install dependencies run: pip install -r test/requirements.txt diff --git a/test/setup.py b/test/setup.py index 0e393bc1..9f3b4b48 100644 --- a/test/setup.py +++ b/test/setup.py @@ -1,6 +1,7 @@ from setuptools import setup setup( + py_modules=[], setup_requires=['pytest-runner'], tests_require=['pytest'], ) From 8bc5b16527094ea823b4a6d536b26b7b5b2c7efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 15 Sep 2022 11:00:33 +0200 Subject: [PATCH 04/11] Set tox envlist to py3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- test/tox.centos_8.ini | 2 +- test/tox.debian_10.ini | 2 +- test/tox.debian_11.ini | 2 +- test/tox.fedora_34.ini | 2 +- test/tox.ubuntu_20.ini | 2 +- test/tox.ubuntu_22.ini | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/tox.centos_8.ini b/test/tox.centos_8.ini index e94c2433..71b147c7 100644 --- a/test/tox.centos_8.ini +++ b/test/tox.centos_8.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38 +envlist = py3 [testenv] whitelist_externals = docker diff --git a/test/tox.debian_10.ini b/test/tox.debian_10.ini index 3b182cdc..d21620dc 100644 --- a/test/tox.debian_10.ini +++ b/test/tox.debian_10.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38 +envlist = py3 [testenv] whitelist_externals = docker diff --git a/test/tox.debian_11.ini b/test/tox.debian_11.ini index c7e41a91..f2546922 100644 --- a/test/tox.debian_11.ini +++ b/test/tox.debian_11.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38 +envlist = py3 [testenv] whitelist_externals = docker diff --git a/test/tox.fedora_34.ini b/test/tox.fedora_34.ini index 26856984..f4115a66 100644 --- a/test/tox.fedora_34.ini +++ b/test/tox.fedora_34.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38 +envlist = py3 [testenv] whitelist_externals = docker diff --git a/test/tox.ubuntu_20.ini b/test/tox.ubuntu_20.ini index fb3d20d7..80fb7485 100644 --- a/test/tox.ubuntu_20.ini +++ b/test/tox.ubuntu_20.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38 +envlist = py3 [testenv] whitelist_externals = docker diff --git a/test/tox.ubuntu_22.ini b/test/tox.ubuntu_22.ini index 2a3285aa..41007a9c 100644 --- a/test/tox.ubuntu_22.ini +++ b/test/tox.ubuntu_22.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38 +envlist = py3 [testenv] whitelist_externals = docker From 3d53bda1211f29312cf722d9bd95739675c2aacf Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Thu, 15 Sep 2022 17:54:54 +0100 Subject: [PATCH 05/11] Update advanced/Scripts/updatecheck.sh Co-authored-by: yubiuser Signed-off-by: Adam Warner --- advanced/Scripts/updatecheck.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index f003739b..b1e111ae 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -84,6 +84,7 @@ else FTL_VERSION="$(pihole-FTL version)" addOrEditKeyValPair "${VERSION_FILE}" "FTL_VERSION" "${FTL_VERSION}" + # PIHOLE_DOCKER_TAG is set as env variable only on docker installations if [[ "${PIHOLE_DOCKER_TAG}" ]]; then addOrEditKeyValPair "${VERSION_FILE}" "DOCKER_VERSION" "${PIHOLE_DOCKER_TAG}" fi From 5cc317de5b4e1fee9f7db82c42996ba82c491f97 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Fri, 16 Sep 2022 02:31:52 -0300 Subject: [PATCH 06/11] Change texts after Block Page removal Signed-off-by: RD WebDesign --- advanced/Scripts/piholeDebug.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index d016b24d..fe75c4d3 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -815,7 +815,7 @@ check_x_headers() { # Similarly, it will show "X-Pi-hole: The Pi-hole Web interface is working!" if you view the header returned # when accessing the dashboard (i.e curl -I pi.hole/admin/) # server is operating correctly - echo_current_diagnostic "Dashboard and block page" + echo_current_diagnostic "Dashboard headers" # Use curl -I to get the header and parse out just the X-Pi-hole one local full_curl_output_dashboard local dashboard @@ -825,7 +825,7 @@ check_x_headers() { local dashboard_working dashboard_working="X-Pi-hole: The Pi-hole Web interface is working!" - # Same logic applies to the dashboard as above, if the X-Header matches what a working system should have, + # If the X-Header matches what a working system should have, if [[ $dashboard == "$dashboard_working" ]]; then # then we can show a success log_write "$TICK Web interface X-Header: ${COL_GREEN}${dashboard}${COL_NC}" From 7e6f81f814ddd04df1d4bad9b69c1395e95d1d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 17 Sep 2022 11:58:26 +0200 Subject: [PATCH 07/11] Add comment in lighttpd.conf how to change the server port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/lighttpd.conf.debian | 2 ++ advanced/lighttpd.conf.fedora | 2 ++ 2 files changed, 4 insertions(+) diff --git a/advanced/lighttpd.conf.debian b/advanced/lighttpd.conf.debian index 4545bb2e..21e48d6c 100644 --- a/advanced/lighttpd.conf.debian +++ b/advanced/lighttpd.conf.debian @@ -32,6 +32,8 @@ server.errorlog = "/var/log/lighttpd/error-pihole.log" server.pid-file = "/run/lighttpd.pid" server.username = "www-data" server.groupname = "www-data" +# For lighttpd version 1.4.46 or above, the port can be overwritten in `/etc/lighttpd/external.conf` using the := operator +# e.g. server.port := 8000 server.port = 80 accesslog.filename = "/var/log/lighttpd/access-pihole.log" accesslog.format = "%{%s}t|%V|%r|%s|%b" diff --git a/advanced/lighttpd.conf.fedora b/advanced/lighttpd.conf.fedora index 12930302..3da62839 100644 --- a/advanced/lighttpd.conf.fedora +++ b/advanced/lighttpd.conf.fedora @@ -33,6 +33,8 @@ server.errorlog = "/var/log/lighttpd/error-pihole.log" server.pid-file = "/run/lighttpd.pid" server.username = "lighttpd" server.groupname = "lighttpd" +# For lighttpd version 1.4.46 or above, the port can be overwritten in `/etc/lighttpd/external.conf` using the := operator +# e.g. server.port := 8000 server.port = 80 accesslog.filename = "/var/log/lighttpd/access-pihole.log" accesslog.format = "%{%s}t|%V|%r|%s|%b" From 5fe170666ab13486f31937a4aaba17d30123826d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 17 Sep 2022 10:08:40 +0000 Subject: [PATCH 08/11] Bump actions/stale from 5.1.1 to 5.2.0 Bumps [actions/stale](https://github.com/actions/stale) from 5.1.1 to 5.2.0. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v5.1.1...v5.2.0) --- updated-dependencies: - dependency-name: actions/stale dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index c0f64bb4..6b70a153 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,7 +13,7 @@ jobs: issues: write steps: - - uses: actions/stale@v5.1.1 + - uses: actions/stale@v5.2.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 30 From 40f00c6f0b41e3445e19210a9c45b7940d543914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 18 Sep 2022 09:01:22 +0200 Subject: [PATCH 09/11] Fix gravity database integrity check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/piholeDebug.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index fe75c4d3..fc4dcc52 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -1277,7 +1277,7 @@ analyze_gravity_list() { # if users want to check database integrity if [[ "${CHECK_DATABASE}" = true ]]; then - database_integrity_check "${PIHOLE_FTL_DB_FILE}" + database_integrity_check "${PIHOLE_GRAVITY_DB_FILE}" fi show_db_entries "Info table" "SELECT property,value FROM info" "20 40" From 2c3fea321bcf51616d6ab1ddac70221151f09aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 18 Sep 2022 09:10:24 +0200 Subject: [PATCH 10/11] Remove FAQ_ULA as it is unused in `core` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/piholeDebug.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index fc4dcc52..1edb1e38 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -53,7 +53,6 @@ FAQ_HARDWARE_REQUIREMENTS="${COL_CYAN}https://docs.pi-hole.net/main/prerequisite FAQ_HARDWARE_REQUIREMENTS_PORTS="${COL_CYAN}https://docs.pi-hole.net/main/prerequisites/#ports${COL_NC}" FAQ_HARDWARE_REQUIREMENTS_FIREWALLD="${COL_CYAN}https://docs.pi-hole.net/main/prerequisites/#firewalld${COL_NC}" FAQ_GATEWAY="${COL_CYAN}https://discourse.pi-hole.net/t/why-is-a-default-gateway-important-for-pi-hole/3546${COL_NC}" -FAQ_ULA="${COL_CYAN}https://discourse.pi-hole.net/t/use-ipv6-ula-addresses-for-pi-hole/2127${COL_NC}" FAQ_FTL_COMPATIBILITY="${COL_CYAN}https://github.com/pi-hole/FTL#compatibility-list${COL_NC}" FAQ_BAD_ADDRESS="${COL_CYAN}https://discourse.pi-hole.net/t/why-do-i-see-bad-address-at-in-pihole-log/3972${COL_NC}" From 60c35cb93c3799df76dd277e7fa984f679144b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 18 Sep 2022 13:08:44 +0200 Subject: [PATCH 11/11] Remove unused check_database_integrity() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/piholeDebug.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 1edb1e38..ab16d7ff 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -1339,16 +1339,6 @@ database_integrity_check(){ } -check_database_integrity() { - echo_current_diagnostic "Gravity Database" - database_permissions "${PIHOLE_GRAVITY_DB_FILE}" - database_integrity_check "${PIHOLE_GRAVITY_DB_FILE}" - - echo_current_diagnostic "Pi-hole FTL Query Database" - database_permissions "${PIHOLE_FTL_DB_FILE}" - database_integrity_check "${PIHOLE_FTL_DB_FILE}" -} - # Show a text spinner during a long process run spinner(){ # Show the spinner only if there is a tty