Skip to content

Commit 875cf63

Browse files
authored
Merge pull request #1864 from pi-hole/development
Development
2 parents 2dd2df1 + cde1cc2 commit 875cf63

File tree

13 files changed

+176
-251
lines changed

13 files changed

+176
-251
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,23 @@ env:
1616

1717
jobs:
1818
build:
19-
runs-on: ubuntu-latest
19+
runs-on: ${{ matrix.runner }}
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
platform: [linux/amd64, linux/386, linux/arm/v6, linux/arm/v7, linux/arm64, linux/riscv64]
23+
include:
24+
- platform: linux/amd64
25+
runner: ubuntu-latest
26+
- platform: linux/386
27+
runner: ubuntu-latest
28+
- platform: linux/arm/v6
29+
runner: ubuntu-24.04-arm
30+
- platform: linux/arm/v7
31+
runner: ubuntu-24.04-arm
32+
- platform: linux/arm64
33+
runner: ubuntu-24.04-arm
34+
- platform: linux/riscv64
35+
runner: ubuntu-24.04-arm
2436

2537
steps:
2638
- name: Prepare name for digest up/download

.github/workflows/build-and-test.yml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,49 @@ on:
33
pull_request:
44

55
jobs:
6-
test:
7-
runs-on: ubuntu-latest
6+
build-and-test:
7+
runs-on: ${{ matrix.runner }}
88
strategy:
99
fail-fast: false
1010
matrix:
11-
# Official docker images for docker are only available for amd64 and arm64
12-
# TODO: Look at: https://github.com/docker-library/official-images#architectures-other-than-amd64
13-
# Is testing on all platforms really necessary?
14-
# Disabled arm64 tests for the time being, something is wrong with the test config and the volumes are getting shared between the test containers on different architectures
15-
#platform: [linux/amd64, linux/arm64]
16-
platform: [linux/amd64]
11+
include:
12+
- platform: linux/amd64
13+
runner: ubuntu-latest
14+
- platform: linux/386
15+
runner: ubuntu-latest
16+
- platform: linux/arm/v6
17+
runner: ubuntu-24.04-arm
18+
- platform: linux/arm/v7
19+
runner: ubuntu-24.04-arm
20+
- platform: linux/arm64
21+
runner: ubuntu-24.04-arm
22+
- platform: linux/riscv64
23+
runner: ubuntu-24.04-arm
24+
env:
25+
CI_ARCH: ${{ matrix.platform }}
1726
steps:
1827
- name: Checkout Repo
1928
uses: actions/checkout@v4
2029

2130
- name: Set up QEMU
2231
uses: docker/setup-qemu-action@v3
32+
33+
- name: Set up Python
34+
uses: actions/[email protected]
2335
with:
24-
platforms: ${{ matrix.platform }}
36+
python-version: "3.13"
37+
38+
- name: Run black formatter
39+
run: |
40+
pip install black
41+
black --check --diff test/tests/
42+
43+
- name: Install wheel
44+
run: pip install wheel
2545

26-
- name: Set up Docker Buildx
27-
uses: docker/setup-buildx-action@v3
46+
- name: Install dependencies
47+
run: pip install -r test/requirements.txt
2848

29-
- name: Run Tests
49+
- name: Test with tox
3050
run: |
31-
echo "Building image to test"
32-
PLATFORM=${{ matrix.platform }} ./build-and-test.sh
51+
CIPLATFORM=${{ env.CI_ARCH }} tox -c test/tox.ini

