From 3956ca49b66eb12208d9a31e2dc1673285186ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 18 Oct 2024 20:19:02 +0200 Subject: [PATCH 01/14] Don't attempt writing to pihole.toml if file does not exit. FTL needs to be started first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 4852929c..ec09b8ed 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2367,15 +2367,6 @@ main() { pihole -a -p "${pw}" fi - # write privacy level and logging to pihole.toml - # set on fresh installations by setPrivacyLevel() and setLogging( - if [ -n "${QUERY_LOGGING}" ]; then - pihole-FTL --config dns.queryLogging "${QUERY_LOGGING}" - fi - if [ -n "${PRIVACY_LEVEL}" ]; then - pihole-FTL --config misc.privacylevel "${PRIVACY_LEVEL}" - fi - # Migrate existing install to v6.0 migrate_dnsmasq_configs @@ -2401,6 +2392,16 @@ main() { restart_service pihole-FTL + # write privacy level and logging to pihole.toml + # needs to be done after FTL service has been started, otherwise pihole.toml does not exist + # set on fresh installations by setPrivacyLevel() and setLogging( + if [ -n "${QUERY_LOGGING}" ]; then + pihole-FTL --config dns.queryLogging "${QUERY_LOGGING}" + fi + if [ -n "${PRIVACY_LEVEL}" ]; then + pihole-FTL --config misc.privacylevel "${PRIVACY_LEVEL}" + fi + # Download and compile the aggregated block list runGravity From 6e905a7f80d2bcfb0f39095536a47b6b9a368bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 18 Oct 2024 20:22:13 +0200 Subject: [PATCH 02/14] Use setFTLConfigValue to set privacy level and logging. The function is sourced already at this point from utils.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index ec09b8ed..34e77ea0 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2396,10 +2396,10 @@ main() { # needs to be done after FTL service has been started, otherwise pihole.toml does not exist # set on fresh installations by setPrivacyLevel() and setLogging( if [ -n "${QUERY_LOGGING}" ]; then - pihole-FTL --config dns.queryLogging "${QUERY_LOGGING}" + setFTLConfigValue "dns.queryLogging" "${QUERY_LOGGING}" fi if [ -n "${PRIVACY_LEVEL}" ]; then - pihole-FTL --config misc.privacylevel "${PRIVACY_LEVEL}" + setFTLConfigValue "misc.privacylevel" "${PRIVACY_LEVEL}" fi # Download and compile the aggregated block list From 1ad135ad697fd0d4cf5df0b26014508356a643a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 18 Oct 2024 21:26:18 +0200 Subject: [PATCH 03/14] Do not print FTL update check details on pihole -up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index 2ccad27c..e4f784ba 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -144,7 +144,7 @@ main() { local binary binary="pihole-FTL${funcOutput##*pihole-FTL}" #binary name will be the last line of the output of get_binary_name (it always begins with pihole-FTL) - if FTLcheckUpdate "${binary}"; then + if FTLcheckUpdate "${binary}" &>/dev/null; then FTL_update=true echo -e " ${INFO} FTL:\\t\\t${COL_YELLOW}update available${COL_NC}" else From 2fd51bd244291d59c87a4b4dc184a2586f4ff2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 18 Oct 2024 23:00:31 +0200 Subject: [PATCH 04/14] Fix gavity version 19 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Templates/gravity.db.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Templates/gravity.db.sql b/advanced/Templates/gravity.db.sql index 9782a044..5436fb87 100644 --- a/advanced/Templates/gravity.db.sql +++ b/advanced/Templates/gravity.db.sql @@ -66,7 +66,7 @@ CREATE TABLE info value TEXT NOT NULL ); -INSERT INTO "info" VALUES('version','18'); +INSERT INTO "info" VALUES('version','19'); CREATE TABLE domain_audit ( From 8c39365db164e294b208f931bce4e2945fa3d602 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Oct 2024 10:32:25 +0000 Subject: [PATCH 05/14] Bump tox from 4.21.2 to 4.23.0 in /test Bumps [tox](https://github.com/tox-dev/tox) from 4.21.2 to 4.23.0. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.21.2...4.23.0) --- updated-dependencies: - dependency-name: tox dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- test/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/requirements.txt b/test/requirements.txt index 903a6acc..5b28d6f3 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -2,5 +2,5 @@ pyyaml == 6.0.2 pytest == 8.3.3 pytest-xdist == 3.6.1 pytest-testinfra == 10.1.1 -tox == 4.21.2 +tox == 4.23.0 pytest-clarity == 1.0.1 From 7ae0b207fc64c306a57c2fadfa0209dadd655dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 20 Oct 2024 09:34:15 +0200 Subject: [PATCH 06/14] Exit 1 if update script failed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/update.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index e4f784ba..72ba294e 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -38,10 +38,13 @@ GitCheckUpdateAvail() { local curBranch directory="${1}" curdir=$PWD - cd "${directory}" || return + cd "${directory}" || exit 1 # Fetch latest changes in this repo - git fetch --quiet origin + if ! git fetch --quiet origin ; then + echo -e "\\n ${COL_LIGHT_RED}Error: Unable to update local repository. Contact Pi-hole Support.${COL_NC}" + exit 1 + fi # Check current branch. If it is master, then check for the latest available tag instead of latest commit. curBranch=$(git rev-parse --abbrev-ref HEAD) @@ -71,17 +74,17 @@ GitCheckUpdateAvail() { echo -e "\\n ${COL_LIGHT_RED}Error: Local revision could not be obtained, please contact Pi-hole Support" echo -e " Additional debugging output:${COL_NC}" git status - exit + exit 1 fi if [[ "${#REMOTE}" == 0 ]]; then echo -e "\\n ${COL_LIGHT_RED}Error: Remote revision could not be obtained, please contact Pi-hole Support" echo -e " Additional debugging output:${COL_NC}" git status - exit + exit 1 fi # Change back to original directory - cd "${curdir}" || exit + cd "${curdir}" || exit 1 if [[ "${LOCAL}" != "${REMOTE}" ]]; then # Local branch is behind remote branch -> Update From 8bf6480aed03f2ee2ee359064746c369af8d2de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 20 Oct 2024 09:36:28 +0200 Subject: [PATCH 07/14] Set exit code explicitly everywhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/list.sh | 2 +- automated install/basic-install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index 8c930f04..5c57f878 100755 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -192,7 +192,7 @@ GetComment() { comment="$1" if [[ "${comment}" =~ [^a-zA-Z0-9_\#:/\.,\ -] ]]; then echo " ${CROSS} Found invalid characters in domain comment!" - exit + exit 1 fi } diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 4852929c..18bccab1 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -409,7 +409,7 @@ package_manager_detect() { # we cannot install required packages printf " %b No supported package manager found\\n" "${CROSS}" # so exit the installer - exit + exit 1 fi } From 0e7706ffa36c89051b7725209b8e9b8c2e390149 Mon Sep 17 00:00:00 2001 From: Sebastian Dinator Date: Thu, 24 Oct 2024 02:05:13 -0300 Subject: [PATCH 08/14] Improved error message for invalid protocol in adlist download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastian Dinator Signed-off-by: Sebastián Dinator --- gravity.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 6a4fb88e..f98ecdcf 100755 --- a/gravity.sh +++ b/gravity.sh @@ -598,7 +598,9 @@ gravity_DownloadBlocklistFromUrl() { # Check for allowed protocols if [[ $url != "http"* && $url != "https"* && $url != "file"* && $url != "ftp"* && $url != "ftps"* && $url != "sftp"* ]]; then - echo -e "${OVER} ${CROSS} ${str} Invalid protocol specified, ignoring list" + echo -e "${OVER} ${CROSS} ${str} Invalid protocol specified. Ignoring list." + echo -e " Ensure your URL starts with a valid protocol like http:// or https:// ." + echo -e " E.g., try http://localhost/adblock.txt instead of localhost/adblock.txt." download=false fi From 5589fa171cf3b519950e9d3364a70cd7744cc138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Dinator?= Date: Thu, 24 Oct 2024 14:03:02 -0300 Subject: [PATCH 09/14] Remove example from error message on invalid protocol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastián Dinator --- gravity.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index f98ecdcf..a657727d 100755 --- a/gravity.sh +++ b/gravity.sh @@ -599,8 +599,7 @@ gravity_DownloadBlocklistFromUrl() { # Check for allowed protocols if [[ $url != "http"* && $url != "https"* && $url != "file"* && $url != "ftp"* && $url != "ftps"* && $url != "sftp"* ]]; then echo -e "${OVER} ${CROSS} ${str} Invalid protocol specified. Ignoring list." - echo -e " Ensure your URL starts with a valid protocol like http:// or https:// ." - echo -e " E.g., try http://localhost/adblock.txt instead of localhost/adblock.txt." + echo -e "Ensure your URL starts with a valid protocol like http:// , https:// or file:// ." download=false fi From 8acfa029d94927972f3b11da997d4d15e2c543c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 26 Oct 2024 10:07:38 +0000 Subject: [PATCH 10/14] Bump actions/checkout from 4.2.1 to 4.2.2 Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4.2.1...v4.2.2) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/stale.yml | 2 +- .github/workflows/sync-back-to-dev.yml | 2 +- .github/workflows/test.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 21f6c075..77aacbec 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4.2.1 + uses: actions/checkout@v4.2.2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 8faba669..724c29d4 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.2.1 + uses: actions/checkout@v4.2.2 - name: Remove 'stale' label run: gh issue edit ${{ github.event.issue.number }} --remove-label ${{ env.stale_label }} env: diff --git a/.github/workflows/sync-back-to-dev.yml b/.github/workflows/sync-back-to-dev.yml index 066a6a1d..7df1a32d 100644 --- a/.github/workflows/sync-back-to-dev.yml +++ b/.github/workflows/sync-back-to-dev.yml @@ -33,7 +33,7 @@ jobs: name: Syncing branches steps: - name: Checkout - uses: actions/checkout@v4.2.1 + uses: actions/checkout@v4.2.2 - name: Opening pull request run: gh pr create -B development -H master --title 'Sync master back into development' --body 'Created by Github action' --label 'internal' env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2197ffb..4a22c965 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4.2.1 + uses: actions/checkout@v4.2.2 - name: Check scripts in repository are executable run: | @@ -75,7 +75,7 @@ jobs: DISTRO: ${{matrix.distro}} steps: - name: Checkout repository - uses: actions/checkout@v4.2.1 + uses: actions/checkout@v4.2.2 - name: Set up Python 3.10 uses: actions/setup-python@v5.2.0 From 9abb2401058e4a96a0c1de64551dabc3272bb908 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 26 Oct 2024 10:07:42 +0000 Subject: [PATCH 11/14] Bump actions/setup-python from 5.2.0 to 5.3.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v5.2.0...v5.3.0) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2197ffb..b23df5cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -78,7 +78,7 @@ jobs: uses: actions/checkout@v4.2.1 - name: Set up Python 3.10 - uses: actions/setup-python@v5.2.0 + uses: actions/setup-python@v5.3.0 with: python-version: "3.10" From 6d8b4fdfc6fe7970e2324fc25845d15307bd8de2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 26 Oct 2024 10:22:13 +0000 Subject: [PATCH 12/14] Bump tox from 4.23.0 to 4.23.2 in /test Bumps [tox](https://github.com/tox-dev/tox) from 4.23.0 to 4.23.2. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.23.0...4.23.2) --- updated-dependencies: - dependency-name: tox dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- test/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/requirements.txt b/test/requirements.txt index 5b28d6f3..93232df7 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -2,5 +2,5 @@ pyyaml == 6.0.2 pytest == 8.3.3 pytest-xdist == 3.6.1 pytest-testinfra == 10.1.1 -tox == 4.23.0 +tox == 4.23.2 pytest-clarity == 1.0.1 From 7341f85c2d5d02843d166afcf64f7d66e7412a51 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Tue, 12 Nov 2024 16:48:52 -0300 Subject: [PATCH 13/14] Add Fedora 41 and remove Fedora 39 from tests Signed-off-by: RD WebDesign --- .github/workflows/test.yml | 2 +- test/{_fedora_39.Dockerfile => _fedora_41.Dockerfile} | 2 +- test/{tox.fedora_39.ini => tox.fedora_41.ini} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename test/{_fedora_39.Dockerfile => _fedora_41.Dockerfile} (97%) rename test/{tox.fedora_39.ini => tox.fedora_41.ini} (85%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 381abd15..7c419e9a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,8 +68,8 @@ jobs: ubuntu_23, ubuntu_24, centos_9, - fedora_39, fedora_40, + fedora_41, ] env: DISTRO: ${{matrix.distro}} diff --git a/test/_fedora_39.Dockerfile b/test/_fedora_41.Dockerfile similarity index 97% rename from test/_fedora_39.Dockerfile rename to test/_fedora_41.Dockerfile index 1d3dbc63..59858f4e 100644 --- a/test/_fedora_39.Dockerfile +++ b/test/_fedora_41.Dockerfile @@ -1,4 +1,4 @@ -FROM fedora:39 +FROM fedora:41 RUN dnf install -y git initscripts ENV GITDIR=/etc/.pihole diff --git a/test/tox.fedora_39.ini b/test/tox.fedora_41.ini similarity index 85% rename from test/tox.fedora_39.ini rename to test/tox.fedora_41.ini index aaa6b30e..f70da227 100644 --- a/test/tox.fedora_39.ini +++ b/test/tox.fedora_41.ini @@ -6,5 +6,5 @@ allowlist_externals = docker deps = -rrequirements.txt setenv = COLUMNS=120 -commands = docker buildx build --load --progress plain -f _fedora_39.Dockerfile -t pytest_pihole:test_container ../ +commands = docker buildx build --load --progress plain -f _fedora_41.Dockerfile -t pytest_pihole:test_container ../ pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py ./test_centos_fedora_common_support.py From 62b63f87e0b47e04e2d602f1909fe3ff2b70d407 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 16 Nov 2024 12:46:43 +0100 Subject: [PATCH 14/14] Use rpm instead of dnf to check for installed package. dnf changed to returning success even for not-installed packages wit Fedora 41 Signed-off-by: DL6ER --- automated install/basic-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 0931e4ca..8f5b9879 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1430,7 +1430,7 @@ install_dependent_packages() { for i in "$@"; do # For each package, check if it's already installed (and if so, don't add it to the installArray) printf " %b Checking for %s..." "${INFO}" "${i}" - if "${PKG_MANAGER}" -q list installed "${i}" &>/dev/null; then + if rpm -q "${i}" &>/dev/null; then printf "%b %b Checking for %s\\n" "${OVER}" "${TICK}" "${i}" else printf "%b %b Checking for %s (will be installed)\\n" "${OVER}" "${INFO}" "${i}" @@ -2270,7 +2270,7 @@ main() { notify_package_updates_available # Install packages necessary to perform os_check - printf " %b Checking for / installing Required dependencies for OS Check...\\n" "${INFO}" + printf " %b Checking for / installing required dependencies for OS Check...\\n" "${INFO}" install_dependent_packages "${OS_CHECK_COMMON_DEPS[@]}" "${OS_CHECK_DEPS[@]}" # Check that the installed OS is officially supported - display warning if not @@ -2287,7 +2287,7 @@ main() { fi # Install packages used by this installation script - printf " %b Checking for / installing Required dependencies for this install script...\\n" "${INFO}" + printf " %b Checking for / installing required dependencies for this install script...\\n" "${INFO}" install_dependent_packages "${INSTALLER_COMMON_DEPS[@]}" "${INSTALLER_DEPS[@]}" # in case of an update @@ -2335,7 +2335,7 @@ main() { local dep_install_list=("${PIHOLE_COMMON_DEPS[@]}" "${PIHOLE_DEPS[@]}") # Install packages used by the actual software - printf " %b Checking for / installing Required dependencies for Pi-hole software...\\n" "${INFO}" + printf " %b Checking for / installing required dependencies for Pi-hole software...\\n" "${INFO}" install_dependent_packages "${dep_install_list[@]}" unset dep_install_list