diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 441b215..00949d4 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -31,10 +31,8 @@ jobs: runner: ubuntu-24.04-arm - platform: linux/arm64 runner: ubuntu-24.04-arm - # Drop this for the time being. bind-tools is failing to install on riscv64, and I don't have time to dig into it currently.exclude: - # It is unlikely that there are a lot of Pi-hole users on riscv64 architecture, let alone Docker users. - # - platform: linux/riscv64 - # runner: ubuntu-24.04-arm + - platform: linux/riscv64 + runner: ubuntu-24.04-arm steps: - name: Prepare name for digest up/download @@ -45,19 +43,19 @@ jobs: - &checkout-repo name: Checkout Repo if: github.event_name != 'schedule' - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0 - &checkout-dev name: Checkout dev branch if scheduled if: github.event_name == 'schedule' - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0 with: ref: development - &docker-meta name: Docker meta id: meta - uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f #v5.8.0 + uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 #v5.9.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} images: | @@ -87,7 +85,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 #v3.6.0 + uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 #v3.7.0 with: platforms: ${{ matrix.platform}} diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 617102b..c3e54a7 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -19,18 +19,16 @@ jobs: runner: ubuntu-24.04-arm - platform: linux/arm64 runner: ubuntu-24.04-arm - # Drop this for the time being. bind-tools is failing to install on riscv64, and I don't have time to dig into it currently.exclude: - # It is unlikely that there are a lot of Pi-hole users on riscv64 architecture, let alone Docker users. - # - platform: linux/riscv64 - # runner: ubuntu-24.04-arm + - platform: linux/riscv64 + runner: ubuntu-24.04-arm env: CI_ARCH: ${{ matrix.platform }} steps: - name: Checkout Repo - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0 - name: Set up QEMU - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 #v3.6.0 + uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 #v3.7.0 - name: Set up Python uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0 diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index b40dab6..7a9c781 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -10,9 +10,9 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0 - name: Spell-Checking - uses: codespell-project/actions-codespell@406322ec52dd7b488e48c1c4b82e2a8b3a1bf630 #v2.1 + uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 #v2.2 with: ignore_words_file: .codespellignore diff --git a/.github/workflows/dockerhub-description.yml b/.github/workflows/dockerhub-description.yml new file mode 100644 index 0000000..d434fc4 --- /dev/null +++ b/.github/workflows/dockerhub-description.yml @@ -0,0 +1,23 @@ +name: Update Docker Hub Description +permissions: + contents: read +on: + push: + branches: + - master + paths: + - README.md + - .github/workflows/dockerhub-description.yml +jobs: + dockerHubDescription: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0 + + - name: Docker Hub Description + uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa #v5 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_PASS }} + repository: pihole/pihole + short-description: ${{ github.event.repository.description }} diff --git a/.github/workflows/editorconfig.yml b/.github/workflows/editorconfig.yml index 9e39de6..30736e5 100644 --- a/.github/workflows/editorconfig.yml +++ b/.github/workflows/editorconfig.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0 - name: Get editorconfig-checker uses: editorconfig-checker/action-editorconfig-checker@4b6cd6190d435e7e084fb35e36a096e98506f7b9 #v2.1.0 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index e01bf2c..3505cb7 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0 - 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 67f993a..bacf3ef 100644 --- a/.github/workflows/sync-back-to-dev.yml +++ b/.github/workflows/sync-back-to-dev.yml @@ -11,7 +11,7 @@ jobs: name: Syncing branches steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0 - 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/README.md b/README.md index e2b3c48..61912ef 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,8 @@ services: TZ: 'Europe/London' # Set a password to access the web interface. Not setting one will result in a random password being assigned FTLCONF_webserver_api_password: 'correct horse battery staple' - # If using Docker's default `bridge` network setting the dns listening mode should be set to 'all' - FTLCONF_dns_listeningMode: 'all' + # If using Docker's default `bridge` network setting the dns listening mode should be set to 'ALL' + FTLCONF_dns_listeningMode: 'ALL' # Volumes store your data between container upgrades volumes: # For persisting Pi-hole's databases and common configuration file @@ -300,6 +300,8 @@ We have noticed that a lot of people use Watchtower to keep their Pi-hole contai - If you care about your data (logs/customizations), make sure you have it volume-mapped or it will be deleted in this step. - Recreate the container using the new image. +To exclude the Pi-hole container from Watchtower's auto-update system take a look at [Full Exclude](https://containrrr.dev/watchtower/container-selection/#full_exclude) in Watchtower's docs. + Pi-hole is an integral part of your network, don't let it fall over because of an unattended update in the middle of the night. # User Feedback diff --git a/src/start.sh b/src/start.sh index 6c19e10..17d3103 100644 --- a/src/start.sh +++ b/src/start.sh @@ -58,6 +58,13 @@ start() { fix_capabilities sh /opt/pihole/pihole-FTL-prestart.sh + # Get the FTL log file path from the config + FTLlogFile=$(getFTLConfigValue files.log.ftl) + + # Get the EOF position of the FTL log file so that we can tail from there later. + local startFrom + startFrom=$(stat -c%s "${FTLlogFile}") + echo " [i] Starting pihole-FTL ($FTL_CMD) as ${DNSMASQ_USER}" echo "" @@ -70,18 +77,11 @@ start() { # We need the PID of the capsh process so that we can wait for it to finish CAPSH_PID=$! - # Get the FTL log file path from the config - FTLlogFile=$(getFTLConfigValue files.log.ftl) - - # Wait until the log file exists before continuing - while [ ! -f "${FTLlogFile}" ]; do - sleep 0.5 - done - - # Wait until the FTL log contains the "FTL started" message before continuing - while ! grep -q '########## FTL started' "${FTLlogFile}"; do - sleep 0.5 - done + # Wait for FTL to start by monitoring the FTL log file for the "FTL started" line + if ! timeout 30 tail -F -c +$((startFrom + 1)) -- "${FTLlogFile}" | grep -q '########## FTL started'; then + echo " [!] ERROR: Did not find 'FTL started' message in ${FTLlogFile} in 30 seconds, stopping container" + exit 1 + fi pihole updatechecker local versionsOutput @@ -91,11 +91,8 @@ start() { echo "" if [ "${TAIL_FTL_LOG:-1}" -eq 1 ]; then - # Start tailing the FTL log from the most recent "FTL Started" message - # Get the line number - startFrom=$(grep -n '########## FTL started' "${FTLlogFile}" | tail -1 | cut -d: -f1) - # Start the tail from the line number and background it - tail --follow=name -n +"${startFrom}" "${FTLlogFile}" & + # Start tailing the FTL log file from the EOF position we recorded on container start + tail -F -c +$((startFrom + 1)) -- "${FTLlogFile}" & else echo " [i] FTL log output is disabled. Remove the Environment variable TAIL_FTL_LOG, or set it to 1 to enable FTL log output." fi @@ -104,7 +101,6 @@ start() { wait $CAPSH_PID FTL_EXIT_CODE=$? - # If we are here, then FTL has exited. # If the trap was triggered, then stop will have already been called if [ $TRAP_TRIGGERED -eq 0 ]; then diff --git a/test/requirements.txt b/test/requirements.txt index c3695c0..cf6a1aa 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,4 +1,4 @@ -pytest == 8.4.2 +pytest == 9.0.1 pytest-testinfra == 10.2.2 pytest-clarity == 1.0.1 tox == 4.32.0