README.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ If this variable is not detected and you have not already set one via `pihole se
144144
| `FTLCONF_[SETTING]` | unset | As per documentation | Customize pihole.toml with settings described in the [API Documentation](https://docs.pi-hole.net/api).<br><br>Replace `.` with `_`, e.g for `dns.dnssec=true` use `FTLCONF_dns_dnssec: 'true'`.<br/>Array type configs should be delimited with `;`.|
145145
| `PIHOLE_UID` | `1000` | Number | Overrides image's default pihole user id to match a host user id.<br/>**IMPORTANT**: id must not already be in use inside the container!|
146146
| `PIHOLE_GID` | `1000` | Number | Overrides image's default pihole group id to match a host group id.<br/>**IMPORTANT**: id must not already be in use inside the container!|
147-
| `WEBPASSWORD_FILE` | unset| `<Docker secret file>` | Set an Admin password using [Docker secrets](https://docs.docker.com/engine/swarm/secrets/). If `FTLCONF_webserver_api_password` is set, `WEBPASSWORD_FILE` is ignored. If `FTLCONF_webserver_api_password` is empty, and `WEBPASSWORD_FILE` is set to a valid readable file, then `FTLCONF_webserver_api_password` will be set to the contents of `WEBPASSWORD_FILE`. |
147+
| `WEBPASSWORD_FILE` | unset| `<Docker secret file>` | Set an Admin password using Docker secrets with [Swarm](https://docs.docker.com/engine/swarm/secrets/) or [Compose](https://docs.docker.com/compose/how-tos/use-secrets/). If `FTLCONF_webserver_api_password` is set, `WEBPASSWORD_FILE` is ignored. If `FTLCONF_webserver_api_password` is empty, and `WEBPASSWORD_FILE` is set to a valid readable file, then `FTLCONF_webserver_api_password` will be set to the contents of `WEBPASSWORD_FILE`. See [WEBPASSWORD_FILE Example](https://docs.pi-hole.net/docker/configuration/#webpassword_file-example) for additional information.|
148148

149149
### Advanced Variables
150150

@@ -183,36 +183,8 @@ Here is a rundown of other arguments for your docker-compose / docker run.
183183
- Docker's default network mode `bridge` isolates the container from the host's network. This is a more secure setting, but requires setting the Pi-hole DNS option for _Interface listening behavior_ to "Listen on all interfaces, permit all origins".
184184
- If you're using a Red Hat based distribution with an SELinux Enforcing policy, add `:z` to line with volumes.
185185

186-
### Installing on Ubuntu or Fedora
187-
188-
Modern releases of Ubuntu (17.10+) and Fedora (33+) include [`systemd-resolved`](http://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html) which is configured by default to implement a caching DNS stub resolver. This will prevent pi-hole from listening on port 53.
189-
The stub resolver should be disabled with: `sudo sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf`.
190-
191-
This will not change the nameserver settings, which point to the stub resolver thus preventing DNS resolution. Change the `/etc/resolv.conf` symlink to point to `/run/systemd/resolve/resolv.conf`, which is automatically updated to follow the system's [`netplan`](https://netplan.io/):
192-
`sudo sh -c 'rm /etc/resolv.conf && ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf'`.
193-
After making these changes, you should restart systemd-resolved using `systemctl restart systemd-resolved`.
194-
195-
Once pi-hole is installed, you'll want to configure your clients to use it ([see here](https://discourse.pi-hole.net/t/how-do-i-configure-my-devices-to-use-pi-hole-as-their-dns-server/245)). If you used the symlink above, your docker host will either use whatever is served by DHCP, or whatever static setting you've configured. If you want to explicitly set your docker host's nameservers you can edit the netplan(s) found at `/etc/netplan`, then run `sudo netplan apply`.
196-
197-
Example netplan:
198-
199-
```yaml
200-
network:
201-
ethernets:
202-
ens160:
203-
dhcp4: true
204-
dhcp4-overrides:
205-
use-dns: false
206-
nameservers:
207-
addresses: [127.0.0.1]
208-
version: 2
209-
```
210-
211-
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)).\
212-
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)).\
213-
If you choose to disable the service, you will need to manually set the nameservers, for example by creating a new `/etc/resolv.conf`.
214-
215-
Users of older Ubuntu releases (circa 17.04) will need to disable dnsmasq.
186+
> [!TIP]
187+
> All further tips and tricks can be found in the [Pi-hole documentation](https://docs.pi-hole.net/docker/tips-and-tricks/)
216188

217189
## Installing on Dokku
218190

build-and-test.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/Dockerfile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
# syntax=docker/dockerfile:1
22
ARG FTL_SOURCE=remote
33
# Pull Stable images
4-
FROM alpine:3.22 AS base-stable
5-
FROM base-stable AS base-386
6-
FROM base-stable AS base-amd64
7-
FROM base-stable AS base-arm
8-
FROM base-stable AS base-arm64
9-
# Pull Edge images
10-
FROM alpine:edge AS base-edge
11-
FROM base-edge AS base-riscv64
12-
# Use the base image for the current architecture
13-
FROM base-${TARGETARCH} AS base
14-
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
4+
FROM alpine:3.22 AS base
155

166
ARG TARGETPLATFORM
177
ARG WEB_BRANCH="development"
@@ -40,7 +30,7 @@ RUN apk add --no-cache \
4030
git \
4131
# Install grep to avoid issues in pihole -w/b with the default busybox grep
4232
grep \
43-
iproute2-ss \
33+
iproute2 \
4434
jq \
4535
libcap \
4636
logrotate \

test/Dockerfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/TESTING.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
# Prerequisites
22

3-
Make sure you have bash & docker installed.
4-
Python and some test hacks are crammed into the `Dockerfile_build` file for now.
5-
Revisions in the future may re-enable running python on your host (not just in docker).
3+
Make sure you have `docker`, `python` and `tox` installed.
64

75
# Running tests locally
86

9-
`./build-and-test.sh`
7+
`tox -c test/tox.ini`
108

119
Should result in:
1210

13-
- An image named `pihole:[branch-name]` being built
11+
- An image named `pihole:CI_container` being built
1412
- Tests being ran to confirm the image doesn't have any regressions
15-
16-
# Modify Pipfile
17-
18-
You can enter into the test docker image using `./build-and-test.sh enter`.
19-
From there, you can `cd test` and execute any needed pipenv commands.

test/cmd.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

test/requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
pytest == 8.4.0
2-
pytest-xdist == 3.7.0
1+
pytest == 8.4.1
32
pytest-testinfra == 10.2.2
4-
black == 25.1.0
53
pytest-clarity == 1.0.1
4+
tox == 4.27.0
5+
# Not adding pytest-xdist as using pytest with n > 1 cores
6+
# causes random issues with the emulated architectures

0 commit comments

Comments
 (0)