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..7c419e9a 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: | @@ -68,17 +68,17 @@ jobs: ubuntu_23, ubuntu_24, centos_9, - fedora_39, fedora_40, + fedora_41, ] env: 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 + uses: actions/setup-python@v5.3.0 with: python-version: "3.10" 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/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index 9240c593..4f32382e 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 @@ -145,7 +148,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 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 ( diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 75418f1c..90eea220 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -449,7 +449,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 } @@ -2438,15 +2438,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 @@ -2472,6 +2463,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 + setFTLConfigValue "dns.queryLogging" "${QUERY_LOGGING}" + fi + if [ -n "${PRIVACY_LEVEL}" ]; then + setFTLConfigValue "misc.privacylevel" "${PRIVACY_LEVEL}" + fi + # Download and compile the aggregated block list runGravity diff --git a/gravity.sh b/gravity.sh index 6a4fb88e..a657727d 100755 --- a/gravity.sh +++ b/gravity.sh @@ -598,7 +598,8 @@ 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:// , https:// or file:// ." download=false fi 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 5312c2db..bf5fe5d5 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/requirements.txt b/test/requirements.txt index 903a6acc..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.21.2 +tox == 4.23.2 pytest-clarity == 1.0.1 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