diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 2ba90b4..02f0ec7 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,25 +2,44 @@ name: Mark stale issues on: schedule: - - cron: '0 8 * * *' + - cron: '0 8 * * *' workflow_dispatch: + issue_comment: + +env: + stale_label: stale jobs: - stale: - + stale_action: + if: github.event_name != 'issue_comment' runs-on: ubuntu-latest permissions: issues: write steps: - - uses: actions/stale@v7 + - uses: actions/stale@v8.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} 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 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_label + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + 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 diff --git a/README.md b/README.md index 70494b1..22083e9 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 @@ -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. 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/_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 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}" ;; diff --git a/src/s6/debian-root/usr/local/bin/install.sh b/src/s6/debian-root/usr/local/bin/install.sh index 4e81884..6824b66 100644 --- a/src/s6/debian-root/usr/local/bin/install.sh +++ b/src/s6/debian-root/usr/local/bin/install.sh @@ -10,17 +10,13 @@ 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) - S6_ARCH="x86_64";; armel) S6_ARCH="armhf";; - armhf) + armv7l) S6_ARCH="armhf";; - arm64) - S6_ARCH="aarch64";; i386) S6_ARCH="i686";; esac @@ -94,9 +90,15 @@ 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/* if [ ! -f /.piholeFirstBoot ]; then touch /.piholeFirstBoot 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/