From 17279be549d8f95268c32729d9c78dd4abe85fbf Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Fri, 13 Sep 2024 16:02:36 -0300 Subject: [PATCH 1/3] Use a better format for the "BREAKING CHANGES" alert and set the new version number to v6 Signed-off-by: RD WebDesign --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 85005009..7077cff9 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,12 @@ ## Upgrade Notes -## !!! THIS VERSION CONTAINS BREAKING CHANGES - -### v[ChangeMeBeforeTagging] has been entirely redesigned from the ground up and contains many breaking changes. Environment variable names have changed, script locations may have changed. Please read the the Readme carefully before proceeding +> [!CAUTION] +> +> ## !!! THIS VERSION CONTAINS BREAKING CHANGES +> **v6 has been entirely redesigned from the ground up and contains many breaking changes.** +> +> Environment variable names have changed, script locations may have changed.
Please read the README carefully before proceeding. --- From ca7637decdc225aa0db233bbcfbde176d87c8444 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Fri, 13 Sep 2024 16:04:04 -0300 Subject: [PATCH 2/3] Use the same logo and header used in web repo Signed-off-by: RD WebDesign --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7077cff9..78e7554c 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,23 @@ [![Build Status](https://github.com/pi-hole/docker-pi-hole/workflows/Test%20&%20Build/badge.svg)](https://github.com/pi-hole/docker-pi-hole/actions?query=workflow%3A%22Test+%26+Build%22) [![Docker Stars](https://img.shields.io/docker/stars/pihole/pihole.svg?maxAge=604800)](https://store.docker.com/community/images/pihole/pihole) [![Docker Pulls](https://img.shields.io/docker/pulls/pihole/pihole.svg?maxAge=604800)](https://store.docker.com/community/images/pihole/pihole) -

-Pi-hole
-

+
+ + Pi-hole website + +
+ Network-wide ad blocking via your own Linux hardware +
+
+ +
+
+
## Upgrade Notes From a780403fa5e4fab4ad86dd91868041d8a626fb96 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Fri, 13 Sep 2024 16:29:42 -0300 Subject: [PATCH 3/3] Tweak Readme text and formatting mainly format changes, removal of trailing spaces, addition or removal of line breaks and some text corrections Signed-off-by: RD WebDesign --- README.md | 75 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 78e7554c..d377b7f4 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,13 @@ --- -- **Using Watchtower? See the [Note on Watchtower](#note-on-watchtower) at the bottom of this readme** +> [!NOTE] +> **Using Watchtower?\ +> See the [Note on Watchtower](#note-on-watchtower) at the bottom of this readme** -- 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://github.com/pi-hole/docker-pi-hole#note-on-capabilities) (if needed) instead +> [!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://github.com/pi-hole/docker-pi-hole#note-on-capabilities) (if needed) instead ## Quick Start @@ -42,14 +46,12 @@ 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 + image: pihole/pihole:latest ports: # DNS Ports - "53:53/tcp" @@ -59,7 +61,7 @@ services: # Default HTTPs Port. FTL will generate a self-signed certificate - "443:443/tcp" # Uncomment the below if using Pi-hole as your DHCP Server - #- "67:67/udp" + #- "67:67/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' @@ -70,18 +72,19 @@ services: # 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. - #- './etc-dnsmasq.d:/etc/dnsmasq.d' + #- './etc-dnsmasq.d:/etc/dnsmasq.d' cap_add: # See https://github.com/pi-hole/docker-pi-hole#note-on-capabilities # Required if you are using Pi-hole as your DHCP server, else not needed - - NET_ADMIN + - NET_ADMIN restart: unless-stopped ``` 2. Run `docker compose up -d` to build and start pi-hole (Syntax may be `docker-compose` on older systems) 3. If using Docker's default `bridge` network setting, set the environment variable `FTLCONF_dns_listeningMode` to `all` -nb. Volumes are recommended for persisting data across container re-creations for updating images. +> [!NOTE] +> Volumes are recommended for persisting data across container re-creations for updating images. ### Automatic Ad List Updates @@ -89,17 +92,22 @@ nb. Volumes are recommended for persisting data across container re-creations fo ## Running DHCP from Docker Pi-Hole -There are multiple different ways to run DHCP from within your Docker Pi-hole container but it is slightly more advanced and one size does not fit all. DHCP and Docker's multiple network modes are covered in detail on our docs site: [Docker DHCP and Network Modes](https://docs.pi-hole.net/docker/DHCP/) +There are multiple different ways to run DHCP from within your Docker Pi-hole container, but it is slightly more advanced and one size does not fit all. + +DHCP and Docker's multiple network modes are covered in detail on our docs site: [Docker DHCP and Network Modes](https://docs.pi-hole.net/docker/DHCP/) ## Configuration -It is recommended that you use environment variables to configure the Pi-hole docker container (more details below), however if you are persisting your `/etc/pihole` directory, you may choose instead to set them via the web interface or by directly editing `pihole.toml`. +It is recommended that you use environment variables to configure the Pi-hole docker container (more details below), however if you are persisting your `/etc/pihole` directory, you may choose instead to set them via the web interface or by directly editing `pihole.toml`. -**Please Note**: Settings that are set via environment variables effectively become read-only, meaning that you will not be able to change them in the web interface or CLI. This is to ensure a "single source of truth" on the config. If you later unset an environment variable, then FTL will revert to the default value for that setting. +> [!WARNING] +> Settings that are set via environment variables effectively become _**read-only**_, meaning that you will not be able to change them in the web interface or CLI. This is to ensure a "single source of truth" on the config.
If you later unset an environment variable, then FTL will revert to the default value for that setting. ### Web interface password -To set a specific password for the web interface, use the environment variable `FTLCONF_webserver_api_password`. If this variable is not detected, and you have not already set one via `pihole setpassword` / `pihole-FTL --config webserver.api.password` inside the container, then a random password will be assigned on startup, this will be printed to the log. Run `docker logs pihole | grep random password` to find it. +To set a specific password for the web interface, use the environment variable `FTLCONF_webserver_api_password`. + +If this variable is not detected, and you have not already set one via `pihole setpassword` / `pihole-FTL --config webserver.api.password` inside the container, then a random password will be assigned on startup, this will be printed to the log. Run `docker logs pihole | grep random password` to find it. To explicitly set no password, set `FTLCONF_webserver_api_password: ''` @@ -108,16 +116,16 @@ To explicitly set no password, set `FTLCONF_webserver_api_password: ''` | Variable | Default | Value | Description | | -------- | ------- | ----- | ---------- | | `TZ` | UTC | `` | Set your [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to make sure logs rotate at local midnight instead of at UTC midnight. -| `FTLCONF_webserver_api_password` | random | `` | password. Run `docker logs pihole \| grep random` to find your random pass. -| `FTLCONF_dns_upstreams` | `8.8.8.8;8.8.4.4` | IPs delimited by `;` | Upstream DNS server(s) for Pi-hole to forward queries to, separated by a semicolon
(supports non-standard ports with `#[port number]`) e.g `127.0.0.1#5053;8.8.8.8;8.8.4.4`
(supports [Docker service names and links](https://docs.docker.com/compose/networking/) instead of IPs) e.g `upstream0,upstream1` where `upstream0` and `upstream1` are the service names of or links to docker services
Note: The existence of this environment variable assumes this as the _sole_ management of upstream DNS. Upstream DNS added via the web interface will be overwritten on container restart/recreation | +| `FTLCONF_webserver_api_password` | random | `` | password.
Run `docker logs pihole \| grep random` to find your random password. +| `FTLCONF_dns_upstreams` | `8.8.8.8;8.8.4.4` | IPs delimited by `;` | Upstream DNS server(s) for Pi-hole to forward queries to, separated by a semicolon

Supports non-standard ports with: `#[port number]`, e.g `127.0.0.1#5053;8.8.8.8;8.8.4.4`

Supports [Docker service names and links](https://docs.docker.com/compose/networking/) instead of IPs, e.g `upstream0,upstream1` where `upstream0` and `upstream1` are the service names of or links to docker services

**Note:** The existence of this environment variable assumes this as the _sole_ management of upstream DNS. Upstream DNS added via the web interface will be overwritten on container restart/recreation | ### Optional Variables | Variable | Default | Value | Description | | -------- | ------- | ----- | ---------- | | `TAIL_FTL_LOG` | unset | `` | Whether or not to output the FTL log when running the. Useful for debugging/watching what FTL is doing. -| `FTLCONF_[SETTING]` | unset | As per documentation | Customize pihole.toml with settings described in the . Replace `.` with `_`, e.g for `dns.dnssec=true` use `FTLCONF_dns_dnssec: 'true'`
Array type configs should be delimited with `;`| -| `PIHOLE_UID` | `100` | Number | Overrides image's default pihole user id to match a host user id
**IMPORTANT**: id must not already be in use inside the container! | +| `FTLCONF_[SETTING]` | unset | As per documentation | Customize pihole.toml with settings described in the .

Replace `.` with `_`, e.g for `dns.dnssec=true` use `FTLCONF_dns_dnssec: 'true'`
Array type configs should be delimited with `;`| +| `PIHOLE_UID` | `100` | Number | Overrides image's default pihole user id to match a host user id
**IMPORTANT**: id must not already be in use inside the container!| | `PIHOLE_GID` | `101` | Number | Overrides image's default pihole group id to match a host group id
**IMPORTANT**: id must not already be in use inside the container!| ### Advanced Variables @@ -125,17 +133,17 @@ To explicitly set no password, set `FTLCONF_webserver_api_password: ''` | Variable | Default | Value | Description | | -------- | ------- | ----- | ---------- | | `FTL_CMD` | `no-daemon` | `no-daemon -- ` | Customize the options with which dnsmasq gets started. e.g. `no-daemon -- --dns-forward-max 300` to increase max. number of concurrent dns queries on high load setups. | -| `DNSMASQ_USER` | unset | `` | Allows changing the user that FTLDNS runs as. Default: `pihole`, some systems such as Synology NAS may require you to change this to `root` (See [#963](https://github.com/pi-hole/docker-pi-hole/issues/963)) | +| `DNSMASQ_USER` | unset | `` | Allows changing the user that FTLDNS runs as. Default: `pihole`, some systems such as Synology NAS may require you to change this to `root`

(See [#963](https://github.com/pi-hole/docker-pi-hole/issues/963)) | | `ADDITIONAL_PACKAGES`| unset | Space separated list of APKs | HERE BE DRAGONS. Mostly for development purposes, this just makes it easier for those of us that always like to have whatever additional tools we need inside the container for debugging | Here is a rundown of other arguments for your docker-compose / docker run. | Docker Arguments | Description | | ---------------- | ----------- | -| `-p :` **Recommended** | Ports to expose (53, 80, 67), the bare minimum ports required for Pi-holes HTTP and DNS services +| `-p :` **Recommended** | Ports to expose (53, 80, 443, 67), the bare minimum ports required for Pi-holes HTTP, HTTPS and DNS services | `--restart=unless-stopped`
**Recommended** | Automatically (re)start your Pi-hole on boot or in the event of a crash | `-v $(pwd)/etc-pihole:/etc/pihole`
**Recommended** | Volumes for your Pi-hole configs help persist changes across docker image updates -| `--net=host`
_Optional_ | Alternative to `-p :` arguments (Cannot be used at same time as -p) if you don't run any other web application. DHCP runs best with --net=host, otherwise your router must support dhcp-relay settings. +| `--net=host`
_Optional_ | Alternative to `-p :` arguments (Cannot be used at same time as `-p`) if you don't run any other web application. DHCP runs best with `--net=host`, otherwise your router must support dhcp-relay settings. | `--cap-add=NET_ADMIN`
_Recommended_ | Commonly added capability for DHCP, see [Note on Capabilities](#note-on-capabilities) below for other capabilities. | `--dns=n.n.n.n`
_Optional_ | Explicitly set container's DNS server. It is **_not recommended_** to set this to `localhost`/`127.0.0.1`. | `--env-file .env`
_Optional_ | File to store environment variables for docker replacing `-e key=value` settings. Here for convenience @@ -173,7 +181,9 @@ network: version: 2 ``` -Note that it is also possible to disable `systemd-resolved` entirely. However, this can cause problems with name resolution in vpns ([see bug report](https://bugs.launchpad.net/network-manager/+bug/1624317)). It also disables the functionality of netplan since systemd-resolved is used as the default renderer ([see `man netplan`](http://manpages.ubuntu.com/manpages/bionic/man5/netplan.5.html#description)). If you choose to disable the service, you will need to manually set the nameservers, for example by creating a new `/etc/resolv.conf`. +Note that it is also possible to disable `systemd-resolved` entirely. However, this can cause problems with name resolution in vpns ([see bug report](https://bugs.launchpad.net/network-manager/+bug/1624317)).\ +It also disables the functionality of netplan since systemd-resolved is used as the default renderer ([see `man netplan`](http://manpages.ubuntu.com/manpages/bionic/man5/netplan.5.html#description)).\ +If you choose to disable the service, you will need to manually set the nameservers, for example by creating a new `/etc/resolv.conf`. Users of older Ubuntu releases (circa 17.04) will need to disable dnsmasq. @@ -183,9 +193,11 @@ Users of older Ubuntu releases (circa 17.04) will need to disable dnsmasq. ## Docker tags and versioning -The primary docker tags are explained in the following table. [Click here to see the full list of tags](https://store.docker.com/community/images/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 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 +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 |---------------------|--------------------------------------------------------------------------------------------------------------------------------------------| @@ -202,20 +214,27 @@ The standard Pi-hole customization abilities apply to this docker, but with dock ### Upgrading / Reconfiguring -Do not attempt to upgrade (`pihole -up`) or reconfigure (`pihole -r`). New images will be released for upgrades, upgrading by replacing your old container with a fresh upgraded image is the 'docker way'. Long-living docker containers are not the docker way since they aim to be portable and reproducible, why not re-create them often! Just to prove you can. +Do not attempt to upgrade (`pihole -up`) or reconfigure (`pihole -r`). + +New images will be released for upgrades, upgrading by replacing your old container with a fresh upgraded image is the 'docker way'. Long-living docker containers are not the docker way since they aim to be portable and reproducible, why not re-create them often! Just to prove you can. 0. Read the release notes for both this Docker release and the Pi-hole release - This will help you avoid common problems due to any known issues with upgrading or newly required arguments or variables - We will try to put common break/fixes at the top of this readme too 1. Download the latest version of the image: `docker pull pihole/pihole` 2. Throw away your container: `docker rm -f pihole` - - **Warning** When removing your pihole container you may be stuck without DNS until step 3; **docker pull** before **docker rm -f** to avoid DNS interruption. + - **Warning:** When removing your pihole container you may be stuck without DNS until step 3; **`docker pull`** before **`docker rm -f`** to avoid DNS interruption. - 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://martinfowler.com/bliki/PhoenixServer.html) 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. +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. ### Building the image locally @@ -245,7 +264,7 @@ docker buildx build src/. --tag pihole:local --no-cache ### Pi-hole features -Here are some relevant wiki pages from [Pi-hole's documentation](https://docs.pi-hole.net). +Here are some relevant wiki pages from [Pi-hole's documentation](https://docs.pi-hole.net). We install all pihole utilities so the the built in [pihole commands](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738) will work via `docker exec ` like so: