From db9f64b1d646b2f1681d6077a640994b27fc42c6 Mon Sep 17 00:00:00 2001 From: Adam Monsen Date: Mon, 13 Feb 2023 12:20:51 -0800 Subject: [PATCH 01/13] README: link to canonical Phoenix Server doc Signed-off-by: Adam Monsen --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0e21b5..392a267 100644 --- a/README.md +++ b/README.md @@ -254,7 +254,7 @@ Do not attempt to upgrade (`pihole -up`) or reconfigure (`pihole -r`). New imag * If you care about your data (logs/customizations), make sure you have it volume-mapped or it will be deleted in this step. 3. Start your container with the newer base image: `docker run pihole/pihole` (`` being your preferred run volumes and env vars) -Why is this style of upgrading good? A couple reasons: Everyone is starting from the same base image which has been tested to known it works. No worrying about upgrading from A to B, B to C, or A to C is required when rolling out updates, it reduces complexity, and simply allows a 'fresh start' every time while preserving customizations with volumes. Basically I'm encouraging [phoenix server](https://www.google.com/?q=phoenix+servers) principles for your containers. +Why is this style of upgrading good? A couple reasons: Everyone is starting from the same base image which has been tested to known it works. No worrying about upgrading from A to B, B to C, or A to C is required when rolling out updates, it reduces complexity, and simply allows a 'fresh start' every time while preserving customizations with volumes. Basically I'm encouraging [phoenix server](https://martinfowler.com/bliki/PhoenixServer.html) principles for your containers. To reconfigure Pi-hole you'll either need to use an existing container environment variables or if there is no a variable for what you need, use the web UI or CLI commands. From 8a425552629a9cb5de6c34339bf376a65e86a50a Mon Sep 17 00:00:00 2001 From: Casper Date: Thu, 23 Mar 2023 01:16:42 +0100 Subject: [PATCH 02/13] Recreate pihole cronjob on container start Signed-off-by: Casper --- src/s6/debian-root/usr/local/bin/_startup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/s6/debian-root/usr/local/bin/_startup.sh b/src/s6/debian-root/usr/local/bin/_startup.sh index 4f27f24..ad2a92c 100755 --- a/src/s6/debian-root/usr/local/bin/_startup.sh +++ b/src/s6/debian-root/usr/local/bin/_startup.sh @@ -43,6 +43,7 @@ setup_lighttpd_bind # Misc Setup # =========================== +installCron setup_blocklists # FTL setup From 8ae9b56fd8d44bccbee6ae9b90ba1996261bd3f1 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Thu, 23 Mar 2023 13:11:03 -0300 Subject: [PATCH 03/13] Allow 2 new options (high contrast themes) for WEBTHEME Fix #1337 Signed-off-by: RD WebDesign --- src/s6/debian-root/usr/local/bin/bash_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s6/debian-root/usr/local/bin/bash_functions.sh b/src/s6/debian-root/usr/local/bin/bash_functions.sh index 14c766a..e3e8197 100644 --- a/src/s6/debian-root/usr/local/bin/bash_functions.sh +++ b/src/s6/debian-root/usr/local/bin/bash_functions.sh @@ -420,7 +420,7 @@ setup_web_theme(){ # If an invalid theme name was supplied, setup WEBTHEME to use the default-light theme. if [ -n "${WEBTHEME}" ]; then case "${WEBTHEME}" in - "default-dark" | "default-darker" | "default-light" | "default-auto" | "lcars") + "default-dark" | "default-darker" | "default-light" | "default-auto" | "high-contrast" | "high-contrast-dark" | "lcars") echo " [i] Setting Web Theme based on WEBTHEME variable, using value ${WEBTHEME}" change_setting "WEBTHEME" "${WEBTHEME}" ;; From e2e2bdd8016273c1cf3a994523317ee08620e996 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Mar 2023 10:56:34 +0000 Subject: [PATCH 04/13] Bump actions/stale from 7.0.0 to 8.0.0 Bumps [actions/stale](https://github.com/actions/stale) from 7.0.0 to 8.0.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/v7...v8.0.0) --- updated-dependencies: - dependency-name: actions/stale dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/stale.yml | 2 +- .github/workflows/stale_pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 2ba90b4..6c50db4 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,7 +13,7 @@ jobs: issues: write steps: - - uses: actions/stale@v7 + - uses: actions/stale@v8.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 30 diff --git a/.github/workflows/stale_pr.yml b/.github/workflows/stale_pr.yml index 87c8758..c544359 100644 --- a/.github/workflows/stale_pr.yml +++ b/.github/workflows/stale_pr.yml @@ -17,7 +17,7 @@ jobs: pull-requests: write steps: - - uses: actions/stale@v7.0.0 + - uses: actions/stale@v8.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} # Do not automatically mark PR/issue as stale From b4a60de22d0ea04feb9dadeeaec98b4965762d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 15 Apr 2023 13:23:58 +0200 Subject: [PATCH 05/13] Only allow https for curl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- test/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Dockerfile b/test/Dockerfile index 511833a..7a4704d 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && \ && rm -rf /var/lib/apt/lists/* \ && pip3 install --no-cache-dir -U pip pipenv -RUN curl -L https://github.com/docker/compose/releases/download/2.10.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && \ +RUN curl --proto "=https" -L https://github.com/docker/compose/releases/download/2.10.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && \ chmod +x /usr/local/bin/docker-compose COPY ./cmd.sh /usr/local/bin/ From 7353d8dbcbc93c068984abbae3f540fc58c333d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 15 Apr 2023 10:32:31 +0200 Subject: [PATCH 06/13] Trigger stale workflow on issue comments to remove stale label immediately MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- .github/workflows/stale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 2ba90b4..7746c3a 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -4,7 +4,8 @@ on: schedule: - cron: '0 8 * * *' workflow_dispatch: - + issue_comment: + jobs: stale: From 757b4a72d0df40f803bbc0a3bb8ba2f979c544c1 Mon Sep 17 00:00:00 2001 From: laurentr Date: Tue, 11 Apr 2023 08:46:36 -0700 Subject: [PATCH 07/13] Update available themes in README.md Signed-off-by: laurentr --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 70494b1..9a4b4cc 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ There are other environment variables if you want to customize various things in | `TEMPERATUREUNIT` | `c` | `` | Set preferred temperature unit to `c`: Celsius, `k`: Kelvin, or `f` Fahrenheit units. | `WEBUIBOXEDLAYOUT` | `boxed` | `` | Use boxed layout (helpful when working on large screens) | `QUERY_LOGGING` | `true` | `<"true"\|"false">` | Enable query logging or not. -| `WEBTHEME` | `default-light` | `<"default-dark"\|"default-darker"\|"default-light"\|"default-auto"\|"lcars">`| User interface theme to use. +| `WEBTHEME` | `default-light` | `<"default-dark"\|"default-darker"\|"default-light"\|"default-auto"\|"high-contrast"\|"high-contrast-dark"\|"lcars">`| User interface theme to use. | `WEBPASSWORD_FILE`| unset | `` |Set an Admin password using [Docker secrets](https://docs.docker.com/engine/swarm/secrets/). If `WEBPASSWORD` is set, `WEBPASSWORD_FILE` is ignored. If `WEBPASSWORD` is empty, and `WEBPASSWORD_FILE` is set to a valid readable file path, then `WEBPASSWORD` will be set to the contents of `WEBPASSWORD_FILE`. ### Advanced Variables From 246818a0b124aab8f77ea4aafd2e1f2ea2d78df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 16 Apr 2023 18:24:12 +0200 Subject: [PATCH 08/13] Run seperate job to trigger removal on comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- .github/workflows/stale.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 7746c3a..ac391a5 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,13 +2,13 @@ name: Mark stale issues on: schedule: - - cron: '0 8 * * *' + - cron: '0 8 * * *' workflow_dispatch: issue_comment: - -jobs: - stale: +jobs: + stale_action: + if: github.event_name != 'issue_comment' runs-on: ubuntu-latest permissions: issues: write @@ -25,3 +25,18 @@ jobs: exempt-all-issue-assignees: true operations-per-run: 300 close-issue-reason: 'not_planned' + + remove_stale: # trigger "stale" removal immediately when stale issues are commented on + if: github.event_name == 'issue_comment' + permissions: + contents: read # for actions/checkout + issues: write # to edit issues label + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3.4.0 + - name: Remove 'stale' label + run: gh issue edit ${{ github.event.issue.number }} --remove-label 'stale' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + From 56525a6be1be8ed730d6ed811f9dfde7fedeaa3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Mon, 17 Apr 2023 20:53:40 +0200 Subject: [PATCH 09/13] Use env variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- .github/workflows/stale.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index ac391a5..72f7bee 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -6,6 +6,9 @@ on: workflow_dispatch: issue_comment: +env: + stale_label: stale + jobs: stale_action: if: github.event_name != 'issue_comment' @@ -20,7 +23,7 @@ jobs: days-before-stale: 30 days-before-close: 5 stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.' - stale-issue-label: 'stale' + stale-issue-label: $stale_label exempt-issue-labels: 'pinned, Fixed in next release, bug, never-stale, documentation, investigating' exempt-all-issue-assignees: true operations-per-run: 300 @@ -36,7 +39,7 @@ jobs: - name: Checkout uses: actions/checkout@v3.4.0 - name: Remove 'stale' label - run: gh issue edit ${{ github.event.issue.number }} --remove-label 'stale' + run: gh issue edit ${{ github.event.issue.number }} --remove-label $stale_label env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7a20e9fdb106cfca257682c830ea74c225b13143 Mon Sep 17 00:00:00 2001 From: Sebastian Liebscher <112352529+sebastianliebscher@users.noreply.github.com> Date: Sun, 30 Apr 2023 06:31:18 +0200 Subject: [PATCH 10/13] Update install.sh Signed-off-by: Sebastian Liebscher <112352529+sebastianliebscher@users.noreply.github.com> --- src/s6/debian-root/usr/local/bin/install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/s6/debian-root/usr/local/bin/install.sh b/src/s6/debian-root/usr/local/bin/install.sh index 4e81884..2008f15 100644 --- a/src/s6/debian-root/usr/local/bin/install.sh +++ b/src/s6/debian-root/usr/local/bin/install.sh @@ -97,6 +97,8 @@ mv /etc/pihole/macvendor.db /macvendor.db rm /etc/lighttpd/conf-enabled/99-unconfigured.conf ## Remove the default lighttpd placeholder page for good measure rm /var/www/html/index.lighttpd.html +## Remove redundant directories created by the installer to reduce docker image size +rm -rf /tmp/* /var/www/html/admin/.git* /etc/.pihole/.git* if [ ! -f /.piholeFirstBoot ]; then touch /.piholeFirstBoot From 5aa3abc28213cfbedbb00e92d838fce37e9a3f12 Mon Sep 17 00:00:00 2001 From: Sebastian Liebscher <112352529+sebastianliebscher@users.noreply.github.com> Date: Tue, 2 May 2023 19:15:18 +0200 Subject: [PATCH 11/13] Update install.sh Signed-off-by: Sebastian Liebscher <112352529+sebastianliebscher@users.noreply.github.com> --- src/s6/debian-root/usr/local/bin/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s6/debian-root/usr/local/bin/install.sh b/src/s6/debian-root/usr/local/bin/install.sh index 2008f15..daaab48 100644 --- a/src/s6/debian-root/usr/local/bin/install.sh +++ b/src/s6/debian-root/usr/local/bin/install.sh @@ -98,7 +98,7 @@ rm /etc/lighttpd/conf-enabled/99-unconfigured.conf ## Remove the default lighttpd placeholder page for good measure rm /var/www/html/index.lighttpd.html ## Remove redundant directories created by the installer to reduce docker image size -rm -rf /tmp/* /var/www/html/admin/.git* /etc/.pihole/.git* +rm -rf /tmp/* if [ ! -f /.piholeFirstBoot ]; then touch /.piholeFirstBoot From 69e55ac143e629d53233982abbbd220af585d562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 11 May 2023 22:07:53 +0200 Subject: [PATCH 12/13] Tweak commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- src/s6/debian-root/etc/s6-overlay/s6-rc.d/cron/finish | 2 +- .../debian-root/etc/s6-overlay/s6-rc.d/lighttpd/finish | 2 +- .../etc/s6-overlay/s6-rc.d/pihole-FTL/finish | 2 +- src/s6/debian-root/usr/local/bin/install.sh | 10 +++++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/s6/debian-root/etc/s6-overlay/s6-rc.d/cron/finish b/src/s6/debian-root/etc/s6-overlay/s6-rc.d/cron/finish index 14c0c72..5de65fa 100755 --- a/src/s6/debian-root/etc/s6-overlay/s6-rc.d/cron/finish +++ b/src/s6/debian-root/etc/s6-overlay/s6-rc.d/cron/finish @@ -1,4 +1,4 @@ #!/command/with-contenv bash s6-echo "Stopping cron" -killall -9 cron +killall --signal 9 cron diff --git a/src/s6/debian-root/etc/s6-overlay/s6-rc.d/lighttpd/finish b/src/s6/debian-root/etc/s6-overlay/s6-rc.d/lighttpd/finish index 0f6e5e3..a50e5b9 100755 --- a/src/s6/debian-root/etc/s6-overlay/s6-rc.d/lighttpd/finish +++ b/src/s6/debian-root/etc/s6-overlay/s6-rc.d/lighttpd/finish @@ -3,4 +3,4 @@ s6-echo "Stopping lighttpd" service lighttpd-access-log stop service lighttpd-error-log stop -killall -9 lighttpd +killall --signal 9 lighttpd diff --git a/src/s6/debian-root/etc/s6-overlay/s6-rc.d/pihole-FTL/finish b/src/s6/debian-root/etc/s6-overlay/s6-rc.d/pihole-FTL/finish index 57265c1..b92ed44 100755 --- a/src/s6/debian-root/etc/s6-overlay/s6-rc.d/pihole-FTL/finish +++ b/src/s6/debian-root/etc/s6-overlay/s6-rc.d/pihole-FTL/finish @@ -1,4 +1,4 @@ #!/command/with-contenv bash s6-echo "Stopping pihole-FTL" -killall -15 pihole-FTL +killall --signal 15 pihole-FTL diff --git a/src/s6/debian-root/usr/local/bin/install.sh b/src/s6/debian-root/usr/local/bin/install.sh index daaab48..711d6e2 100644 --- a/src/s6/debian-root/usr/local/bin/install.sh +++ b/src/s6/debian-root/usr/local/bin/install.sh @@ -10,7 +10,7 @@ WEB_LOCAL_REPO=/var/www/html/admin setupVars=/etc/pihole/setupVars.conf detect_arch() { - DETECTED_ARCH=$(dpkg --print-architecture) + DETECTED_ARCH=$(arch) S6_ARCH=$DETECTED_ARCH case $DETECTED_ARCH in amd64) @@ -94,9 +94,13 @@ mv /etc/pihole/macvendor.db /macvendor.db ## Remove the default lighttpd unconfigured config: -rm /etc/lighttpd/conf-enabled/99-unconfigured.conf +if [ -f /etc/lighttpd/conf-enabled/99-unconfigured.conf ]; then + rm /etc/lighttpd/conf-enabled/99-unconfigured.conf +fi ## Remove the default lighttpd placeholder page for good measure -rm /var/www/html/index.lighttpd.html +if [ -f /var/www/html/index.lighttpd.html ]; then + rm /var/www/html/index.lighttpd.html +fi ## Remove redundant directories created by the installer to reduce docker image size rm -rf /tmp/* From 28e9be0e4c5dcf77cf69efcf283039c6c29cf238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 11 May 2023 23:09:12 +0200 Subject: [PATCH 13/13] Adjust arch detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- src/s6/debian-root/usr/local/bin/install.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/s6/debian-root/usr/local/bin/install.sh b/src/s6/debian-root/usr/local/bin/install.sh index 711d6e2..6824b66 100644 --- a/src/s6/debian-root/usr/local/bin/install.sh +++ b/src/s6/debian-root/usr/local/bin/install.sh @@ -13,14 +13,10 @@ detect_arch() { DETECTED_ARCH=$(arch) S6_ARCH=$DETECTED_ARCH case $DETECTED_ARCH in - amd64) - S6_ARCH="x86_64";; armel) S6_ARCH="armhf";; - armhf) + armv7l) S6_ARCH="armhf";; - arm64) - S6_ARCH="aarch64";; i386) S6_ARCH="i686";; esac