Repository: pi-hole/docker-pi-hole Branch: master Commit: ac202988906f Files: 40 Total size: 77.0 KB Directory structure: gitextract_w4fbfg1b/ ├── .codespellignore ├── .editorconfig ├── .github/ │ ├── CODEOWNERS │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── config.yml │ ├── PULL_REQUEST_TEMPLATE.md │ ├── dco.yml │ ├── dependabot.yml │ ├── release.yml │ └── workflows/ │ ├── build-and-publish.yml │ ├── build-and-test.yml │ ├── codespell.yml │ ├── dockerhub-description.yml │ ├── editorconfig.yml │ ├── housekeeping.yml │ ├── merge-conflict.yml │ ├── stale.yml │ ├── stale_pr.yml │ └── sync-back-to-dev.yml ├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── build.sh ├── examples/ │ ├── Caddyfile │ └── docker-compose-caddy-proxy.yml ├── src/ │ ├── .dockerignore │ ├── Dockerfile │ ├── bash_functions.sh │ ├── crontab.txt │ └── start.sh └── test/ ├── TESTING.md ├── requirements.txt ├── tests/ │ ├── __init__.py │ ├── conftest.py │ ├── test_bash_functions.py │ └── test_general.py └── tox.ini ================================================ FILE CONTENTS ================================================ ================================================ FILE: .codespellignore ================================================ padd ================================================ FILE: .editorconfig ================================================ # EditorConfig is awesome: https://editorconfig.org/ # top-most EditorConfig file root = true # Unix-style newlines with a newline ending every file [*] end_of_line = lf insert_final_newline = true indent_style = space indent_size = tab tab_width = 4 charset = utf-8 trim_trailing_whitespace = true [*.yml] tab_width = 2 [*.md] tab_width = 2 ================================================ FILE: .github/CODEOWNERS ================================================ # see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, * @pi-hole/docker-maintainers ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' --- This is a: **FILL ME IN** ## Details ## Related Issues - [ ] I have searched this repository/Pi-hole forums for existing issues and pull requests that look similar ## How to reproduce the issue 1. Environment data * Operating System: **ENTER HERE** * Hardware: * Kernel Architecture: * Docker Install Info and version: - Software source: - Supplimentary Software: * Hardware architecture: 2. docker-compose.yml contents, docker run shell command, or paste a screenshot of any UI based configuration of containers here 3. any additional info to help reproduce ## These common fixes didn't work for my issue - [ ] I have tried removing/destroying my container, and re-creating a new container - [ ] I have tried fresh volume data by backing up and moving/removing the old volume data - [ ] I have tried running the stock `docker run` example(s) in the readme (removing any customizations I added) - [ ] I have tried a newer or older version of Docker Pi-hole (depending what version the issue started in for me) - [ ] I have tried running without my volume data mounts to eliminate volumes as the cause If the above debugging / fixes revealed any new information note it here. Add any other debugging steps you've taken or theories on root cause that may help. ================================================ FILE: .github/ISSUE_TEMPLATE/config.yml ================================================ blank_issues_enabled: false contact_links: - name: Questions and Configurations url: https://discourse.pi-hole.net about: Ask a question or get help with configurations. - name: Feature Requests url: https://discourse.pi-hole.net/c/feature-requests/8 about: See existing Feature Requests and suggest new ones. - name: Documentation url: https://docs.pi-hole.net about: Documentation and guides. ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ `{Please select 'base: development' as target branch above! (you can delete this line)}` ## Description ## Motivation and Context ## How Has This Been Tested? ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## Checklist: - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. ================================================ FILE: .github/dco.yml ================================================ require: members: false ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: # Maintain dependencies for GitHub Actions - package-ecosystem: "github-actions" directories: - "/" schedule: interval: "weekly" day: saturday time: "10:00" target-branch: development - package-ecosystem: "docker" directory: "/src/" schedule: interval: "weekly" day: saturday time: "10:00" target-branch: development - package-ecosystem: pip directory: "/test" schedule: interval: weekly day: saturday time: "10:00" open-pull-requests-limit: 10 target-branch: development ================================================ FILE: .github/release.yml ================================================ changelog: exclude: labels: - internal - dependencies authors: - dependabot - github-actions ================================================ FILE: .github/workflows/build-and-publish.yml ================================================ name: Build Image and Publish on: schedule: - cron: "0 5 * * *" push: branches: - development release: types: [published] permissions: contents: read packages: write env: dockerhub: ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole ghcr: ghcr.io/${{ github.repository_owner }}/pihole components_branch: ${{ github.event_name == 'release' && 'master' || 'development' }} jobs: build: runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: include: - platform: linux/amd64 runner: ubuntu-latest - platform: linux/386 runner: ubuntu-latest - platform: linux/arm/v6 runner: ubuntu-24.04-arm - platform: linux/arm/v7 runner: ubuntu-24.04-arm - platform: linux/arm64 runner: ubuntu-24.04-arm - platform: linux/riscv64 runner: ubuntu-24.04-arm steps: - name: Prepare name for digest up/download run: | platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - &checkout-repo name: Checkout Repo if: github.event_name != 'schedule' uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 - &checkout-dev name: Checkout dev branch if scheduled if: github.event_name == 'schedule' uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 with: ref: development - &docker-meta name: Docker meta id: meta uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 #v5.10.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} images: | ${{ env.dockerhub }} ${{ env.ghcr }} flavor: | latest=${{ startsWith(github.ref, 'refs/tags/') }} tags: | type=schedule,pattern=nightly type=raw,value=nightly,enable=${{ github.event_name == 'push' }} type=ref,event=tag - &login-dockerhub name: Login to Docker Hub uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 #v3.7.0 with: registry: docker.io username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_PASS }} - &login-ghcr name: Login to GitHub Container Registry uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 #v3.7.0 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 #v3.7.0 with: platforms: ${{ matrix.platform}} - &setup-buildx name: Set up Docker Buildx uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f #v3.12.0 with: # Buildx version 0.31.1 broke our publish workflow, this need to be revised when 0.32.0 is released # https://github.com/docker/buildx/releases/tag/v0.31.1 version: v0.31.0 - name: Build container and push by digest id: build uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 #v6.19.2 with: context: ./src/ platforms: ${{ matrix.platform }} build-args: | PIHOLE_DOCKER_TAG=${{ steps.meta.outputs.version }} FTL_BRANCH=${{ env.components_branch }} CORE_BRANCH=${{ env.components_branch }} WEB_BRANCH=${{ env.components_branch }} PADD_BRANCH=${{ env.components_branch }} labels: ${{ steps.meta.outputs.labels }} outputs: | type=image,name=${{ env.dockerhub }},push-by-digest=true,name-canonical=true,push=true - name: Export digests run: | mkdir -p /tmp/digests digest_docker="${{ steps.build.outputs.digest }}" touch "/tmp/digests/${digest_docker#sha256:}" - name: Upload digest uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f #v6.0.0 with: name: digests-${{ env.PLATFORM_PAIR }} path: /tmp/digests/* if-no-files-found: error retention-days: 1 # Merge all the digests into a single file # If we would push immediately above, the individual runners would overwrite each other's images # https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners merge-and-deploy: runs-on: ubuntu-latest needs: - build steps: - *checkout-repo - *checkout-dev - name: Download digests uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 #v7.0.0 with: path: /tmp/digests pattern: digests-* merge-multiple: true - *setup-buildx - *docker-meta - *login-dockerhub - *login-ghcr - name: Create manifest list and push (DockerHub and GitHub Container Registry) working-directory: /tmp/digests run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.dockerhub }}@sha256:%s ' *) docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.ghcr }}@sha256:%s ' *) - name: Inspect images run: | docker buildx imagetools inspect ${{ env.dockerhub }}:${{ steps.meta.outputs.version }} docker buildx imagetools inspect ${{ env.ghcr }}:${{ steps.meta.outputs.version }} ================================================ FILE: .github/workflows/build-and-test.yml ================================================ name: Build Image and Test on: pull_request: permissions: contents: read jobs: build-and-test: runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: include: - platform: linux/amd64 runner: ubuntu-latest - platform: linux/386 runner: ubuntu-latest - platform: linux/arm/v6 runner: ubuntu-24.04-arm - platform: linux/arm/v7 runner: ubuntu-24.04-arm - platform: linux/arm64 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 - name: Set up QEMU uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 #v3.7.0 - name: Set up Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 #v6.2.0 with: python-version: "3.13" - name: Run black formatter run: | pip install black black --check --diff test/tests/ - name: Install wheel run: pip install wheel - name: Install dependencies run: pip install -r test/requirements.txt - name: Test with tox run: | CIPLATFORM=${{ env.CI_ARCH }} tox -c test/tox.ini ================================================ FILE: .github/workflows/codespell.yml ================================================ name: Codespell on: pull_request: types: [opened, synchronize, reopened, ready_for_review] permissions: contents: read jobs: spell-check: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 - name: Spell-Checking uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 #v2.2 with: ignore_words_file: .codespellignore ================================================ FILE: .github/workflows/dockerhub-description.yml ================================================ 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 - 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 }} ================================================ FILE: .github/workflows/editorconfig.yml ================================================ name: Editorconfig-Checker on: pull_request: types: [opened, synchronize, reopened, ready_for_review] permissions: contents: read jobs: editorconfig-checker: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 - name: Get editorconfig-checker uses: editorconfig-checker/action-editorconfig-checker@4b6cd6190d435e7e084fb35e36a096e98506f7b9 #v2.1.0 - name: Run editorconfig-checker run: editorconfig-checker ================================================ FILE: .github/workflows/housekeeping.yml ================================================ name: Remove untagged images from registry on: workflow_dispatch: schedule: - cron: "0 0 * * *" permissions: packages: write jobs: housekeeping: runs-on: ubuntu-latest steps: - name: Delete all containers from repository without tags uses: Chizkiyahu/delete-untagged-ghcr-action@68758dd8caf1d9dbaed1fe9cc1a1f8fcea1c4cf0 #v6.1.0 with: token: ${{ secrets.PAT_TOKEN }} repository_owner: ${{ github.repository_owner }} repository: ${{ github.repository }} untagged_only: true owner_type: org # or user except_untagged_multiplatform: true ================================================ FILE: .github/workflows/merge-conflict.yml ================================================ name: "Check for merge conflicts" on: # So that PRs touching the same files as the push are updated push: # So that the `dirtyLabel` is removed if conflicts are resolve # We recommend `pull_request_target` so that github secrets are available. # In `pull_request` we wouldn't be able to change labels of fork PRs pull_request_target: types: [synchronize] permissions: contents: read pull-requests: write jobs: main: runs-on: ubuntu-latest steps: - name: Check if PRs are have merge conflicts uses: eps1lon/actions-label-merge-conflict@1df065ebe6e3310545d4f4c4e862e43bdca146f0 #v3.0.3 with: dirtyLabel: "Merge Conflict" repoToken: "${{ secrets.GITHUB_TOKEN }}" commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request." commentOnClean: "Conflicts have been resolved." ================================================ FILE: .github/workflows/stale.yml ================================================ name: Mark stale issues on: schedule: - cron: '0 8 * * *' workflow_dispatch: issue_comment: permissions: issues: write pull-requests: write env: stale_label: stale jobs: stale_action: if: github.event_name != 'issue_comment' runs-on: ubuntu-latest permissions: issues: write steps: - uses: actions/stale@997185467fa4f803885201cee163a9f38240193d #v10.1.1 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: '${{ env.stale_label }}' exempt-issue-labels: 'pinned, Fixed in next release, bug, never-stale, documentation, investigating, v6' 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 # we need to explicitly check that the trigger does not run on comment on a PR as # 'issue_comment' triggers on issues AND PR comments # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment-on-issues-only-or-pull-requests-only if: ${{ !github.event.issue.pull_request && github.event_name != 'schedule' }} permissions: contents: read # for actions/checkout issues: write # to edit issues label runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 - name: Remove 'stale' label run: gh issue edit ${{ github.event.issue.number }} --remove-label ${{ env.stale_label }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: .github/workflows/stale_pr.yml ================================================ name: Close stale PR # This action will add a `stale` label and close immediately every PR that meets the following conditions: # - it is already marked with "merge conflict" label # - there was no update/comment on the PR in the last 30 days. on: schedule: - cron: '0 10 * * *' workflow_dispatch: jobs: stale: runs-on: ubuntu-latest permissions: issues: write pull-requests: write steps: - uses: actions/stale@997185467fa4f803885201cee163a9f38240193d #v10.1.1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} # Do not automatically mark PR/issue as stale days-before-stale: -1 # Override 'days-before-stale' for PR only days-before-pr-stale: 30 # Close PRs immediately, after marking them 'stale' days-before-pr-close: 0 # only run the action on merge conflict PR any-of-labels: 'Merge Conflict' exempt-pr-labels: 'internal,never-stale,ON HOLD,in progress' exempt-all-pr-assignees: true operations-per-run: 300 stale-pr-message: '' close-pr-message: 'Existing merge conflicts have not been addressed. This PR is considered abandoned.' ================================================ FILE: .github/workflows/sync-back-to-dev.yml ================================================ name: Sync Back to Development on: push: branches: - master permissions: contents: write pull-requests: write jobs: sync-branches: runs-on: ubuntu-latest name: Syncing branches steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.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: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: .gitignore ================================================ *.sw* *.pyc .cache __pycache__ .tox .pipenv .eggs UNKNOWN.egg-info .env ci-workspace .gh-workspace docker-compose.yml etc-dnsmasq.d/ etc-pihole/ var-log/ .vscode/ .pytest_cache/ # WIP/test stuff doco.yml # Ignore FTL Binary if it exists src/pihole-FTL ================================================ FILE: .gitmodules ================================================ ================================================ FILE: CHANGELOG.md ================================================ # Docker Pi-Hole changelog Notes about releases will be documented on [docker-pi-hole's github releases page](https://github.com/pi-hole/docker-pi-hole/releases). Breaking changes will be copied to the top of the docker repo's README file to assist with common upgrade issues. See the [Pi-hole releases](https://github.com/pi-hole/pi-hole/releases) for details on updates unrelated to docker image releases ================================================ FILE: CONTRIBUTING.md ================================================ # Pull Request Guidelines Please review the following before opening a pull request (PR) to help your PR go smoothly: * Code changes go to the `development` branch first * To ensure proper testing and quality control, target any code change pull requests against `development` branch. * Make sure the tests pass * Take a look at [TESTING.md](test/TESTING.md) to see how to run tests locally so you do not have to push all your code to a PR and have GitHub Actions run it. * Your tests will probably run faster locally and you get a faster feedback loop. ================================================ FILE: LICENSE ================================================ Copyright (C) 2017 Pi-hole, LLC (https://pi-hole.net) Pi-hole Core This software is licensed under the European Union Public License (EUPL) The license is available in the 22 official languages of the EU. The English version is included here. Please see https://joinup.ec.europa.eu/community/eupl/og_page/eupl for official translations of the other languages. This license applies to the whole project EXCEPT: - any commits made to the master branch prior to the release of version 3.0 The licenses that existed prior to this change have remained intact. ------------------------------------------------------------- EUROPEAN UNION PUBLIC LICENCE v. 1.2 EUPL © the European Union 2007, 2016 This European Union Public Licence (the EUPL) applies to the Work (as defined below) which is provided under the terms of this Licence. Any use of the Work, other than as authorised under this Licence is prohibited (to the extent such use is covered by a right of the copyright holder of the Work). The Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following notice immediately following the copyright notice for the Work: Licensed under the EUPL or has expressed by any other means his willingness to license under the EUPL. 1. Definitions In this Licence, the following terms have the following meaning: - The Licence: this Licence. - The Original Work: the work or software distributed or communicated by the Licensor under this Licence, available as Source Code and also as Executable Code as the case may be. - Derivative Works: the works or software that could be created by the Licensee, based upon the Original Work or modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in the country mentioned in Article 15. - The Work: the Original Work or its Derivative Works. - The Source Code: the human-readable form of the Work which is the most convenient for people to study and modify. - The Executable Code: any code which has generally been compiled and which is meant to be interpreted by a computer as a program. - The Licensor: the natural or legal person that distributes or communicates the Work under the Licence. - Contributor(s): any natural or legal person who modifies the Work under the Licence, or otherwise contributes to the creation of a Derivative Work. - The Licensee or You: any natural or legal person who makes any usage of the Work under the terms of the Licence. - Distribution or Communication: any act of selling, giving, lending, renting, distributing, communicating, transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential functionalities at the disposal of any other natural or legal person. 2. Scope of the rights granted by the Licence The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for the duration of copyright vested in the Original Work: - use the Work in any circumstance and for all usage, - reproduce the Work, - modify the Work, and make Derivative Works based upon the Work, - communicate to the public, including the right to make available or display the Work or copies thereof to the public and perform publicly, as the case may be, the Work, - distribute the Work or copies thereof, - lend and rent the Work or copies thereof, - sublicense rights in the Work or copies thereof. Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the applicable law permits so. In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed by law in order to make effective the licence of the economic rights here above listed. The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the extent necessary to make use of the rights granted on the Work under this Licence. 3. Communication of the Source Code The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to distribute or communicate the Work. 4. Limitations on copyright Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations thereto. 5. Obligations of the Licensee The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those obligations are the following: Attribution right: The Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the Licence with every copy of the Work he/she distributes or communicates. The Licensee must cause any Derivative Work to carry prominent notices stating that the Work has been modified and the date of modification. Copyleft clause: If the Licensee distributes or communicates copies of the Original Works or Derivative Works, this Distribution or Communication will be done under the terms of this Licence or of a later version of this Licence unless the Original Work is expressly distributed only under this version of the Licence - for example by communicating EUPL v. 1.2 only. The Licensee (becoming Licensor) cannot offer or impose any additional terms or conditions on the Work or Derivative Work that alter or restrict the terms of the Licence. Compatibility clause: If the Licensee Distributes or Communicates Derivative Works or copies thereof based upon both the Work and another work licensed under a Compatible Licence, this Distribution or Communication can be done under the terms of this Compatible Licence. For the sake of this clause, Compatible Licence refers to the licences listed in the appendix attached to this Licence. Should the Licensee's obligations under the Compatible Licence conflict with his/her obligations under this Licence, the obligations of the Compatible Licence shall prevail. Provision of Source Code: When distributing or communicating copies of the Work, the Licensee will provide a machine-readable copy of the Source Code or indicate a repository where this Source will be easily and freely available for as long as the Licensee continues to distribute or communicate the Work. Legal Protection: This Licence does not grant permission to use the trade names, trademarks, service marks, or names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the copyright notice. 6. Chain of Authorship The original Licensor warrants that the copyright in the Original Work granted hereunder is owned by him/her or licensed to him/her and that he/she has the power and authority to grant the Licence. Each Contributor warrants that the copyright in the modifications he/she brings to the Work are owned by him/her or licensed to him/her and that he/she has the power and authority to grant the Licence. Each time You accept the Licence, the original Licensor and subsequent Contributors grant You a licence to their contributions to the Work, under the terms of this Licence. 7. Disclaimer of Warranty The Work is a work in progress, which is continuously improved by numerous Contributors. It is not a finished work and may therefore contain defects or bugs inherent to this type of development. For the above reason, the Work is provided under the Licence on an as is basis and without warranties of any kind concerning the Work, including without limitation merchantability, fitness for a particular purpose, absence of defects or errors, accuracy, non-infringement of intellectual property rights other than copyright as stated in Article 6 of this Licence. This disclaimer of warranty is an essential part of the Licence and a condition for the grant of any rights to the Work. 8. Disclaimer of Liability Except in the cases of wilful misconduct or damages directly caused to natural persons, the Licensor will in no event be liable for any direct or indirect, material or moral, damages of any kind, arising out of the Licence or of the use of the Work, including without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, loss of data or any commercial damage, even if the Licensor has been advised of the possibility of such damage. However, the Licensor will be liable under statutory product liability laws as far such laws apply to the Work. 9. Additional agreements While distributing the Work, You may choose to conclude an additional agreement, defining obligations or services consistent with this Licence. However, if accepting obligations, You may act only on your own behalf and on your sole responsibility, not on behalf of the original Licensor or any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against such Contributor by the fact You have accepted any warranty or additional liability. 10. Acceptance of the Licence The provisions of this Licence can be accepted by clicking on an icon I agree placed under the bottom of a window displaying the text of this Licence or by affirming consent in any other similar way, in accordance with the rules of applicable law. Clicking on that icon indicates your clear and irrevocable acceptance of this Licence and all of its terms and conditions. Similarly, you irrevocably accept this Licence and all of its terms and conditions by exercising any rights granted to You by Article 2 of this Licence, such as the use of the Work, the creation by You of a Derivative Work or the Distribution or Communication by You of the Work or copies thereof. 11. Information to the public In case of any Distribution or Communication of the Work by means of electronic communication by You (for example, by offering to download the Work from a remote location) the distribution channel or media (for example, a website) must at least provide to the public the information requested by the applicable law regarding the Licensor, the Licence and the way it may be accessible, concluded, stored and reproduced by the Licensee. 12. Termination of the Licence The Licence and the rights granted hereunder will terminate automatically upon any breach by the Licensee of the terms of the Licence. Such a termination will not terminate the licences of any person who has received the Work from the Licensee under the Licence, provided such persons remain in full compliance with the Licence. 13. Miscellaneous Without prejudice of Article 9 above, the Licence represents the complete agreement between the Parties as to the Work. If any provision of the Licence is invalid or unenforceable under applicable law, this will not affect the validity or enforceability of the Licence as a whole. Such provision will be construed or reformed so as necessary to make it valid and enforceable. The European Commission may publish other linguistic versions or new versions of this Licence or updated versions of the Appendix, so far this is required and reasonable, without reducing the scope of the rights granted by the Licence. New versions of the Licence will be published with a unique version number. All linguistic versions of this Licence, approved by the European Commission, have identical value. Parties can take advantage of the linguistic version of their choice. 14. Jurisdiction Without prejudice to specific agreement between parties, - any litigation resulting from the interpretation of this License, arising between the European Union institutions, bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union, - any litigation arising between other parties and resulting from the interpretation of this License, will be subject to the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business. 15. Applicable Law Without prejudice to specific agreement between parties, - this Licence shall be governed by the law of the European Union Member State where the Licensor has his seat, resides or has his registered office, - this licence shall be governed by Belgian law if the Licensor has no seat, residence or registered office inside a European Union Member State. === Appendix Compatible Licences according to Article 5 EUPL are: - GNU General Public License (GPL) v. 2, v. 3 - GNU Affero General Public License (AGPL) v. 3 - Open Software License (OSL) v. 2.1, v. 3.0 - Eclipse Public License (EPL) v. 1.0 - CeCILL v. 2.0, v. 2.1 - Mozilla Public Licence (MPL) v. 2 - GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3 - Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for works other than software - European Union Public Licence (EUPL) v. 1.1, v. 1.2 - Québec Free and Open-Source Licence - Reciprocity (LiLiQ-R) or Strong Reciprocity (LiLiQ-R+) - The European Commission may update this Appendix to later versions of the above licences without producing a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the covered Source Code from exclusive appropriation. - All other changes or additions to this Appendix require the production of a new EUPL version. ================================================ FILE: README.md ================================================ # Docker Pi-hole [](https://github.com/pi-hole/docker-pi-hole/actions?query=workflow%3A%22Build+Image+and+Test%22) [](https://store.docker.com/community/images/pihole/pihole) [](https://store.docker.com/community/images/pihole/pihole)
## Upgrade Notes > [!NOTE] > **Using Watchtower?\ > See the [Note on Watchtower](https://docs.pi-hole.net/docker/tips-and-tricks/#note-on-watchtower) in our documentation**. > [!TIP] > Some users [have reported issues](https://github.com/pi-hole/docker-pi-hole/issues/963#issuecomment-1095602502) with using the `--privileged` flag on `2022.04` and above.\ > TL;DR, don't use that mode, and be [explicit with the permitted caps](https://docs.pi-hole.net/docker/#note-on-capabilities) (if needed) instead. ## Quick Start Using [Docker-compose](https://docs.docker.com/compose/install/): 1. Copy the below docker compose example and update as needed: ```yml # More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/ services: pihole: container_name: pihole image: pihole/pihole:latest ports: # DNS Ports - "53:53/tcp" - "53:53/udp" # Default HTTP Port - "80:80/tcp" # Default HTTPs Port. FTL will generate a self-signed certificate - "443:443/tcp" # Uncomment the line below if you are using Pi-hole as your DHCP server #- "67:67/udp" # Uncomment the line below if you are using Pi-hole as your NTP server #- "123:123/udp" environment: # Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g: 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' # Volumes store your data between container upgrades volumes: # For persisting Pi-hole's databases and common configuration file - './etc-pihole:/etc/pihole' # Uncomment the below if you have custom dnsmasq config files that you want to persist. Not needed for most starting fresh with Pi-hole v6. If you're upgrading from v5 you and have used this directory before, you should keep it enabled for the first v6 container start to allow for a complete migration. It can be removed afterwards. Needs environment variable FTLCONF_misc_etc_dnsmasq_d: 'true' #- './etc-dnsmasq.d:/etc/dnsmasq.d' cap_add: # See https://docs.pi-hole.net/docker/#note-on-capabilities # Required if you are using Pi-hole as your DHCP server, else not needed - NET_ADMIN # Required if you are using Pi-hole as your NTP client to be able to set the host's system time - SYS_TIME # Optional, if Pi-hole should get some more processing time - SYS_NICE restart: unless-stopped ``` 2. Run `docker compose up -d` to build and start pi-hole (Syntax may be `docker-compose` on older systems). > [!NOTE] > Volumes are recommended for persisting data across container re-creations for updating images. ### Automatic Ad List Updates `cron` is baked into the container and will grab the newest versions of your lists and flush your logs. This happens once per week in the small hours of Sunday morning. ## Documentation For more detailed information, please refer to our documentation: - [Running DHCP from Docker Pi-Hole](https://docs.pi-hole.net/docker/DHCP/) - [Configuration](https://docs.pi-hole.net/docker/configuration/) - [Tips and Tricks](https://docs.pi-hole.net/docker/tips-and-tricks/) - [Docker tags and versioning](https://docs.pi-hole.net/docker/#docker-tags-and-versioning) - [Upgrading, Persistence, and Customizations](https://docs.pi-hole.net/docker/upgrading/) ## Docker tags and versioning The primary docker tags are explained in the following table. [Click here to see the full list of tags](https://hub.docker.com/r/pihole/pihole/tags). See [GitHub Release notes](https://github.com/pi-hole/docker-pi-hole/releases) to see the specific version of Pi-hole Core, Web, and FTL included in the release. The Date-based (including incremented "Patch" versions) do not relate to any kind of semantic version number, rather a date is used to differentiate between the new version and the old version, nothing more. Release notes will always contain full details of changes in the container, including changes to core Pi-hole components. | tag | description | | :--- | :--- | | `latest` | Always the latest release | | `2022.04.0` | Date-based release | | `nightly` | Built and pushed whenever there are changes on the `development` branch and additionally produced by the scheduled nightly job. These are the most experimental development images and may change frequently | ## User Feedback Please report issues on the [GitHub project](https://github.com/pi-hole/docker-pi-hole) when you suspect something docker related. Pi-hole or general docker questions are best answered on our [user forums](https://discourse.pi-hole.net/c/bugs-problems-issues/docker/30) ================================================ FILE: build.sh ================================================ #!/bin/bash # Usage function usage() { echo "Usage: $0 [-l] [-f