Compare commits

...

265 Commits

Author SHA1 Message Date
Adam Warner
1b35e7fdd4 Merge pull request #1003 from pi-hole/revert-to-buster
Revert base image to buster, we can try bullseye again later, there are a couple of teething issues
2022-02-12 22:56:27 +00:00
Adam Warner
90f4ebe882 revert base image to buster, we can try bullseye again later
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-02-12 22:48:58 +00:00
Adam Warner
6b5f746a15 Merge pull request #999 from pi-hole/master
sync: master to dev
2022-02-12 12:30:12 +00:00
Adam Warner
2a705ecfe9 Add investigating label to ignore list 2022-02-12 11:18:34 +00:00
Adam Warner
5b41b63fa0 Merge pull request #997 from rdwebdesign/alert_branch
Adding text message asking to select "dev" branch on new PR
2022-02-08 15:15:08 +00:00
Adam Warner
0a7427371e Merge pull request #996 from rdwebdesign/add_TZ_env
Adding `TZ` var to PHP environment
2022-02-08 15:14:03 +00:00
RD WebDesign
5efcd88b20 Text message asking to select "dev" branch on new PR
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-02-07 16:47:59 -03:00
RD WebDesign
fd0b9bf9d3 Adding TZ var to PHP environment
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-02-06 17:38:15 -03:00
Adam Warner
a42f67f5ee Merge pull request #994 from sebastiansterk/patch-1
make prerequisites more precise
2022-02-04 21:29:47 +00:00
Adam Warner
89b03445a1 Merge pull request #992 from pi-hole/master
sync: master to dev
2022-02-04 21:28:37 +00:00
Adam Warner
13c81a9091 Merge pull request #990 from edgd1er/dev_origin
[Experimental] Add ability to Redirect lighttpd logs to stdout
2022-02-04 19:40:32 +00:00
Sebastian Sterk
3d6f53899f make prerequisites more precise 2022-02-01 00:17:59 +01:00
Adam Warner
69d4349bbb Create dco.yml 2022-01-28 10:19:44 +00:00
Adam Warner
1d51da7f47 Create release.yml 2022-01-28 10:18:50 +00:00
Adam Warner
351b9a7f85 Create sync-back-to-dev.yml
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-28 10:18:16 +00:00
Adam Warner
19bb9dcc2f use label stale on stale issues instead of Submitter attention required, which doesn't always make sense
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-28 10:15:49 +00:00
edgd1er
2db09515d7 add suggested changes to send logs to stdout
Signed-off-by: edgd1er <edgd1er@hotmail.com>
2022-01-28 08:12:40 +01:00
edgd1er
06d6b74c63 add finish scripts for logs. prevent duplicate cat processes, lighttpd start loop
Signed-off-by: edgd1er <edgd1er@hotmail.com>
2022-01-27 05:49:59 +01:00
edgd1er
140312b79c Redirect lighttpd logs to stdout
Signed-off-by: edgd1er <edgd1er@hotmail.com>
2022-01-27 04:17:42 +01:00
Adam Warner
e6dd028c61 switch from -wU to -wu, as there is nothing set up to notify that the daemon's are ready - effectively supresses a warning message that we don't need to pay attention to
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-26 21:41:17 +00:00
Adam Warner
1f3951431b tweak per https://github.com/pi-hole/docker-pi-hole/pull/991#pullrequestreview-864021964 2022-01-26 21:06:17 +00:00
Adam Warner
a29faad9df Merge pull request #991 from pi-hole/tweak/lighttpd-run
Touch/chown lighttpd access/error logs on service start
2022-01-26 18:30:49 +00:00
Adam Warner
2eb9afc350 Touch/chown lighttpd access/error logs on service start. May not be 100% neccasery currently, but could be useful
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-26 18:29:14 +00:00
Adam Warner
25539a9c99 Merge pull request #982 from edgd1er/dev_origin
[Experimental] Add ability to change UID / GID for www-data and pihole user.
2022-01-20 17:16:04 +00:00
Adam Warner
778e993903 Move variable description to the Experimental section
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-20 17:12:18 +00:00
Adam Warner
510ca0b873 rechown /opt/pihole and pihole command in case of UID changing
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-20 17:10:19 +00:00
Adam Warner
eed203530e while I'm in here - drop S6 overlay version per https://github.com/just-containers/s6-overlay/issues/329
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-17 23:28:37 +00:00
Adam Warner
fe1676b9ed Move a few things about. Set permissions pihole-FT requires in it's run script. remove pihole-FTL test from test-config because nothing exists until it has started for the first time.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-17 23:28:02 +00:00
Adam Warner
c2870031e3 Merge pull request #987 from PeterDaveHelloKitchen/fix-#986
Use consistent method to kill process in s6 finish script
2022-01-17 22:03:36 +00:00
edgd1er
0ecde45d22 removed vars in compose sample.
Signed-off-by: edgd1er <edgd1er@hotmail.com>
2022-01-17 15:28:25 +01:00
edgd1er
2cec4fa719 change UID / GID for www-data and pihole user.
When mounting volumes, specific rights may be needed to write on mounted volumes on the host.

Signed-off-by: edgd1er <edgd1er@hotmail.com>
2022-01-17 15:28:25 +01:00
Peter Dave Hello
b29ac1ec18 Use consistent method to kill process in s6 finish script
If the process does not exist, the error message of `kill` command is a
little bit confusing:

`kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]`

Using `killall` in `/s6/debian-root/etc/services.d/pihole-FTL/finish` to
kill the process, like what we do in `cron/finish` & `lighttpd/finish`,
will make the usage in this project more consistent, and also, the
command `killall` will provide better & friendly output, like:

`pihole-FTL: no process found`

Close #986, cc #973

Signed-off-by: Peter Dave Hello <hsu@peterdavehello.org>
2022-01-17 22:19:23 +08:00
Adam Warner
0a20ef8955 Merge pull request #988 from pi-hole/master
sync `dev` to `master`
2022-01-17 13:04:28 +00:00
Adam Warner
13a3da65c8 Update stale.yml
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-12 09:17:26 +00:00
Adam Warner
b901a899ae add never-stale and bug labels to exemptions
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-11 19:11:51 +00:00
Adam Warner
9436389095 accidentally a complete path
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-09 21:35:21 +00:00
Adam Warner
6262433f4d Merge pull request #981 from pi-hole/new/PIHOLE_DNS_-source-of-truth
If PIHOLE_DNS_ env var is employed, use that as source of truth
2022-01-09 21:24:10 +00:00
Adam Warner
e0f05ef372 Remove any existing PIHOLE_DNS_ configurations before applying those that have been passed in via env var
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-09 21:05:53 +00:00
Adam Warner
2fb2202a17 Sync the minimal docker-compose examples. Remove note about pihole.log, it isn't neccasery (https://github.com/pi-hole/docker-pi-hole/issues/809)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-09 19:04:19 +00:00
Adam Warner
c6e859723c Merge pull request #978 from pi-hole/fix-2567a9b
Don't attempt to chmod pihole-FTL.db if it does not exist
2022-01-08 17:31:52 +00:00
Adam Warner
69e9272a91 Missed a reference removal in 2567ab9940
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-08 17:30:22 +00:00
Adam Warner
6e9790870c Use stale action from core repo to manage stale issues
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-08 17:18:04 +00:00
Adam Warner
0baf7b63d9 Merge pull request #976 from pi-hole/new/bullseye
Switch base image from Buster to Bullseye
2022-01-08 13:40:45 +00:00
Adam Warner
5e79db52ab This does not appear to be an issue on bullseye - tested with the same command's listed here https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923479, but switched out buster for bullseye. Confirmed I was able to repro the buster issue on docker desktop for windows
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-08 13:26:11 +00:00
Adam Warner
0018e46a28 Bullseye anyone?
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-08 12:55:54 +00:00
Adam Warner
25a8e0dcba Merge pull request #970 from AlexanderLieret/patch-webtheme
Update list of available web themes
2022-01-07 23:46:07 +00:00
Adam Warner
74707b576c Merge pull request #973 from pi-hole/tweak/serviceMonkeyPatch
Prevent logspam when restarting FTL (Error from kill command)
2022-01-07 23:20:42 +00:00
Adam Warner
9deb685cc0 When restarting the service - wait until the old proc has been killed before attempting to start it again. Prevents messages about the usuage of kill in the log.
Remove old comment

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-07 23:14:28 +00:00
Alexander Lieret
28892f4533 Update list of available web themes
Signed-off-by: Alexander Lieret <alexander.lieret@fau.de>
2022-01-06 17:16:04 +01:00
Adam Warner
4cc3587084 adjustment to custom interface tests to reflect new default behaviour in https://github.com/pi-hole/pi-hole/pull/4509
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-05 22:47:16 +00:00
Adam Warner
2567ab9940 only chown/chmod pihole-FTL.db if it exists
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-05 21:47:25 +00:00
Adam Warner
6b29503dd0 Tweak fix_capabilites output
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-05 19:37:13 +00:00
Adam Warner
806f734cdc Remove shim now that it is in the core repo https://github.com/pi-hole/pi-hole/pull/4515 (#965)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-04 21:46:18 +00:00
Adam Warner
2c6bc33e8d Increase verbosity of error message when capabilities cannot be set - add note to readme about default DNSMASQ_USER. See #963 for details (#964)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-04 18:50:37 +00:00
Adam Warner
2a7ea09d00 Readme tweaks
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-02 15:54:09 +00:00
Adam Warner
a5eda6844e use kill -15 (TERM) instead of 9 to exit FTL a bit more gracefully and save queries to the database
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-02 14:30:31 +00:00
Adam Warner
44bdfc1438 bump s6 to latest
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-02 14:30:06 +00:00
Adam Warner
0eb1a60d78 Switch default DNSMASQ_USER to pihole from root, and fix permissions on pihole-FTL.db to belong to pihole:pihole
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-02 14:29:54 +00:00
Adam Warner
8ea5f9c8dc Add CAP_SYS_NICE,CAP_CHOWN, and CAP_IPC_LOCK to the fix_capabilities() function
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-02 13:05:05 +00:00
Martin F. Schumann
2dde4a64c9 replace php env configuration lines if they are already present instead of adding them always (#952) (#957)
Signed-off-by: Martin Schumann <mfs@mfs.name>
2021-12-28 22:20:32 +00:00
Adam Warner
3f97e6e4fc Only use branch ref for tag if we're not building via schedule event (namely, don;t also tag "master" when doing nightly)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-12-25 13:38:10 +00:00
Phill
b0a5a0f163 Trailing slashes on volumes fail on newer versions of docker-compose (#949)
* Trailing slashes on volumes fail on newer versions of docker-compose

See [Issue 947](https://github.com/pi-hole/docker-pi-hole/issues/947)
for the background.

This PR proposes removing trailing slashes from all documentation,
examples and scripts.

Signed-off-by: Phill Kelley <pmk.57t49@lgosys.com>
2021-12-11 13:37:18 +00:00
Adam Warner
523762e47d scream test: removing linux/ppc64le as there are build errors - unsure if anyone is _actually_ using this in any case. I guess we'll find out...
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-12-11 00:21:51 +00:00
Adam Warner
7848d06325 Switch base from debian:buster-slim to ghcr.io/pi-hole/docker-pi-hole-base:buster-slim, which is updated weekly and should speed up build times on this end 2021-12-11 00:20:04 +00:00
Adam Warner
54ca7e9ce4 Merge branch 'dev' of github.com:pi-hole/docker-pi-hole into dev 2021-12-10 20:51:51 +00:00
Adam Warner
9a9ee41a45 - Replace PIHOLE_VERSION with PIHOLE_DOCKER_TAG
- reorder some stuff in the main Dockerfile
- Remove the CORE/WEB/FTL_VERSION args/env vars
- tweaks to GHA build script after some hints from @crazy-max
- always checkout dev versions of Pi-hole for nightly build, also make sure we're using dev branch of this repo
- keep pihole checkout enabled for dev and nightly tags

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-12-10 20:51:35 +00:00
Denis Khoshaba
f70a4f4022 Update Dockerfile to use COPY instead of ADD as recommended on https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy (#946)
Signed-off-by: TheDen <deniskhoshaba@gmail.com>

Co-authored-by: Adam Warner <me@adamwarner.co.uk>
2021-12-09 19:30:13 +00:00
Adam Warner
7049b5df03 remove references to porrt 443
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-12-09 17:09:36 +00:00
AlexandreRatte
4aaf0998a3 Customize pihole-FTL.conf with FTLCONF_ prefixed environment variables. (#944)
* Customize pihole-FTL.conf with FTLCONF_ prefixed environment variables.

Signed-off-by: Alexandre Ratte <alexandre.ratte@gmail.com>

* Reintroduced parsing of ServerIP* env vars and amended README for deprecated variables.

Signed-off-by: Alexandre Ratte <alexandre.ratte@gmail.com>
2021-11-26 16:58:10 +00:00
Adam Warner
27bdf81665 Combine nightly and main workflows into one. Tested functionality on a fork so this can come straight into dev
use dev images for the dev branch build.
Only disable pihole checkout on released tags - allow it in dev and nightly tags

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-11-17 23:42:49 +00:00
moritzbeck01
ff776c2ba4 [skip ci] Fixed link to reverse proxy (#939)
The example seems to no longer be using jwilder/nginx-proxy but the very similar nginxproxy/nginx-proxy. Additionally the link to the example was broken.
2021-10-31 14:41:55 +00:00
Fernando Fernández
e874dc1f3e Publish images to GHCR alongside DockerHub (#940)
Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
2021-10-31 14:39:56 +00:00
Adam Warner
c0d05f291d Add PIHOLE_VERSION as PIHOLE_DOCKER_TAG in the php environment instead of injecting the version into the admin page's footer (#930)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-10-23 16:32:14 +01:00
Adam Warner
a39726d183 remove reference to pihole/debian-base, replace with debian:{buster}-slim
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-10-09 18:48:17 +01:00
Adam Warner
5ed8b8ec7b Merge pull request #928 from pi-hole/fix/docker-namespace
* Use the namespace from secrets so others can build too.
* Add DOCKERHUB_NAMESPACE variable.
* Use hub namepace in all actions.

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-10-03 22:21:47 +01:00
Dan Schaper
aefeb2bc8d Use hub namepace in all actions.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-10-03 14:15:30 -07:00
Dan Schaper
4782f15123 Add DOCKERHUB_NAMESPACE variable.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-10-03 13:41:31 -07:00
Dan Schaper
73a335533b Use the namespace from secrets so others can build too.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-10-03 10:00:00 -07:00
Adam Warner
d036e0d0c0 Merge branch 'dev' 2021-09-29 22:58:07 +01:00
Adam Warner
3696f6065f Actually not needed as you can already choose to run it against whatever branch.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-16 20:58:35 +01:00
Adam Warner
9740d2b86a Add option to run build against another branch to workflow_dispatch
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-16 20:54:42 +01:00
Adam Warner
1b6318c0d9 Merge branch 'dev'
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-15 18:34:33 +01:00
Adam Warner
c371768800 And ppc64le - It might work, it might not. Someone will tell us if it doesn't.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-15 18:32:38 +01:00
Adam Warner
bc545b6049 Add linux/arm/v6 to platforms:
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-15 18:28:09 +01:00
Adam Warner
3942d9a740 Repalce PIHOLE_TAG with PIHOLE_VERSION, it isn't actually needed after all.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 23:43:59 +01:00
Adam Warner
944bc8eb79 use metadata-action to handle image tag names
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 23:27:06 +01:00
Adam Warner
55a682a94c Use the correct namespace to upload the images...
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 22:53:38 +01:00
Adam Warner
7624fc3d56 Reduce Test step to only one arch (amd64/buster)
Migrate build and push step to native github actions using docker buildX - which should _hopefully_ resolve #735
Make some adjustments to Dockerfile/build.yml/install.sh to allow both gh-actions-test.sh to build using the test suite, and github actions native commands to build online

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 22:34:24 +01:00
Adam Warner
9b106e6275 [skip ci] Maybe don't push the individual arch images. Test
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 18:03:53 +01:00
Adam Warner
17453166c2 [skip ci] I read the docs for actions/checkout wrong
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 17:09:47 +01:00
Adam Warner
521bed1c4f No need to build stretch images as well as buster
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 17:03:13 +01:00
Adam Warner
1cc3159518 update workflows to use env vars instead of patching VERSIONS file
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 16:53:17 +01:00
Adam Warner
ca69e29514 Always install lastest released Pi-hole unless otherwise indicated by environment variables CORE_VERSION/WEB_VERSION/FTL_VERSION
This is closer to mimicking the installation of Pi-hole on bare metal, and also shaves about 40MB off of the size of a container not using custom branches.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 16:46:19 +01:00
Adam Warner
b553462c95 Merge pull request #921 from pi-hole/tweak/imageversions
Untangle FTL Version from image building
2021-09-12 15:42:06 +01:00
Adam Warner
155d87f8c1 add a skip directive to test_volume_shell_script, as I can't work out how to fix it just yet...
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 14:24:50 +01:00
Adam Warner
6cec6f937f Bring GIT_TAG into the build environment for use as PIHOLE_VERSION in the container.
Remove the `pihole/pihole:` part of the PIHOLE_TAG in the python script (see #920)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-12 14:16:45 +01:00
Adam Warner
1a7bfdc2ee [skip ci] remove tag trigger, add release trigger
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-11 23:30:26 +01:00
Adam Warner
d84851c7a3 [skip ci] wildcard tags filter?
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-11 23:05:54 +01:00
Adam Warner
f0f96ee1ab [skip ci] Remove nightly beta build
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-11 22:55:56 +01:00
Adam Warner
9a800f7efd Update VERSIONS
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-11 22:28:41 +01:00
Adam Warner
52b21c6ef6 remove a bunch of filters for the branch builds. No sense in building master, and the other patterns are rarely actually used.
Remove the v* filter from tag to support proposed new tag versioning format (no v up the front end)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-11 18:58:46 +01:00
Adam Warner
0cceed3c83 Merge branch 'master' into dev 2021-09-06 22:43:22 +01:00
DL6ER
300fcf0c9e Merge pull request #916 from pi-hole/fix/capabilities
Add CAP_SYS_NICE, CAP_IPC_LOCK, CAP_CHOWN capabilites recommendation
2021-09-06 23:24:24 +02:00
DL6ER
ec3b4609bc Add CAP_SYS_NICE, CAP_IPC_LOCK, CAP_CHOWN capabilites recommendation
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-09-06 22:33:09 +02:00
Adam Warner
22ce49a123 Update nightly-build beta-v5.9.yml 2021-09-01 16:47:17 +01:00
Adam Warner
d821dcb2f0 Merge pull request #899 from majabojarska/fix_readme_typos
Fix README.md typos: "Descrption"
2021-08-26 09:33:43 +01:00
Adam Warner
ef54216986 Merge pull request #897 from pi-hole/feature/dependabot-actions
Dependabot manage GHA versions.
2021-08-26 09:32:38 +01:00
Dan Schaper
93092da023 Merge branch 'master' into feature/dependabot-actions 2021-08-25 14:22:58 -07:00
Adam Warner
3153346ec8 Merge pull request #905 from shaderecker/dev
Improve Docker Healthcheck: Shorten dig output
2021-08-22 22:45:41 +01:00
Sebastian Haderecker
ee6e1b36a9 Healthcheck: Shorten dig output
Signed-off-by: Sebastian Haderecker <sebastian.haderecker@gmail.com>
2021-08-22 22:04:36 +02:00
Adam Warner
73ad23b3b6 Merge branch 'dev' 2021-08-21 13:48:32 +01:00
Adam Warner
8700afa74d Add a nightly job for beta-v5.9 build. I keep forgetting to do it.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-08-21 13:48:17 +01:00
Adam Warner
1f19941b4c Merge branch 'dev' 2021-08-20 20:03:48 +01:00
Adam Warner
d69a8febae Merge pull request #902 from pi-hole/fix/ServerIP
Set FTL REPLY addresses instead of setupVars.conf.
2021-08-20 11:54:47 +01:00
Dan Schaper
a26eb9c6ad Set FTL REPLY addresses instead of setupVars.conf.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-08-19 17:29:54 -07:00
Maja Bojarska
2fcc4f66ee Fix typos "Descrption" 2021-08-15 14:15:09 +02:00
Dan Schaper
066f891cc1 Dependabot manage GHA versions.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-08-13 21:51:01 -07:00
Adam Warner
f50ce4637f Merge branch 'dev' 2021-08-06 01:27:57 +01:00
Adam Warner
56f4933237 Add an addional version injection case, for when core versions are not on alternative branches.
Move ENV VAR up higher in the Dockerfile so that `install.sh` actually sees it...

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-08-06 01:27:45 +01:00
Adam Warner
ea95c4f3e5 Merge branch 'dev' 2021-08-05 20:21:43 +01:00
Adam Warner
88518b036d Inject the container tag into the web interface footer
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-08-05 20:21:35 +01:00
Adam Warner
eb36372dea Merge branch 'dev' 2021-08-05 13:05:48 +01:00
Adam Warner
3865e77c6e Introduce internal PIHOLE_TAG variable so that we can see what tag the container is...
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-08-05 00:59:34 +01:00
Adam Warner
388f0f01a1 Disable some more pihole functions when run from within docker
Inject a message into the debug output that lets us know it's been run in a docker container

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-08-04 23:41:39 +01:00
Adam Warner
6c3ccfcd4f Merge pull request #893 from pi-hole/dev
Sync dev into master
2021-08-04 19:16:12 +01:00
Adam Warner
bdaf352a23 Allow for passing in optional branch name to workflow_dispatch build
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-08-04 18:52:37 +01:00
Adam Warner
55b257126b bump web_version 2021-08-04 18:44:04 +01:00
Adam Warner
1f1dc03a69 Merge pull request #888 from DistractionRectangle/Set-Phasers-to-Stun
Remove Unneccessary kill -9
2021-08-04 18:43:09 +01:00
Adam Warner
2b2e05dce3 Merge pull request #890 from danifr/patch-1
Use nginxproxy's DockerHub registry
2021-08-04 18:42:18 +01:00
Adam Warner
451fc19432 Merge branch 'dev' into patch-1 2021-08-04 18:41:56 +01:00
Adam Warner
8d536703d9 Merge branch 'master' into patch-1 2021-08-04 18:41:37 +01:00
Adam Warner
58e1eac241 Merge pull request #857 from orazioedoardo/fix-dns-bogus-priv
Fix DNS_BOGUS_PRIV description
2021-08-04 18:36:59 +01:00
Adam Warner
91d75416b8 Merge branch 'dev' into fix-dns-bogus-priv 2021-08-04 18:36:18 +01:00
Adam Warner
e65890208b Merge pull request #869 from tlgs/master
Add documentation for WEBPASSWORD_FILE
2021-08-04 18:34:58 +01:00
Adam Warner
559b317148 Merge branch 'dev' into master 2021-08-04 18:32:59 +01:00
Adam Warner
92999dff08 Merge pull request #886 from gbrsni/dev
Small correction in the 'Quick Start' section of the README
2021-08-04 18:29:00 +01:00
Adam Warner
1c6ba2d3c7 Merge pull request #882 from pi-hole/rem-debconf-set-selections
Remove no longer needed workaround for resolvconf
2021-08-04 18:27:55 +01:00
Adam Warner
a45725ed37 Merge pull request #883 from DistractionRectangle/fix-gravitydb-check
Fix gravityDB check
2021-08-04 16:51:17 +01:00
Adam Warner
e98dff970f Merge branch 'dev' into rem-debconf-set-selections 2021-08-04 16:40:05 +01:00
Adam Warner
e674bb4b81 Merge branch 'dev' into fix-gravitydb-check 2021-08-04 16:39:12 +01:00
Adam Warner
6820b2e55c Merge branch 'dev' into Set-Phasers-to-Stun 2021-08-04 16:39:06 +01:00
Adam Warner
cec28c79f4 Merge pull request #892 from pi-hole/tweak/multiarch-image-rebuild
Switch `multiarch/debian-debootstrap` to `pihole/debian-debootstrap` to fix build issues
2021-08-04 16:37:15 +01:00
Adam Warner
a44b7f1205 Use the rebuild images in the pihole namespace
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-08-04 15:50:12 +01:00
Adam Warner
bf82c2e8f5 [skip ci] Merge new envvar layout from master into dev
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-08-04 11:36:55 +01:00
Daniel Fernández
73f1cb3e74 Use nginxproxy's DockerHub registry
The official nginx-proxy repo is transitioned away from jwilder/nginx-proxy
ad7c02570b

Signed-off-by: Daniel Fernández <daferoes@gmail.com>
2021-08-04 11:23:10 +02:00
Dan Schaper
8565c3828d [skip ci] Break out defaults and values for clarity.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-08-03 13:43:44 -07:00
Dan Schaper
d0e6b77fdb Break out defaults and values for clarity.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-08-03 12:06:09 -07:00
gbrsni
b5046af667 Update README.md
Now suggesting usage of the '-d' flag.
2021-07-28 07:56:31 +00:00
D.Rect
408f71a480 Remove Unneccessary kill -9
Since piholeFTL test properly spins down it's no longer
necessary to kill it. He's dead Jim

Merge #300, added `piholeFTL test` to the startup sequence to
replace dnsmasq as a dependency for validate_env and gravity.sh.
kill -9 was kept as a work around to a standing issue that
`piholeFTL test` didn't spin down on it's own. This was fixed
in pi-hole/FTL#1067, landed on Apr 14 2021 and confirmed
working, as evinced by #834 which was filed the same day it
that fix landed.

Signed-off-by: D.Rect <48034372+DistractionRectangle@users.noreply.github.com>
2021-07-25 08:25:35 -07:00
D.Rect
7650896158 Fix gravityDB check
piholeFTL exposes configuration to relocate/rename gravityDB so
we cannot just check a hard coded location. This commit greps
pihole-FTL.conf for a custom location. Since pihole-FTL.conf
will eventually be replaced by TOML, some verbosity is added to
denote what config file is being checked and what location it
ultimately ended up checking.

Signed-off-by: D.Rect <48034372+DistractionRectangle@users.noreply.github.com>
2021-07-24 15:20:38 -07:00
Adam Warner
4dba6339c7 Remove no longer needed workaround for resolvconf
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-07-21 21:31:34 +01:00
Adam Warner
ba9d2e54bf Merge pull request #881 from pi-hole/fix-grav-firstrun
Ignore SKIPGRAVITYONBOOT if gravity.db does not exist
2021-07-21 21:03:16 +01:00
Adam Warner
d13ae118b4 Merge pull request #879 from MichaIng/patch-2
Remove obsolete debconf-apt-progress workaround
2021-07-21 19:54:04 +01:00
Adam Warner
7d82719839 Add note to README
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-07-21 19:45:28 +01:00
Adam Warner
70c573b69e Ignore SKIPGRAVITYONBOOT if not gravity.db exists, which will be the case if a fresh container is built with a new (empty) volume mapped to it.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-07-21 19:41:35 +01:00
MichaIng
bd121aa471 @MichaIng Remove obsolete debconf-apt-progress workaround
Since https://github.com/pi-hole/pi-hole/pull/2962 debconf-apt-progress is not used anymore in the basic-install.sh script, making the workaround obsolete.

Signed-off-by: MichaIng <micha@dietpi.com>
2021-07-21 20:16:46 +02:00
Adam Warner
28b5154e52 Include information about nightly/beta tags
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-07-04 22:07:46 +01:00
Adam Warner
918e6b1a21 convert / to - in FTL_VERSION so that image name is valid
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-07-04 21:46:45 +01:00
Adam Warner
9292d8e58a Merge branch 'master' into dev 2021-07-04 19:01:07 +01:00
Adam Warner
76be304d79 remove #yolo from nightly build yml
add custom build task... (not holding my breath)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-07-04 18:52:13 +01:00
Adam Warner
0c5ffd72f4 Merge pull request #873 from adyanth/dev
Update README.md to add changes in #867
2021-07-04 14:35:38 +01:00
Adyanth H
3022fa5092 Update README.md to add changes in #867
Signed-off-by: Adyanth H <adyanthh@gmail.com>
2021-07-04 13:09:16 +00:00
Adam Warner
2bc1e9c5cb Merge pull request #867 from adyanth/dev
Adding CORS_HOSTS to PHP environment
2021-07-04 11:49:42 +01:00
Tiago Seabra
f95bcba67a docs: add WEBPASSWORD_FILE to README
Signed-off-by: Tiago Seabra <tlgs@users.noreply.github.com>
2021-06-17 16:03:36 +01:00
Adyanth H
437e8ddbf5 Change tab to spaces
Signed-off-by: Adyanth H <33192449+adyanth@users.noreply.github.com>
2021-06-16 10:53:28 +05:30
Adyanth H
901ee3d10b Adding CORS_HOSTS to PHP environment
Signed-off-by: Adyanth H <33192449+adyanth@users.noreply.github.com>
2021-06-07 16:01:39 +05:30
Adam Warner
5ed2b9ab2c Merge pull request #861 from lightswitch05/feature/single-versions-file
Single versions file
2021-06-05 22:01:14 +01:00
Daniel
6b1765c638 Single pihole version file. Added 'python-dotenv' to parse for the VERSIONS file.
Signed-off-by: Daniel <daniel@developerdan.com>
2021-06-04 19:37:28 +00:00
Adam Warner
67b04365c5 Merge pull request #856 from AlexandreRatte/Issue_778
Introduced WEBTHEME environment variable to control user interface theme selection.
2021-06-03 12:03:14 +01:00
Orazio
39fa779653 Fix DNS_BOGUS_PRIV description
Setting the DNS_BOGUS_PRIV variable to true blocks (not enables) reverse dns lookups for private ranges.
2021-05-20 15:00:34 +02:00
Alexandre Ratte
2484c9ced2 Merge branch 'dev' of https://github.com/AlexandreRatte/docker-pi-hole into Issue_778
Signed-off-by: Alexandre Ratte <alexandre.ratte@gmail.com>
2021-05-15 08:38:43 -04:00
Alexandre Ratte
c4caf293f7 Amended comment.
Signed-off-by: Alexandre Ratte <alexandre.ratte@gmail.com>
2021-05-15 08:34:09 -04:00
Alexandre Ratte
d0c152eb25 Documented WEBTHEME environment variable.
Signed-off-by: Alexandre Ratte <alexandre.ratte@gmail.com>
2021-05-15 08:31:24 -04:00
Alexandre Ratte
995ec08608 Changed invalid WEBTHEME value's fallback theme to default-light, to stay inline with pi-hole's default.
Signed-off-by: Alexandre Ratte <alexandre.ratte@gmail.com>
2021-05-15 08:31:24 -04:00
Alexandre Ratte
504f3bac3b Added WEBTHEME parsing.
Signed-off-by: Alexandre Ratte <alexandre.ratte@gmail.com>
2021-05-15 08:31:24 -04:00
Adam Warner
99de0dce83 Merge pull request #689 from jparenas/cache_size
Add CACHE_SIZE environment variable to the available options
2021-05-12 20:50:45 +01:00
Adam Warner
58d2c6a934 [skip ci] Merge branch 'master' into dev 2021-05-12 20:24:11 +01:00
Adam Warner
0954c9f3dd [skip ci] remove buster from builds for now - they are not currently functional.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-05-12 20:23:51 +01:00
Adam Warner
c436a8a053 Merge branch 'master' into dev 2021-05-12 20:15:28 +01:00
Adam Warner
3acf505a1a [skip ci] Update multi-arch nightly build script, too. 2021-05-12 20:14:52 +01:00
Adam Warner
60063a81fd [Skip CI] Change nightly time from every 5 mins to 2am 2021-05-12 19:23:10 +01:00
Adam Warner
4963578fb5 Update nightly-experiment.yml 2021-05-12 18:45:55 +01:00
Adam Warner
e64b1d0c0a Create nightly-experiment.yml 2021-05-12 18:35:38 +01:00
jparenas
73378d1231 Add CUSTOM_CACHE_SIZE environment variable to the available options
Signed-off-by: jparenas <juan.p.arenas1@gmail.com>
2021-05-08 16:11:57 -05:00
Adam Warner
47c15eb65d Merge pull request #843 from pi-hole/install-overhaul
`install.sh` overhaul
2021-05-08 15:19:57 +01:00
Adam Warner
fcd002d507 Merge pull request #853 from lightswitch05/task/resync-dev-with-master
Resync dev with master
2021-05-04 15:50:00 +01:00
Daniel
bd343fc3da Merge branch 'master' of github.com:pi-hole/docker-pi-hole into task/resync-dev-with-master 2021-05-04 14:10:41 +00:00
dependabot[bot]
1f46ed4cbe Merge pull request #848 from pi-hole/dependabot/pip/cryptography-3.3.2 2021-05-03 23:08:02 +00:00
dependabot[bot]
3db66a66fa Bump cryptography from 2.8 to 3.3.2
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.8 to 3.3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.8...3.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 22:45:32 +00:00
Daniel
622294a7a1 Merge pull request #846 from pi-hole/dependabot/pip/py-1.10.0 2021-05-03 18:40:35 -04:00
dependabot[bot]
70ae3baf75 Bump py from 1.8.1 to 1.10.0
Bumps [py](https://github.com/pytest-dev/py) from 1.8.1 to 1.10.0.
- [Release notes](https://github.com/pytest-dev/py/releases)
- [Changelog](https://github.com/pytest-dev/py/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/py/compare/1.8.1...1.10.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 22:26:00 +00:00
Daniel
2b270c75b7 Merge pull request #845 from pi-hole/dependabot/pip/pyyaml-5.4 2021-05-03 18:21:02 -04:00
dependabot[bot]
1ff3d7a5fc Bump pyyaml from 5.2 to 5.4
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.2 to 5.4.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.2...5.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 22:02:20 +00:00
dependabot[bot]
35b5c80408 Merge pull request #847 from pi-hole/dependabot/pip/jinja2-2.11.3 2021-05-03 21:57:19 +00:00
dependabot[bot]
59e177525a Bump jinja2 from 2.10.3 to 2.11.3
Bumps [jinja2](https://github.com/pallets/jinja) from 2.10.3 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.10.3...2.11.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 21:41:28 +00:00
dependabot[bot]
27135f263f Merge pull request #850 from pi-hole/dependabot/pip/urllib3-1.25.8 2021-05-03 21:36:19 +00:00
Adam Warner
ac444c44f2 Update install.sh
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-05-03 15:25:26 +01:00
Adam Warner
96408f91a7 Merge pull request #849 from matthewbeckler/dev
Add note regarding changing Pi-hole DNS setting when using docker bridge networking
2021-05-01 00:29:37 +01:00
Adam Warner
151d588c4c Update VERSIONS
Co-authored-by: DL6ER <DL6ER@users.noreply.github.com>
2021-05-01 00:24:37 +01:00
dependabot[bot]
071b169896 Bump urllib3 from 1.25.7 to 1.25.8
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.25.7 to 1.25.8.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.25.7...1.25.8)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-30 22:04:12 +00:00
Matthew Beckler
f9c51379b0 Add note regarding changing Pi-hole DNS setting when using docker bridge networking 2021-04-29 14:42:50 -05:00
Adam Warner
42f1fa3380 Wrong conditional...
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-19 23:20:58 +01:00
Adam Warner
5ca1dbf35f Massive overhaul of `install.sh based on how I test fresh installs of differing branches/tags
First git clone the repos, next checkout the relevant branches and finally run the install script. Simples.
`sed`ed out a couple of other unsupported functions

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-19 23:06:00 +01:00
Adam Warner
ebe72b45e4 Merge pull request #737 from shaderecker/symlink
Remove broken doco-example.yml symlink
2021-04-19 14:54:52 +01:00
Adam Warner
c36d6ae501 Merge pull request #842 from pi-hole/master
master->dev
2021-04-19 09:52:40 +01:00
Adam Warner
2e04f5abee Add upgrade note for v.58 2021-04-19 09:38:15 +01:00
Adam Warner
17f6ef8e56 Merge pull request #837 from pi-hole/dev
Release 5.8 - "Third time's the charm" edition
2021-04-17 18:23:33 +01:00
Adam Warner
c9a3ac0df1 Merge pull request #818 from static-void-main/dev
Add support for the i386 architecture
2021-04-17 17:17:57 +01:00
Adam Warner
784be64178 Merge pull request #839 from pi-hole/tweak/valid_ip
Check for validity of values passed in through `PIHOLE_DNS_`
2021-04-17 11:17:25 +01:00
Adam Warner
82ef6544a4 Merge pull request #840 from pi-hole/revert-743-docker-hostname
Revert "Add `hostname` to docker-compose"
2021-04-17 00:54:31 +01:00
Adam Warner
59c08f36ee Revert "Add hostname to docker-compose" 2021-04-17 00:53:51 +01:00
Adam Warner
dba2317072 Merge pull request #769 from ignic/dhcp_setup
Enable DHCP Server with environment variables
2021-04-16 23:45:43 +01:00
Adam Warner
4b7c35be7e Merge pull request #743 from e2jk/docker-hostname
Add `hostname` to docker-compose
2021-04-16 23:31:56 +01:00
Adam Warner
f6b9716a75 Additionally, exit script if 0 valid entries are detected
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-16 23:19:58 +01:00
Adam Warner
14e3bcb480 Check for validity of values passed in through PIHOLE_DNS_ Throw away junk.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-16 22:56:09 +01:00
Adam Warner
e88429a65d Merge branch 'dev' of github.com:pi-hole/docker-pi-hole into dev 2021-04-16 21:56:13 +01:00
Adam Warner
4f531d9e78 Irrelevant since IP blocking is no longer the default method.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-16 21:55:55 +01:00
Adam Warner
87c99a0b8c Merge pull request #823 from limes007/master
Make test of IPv6 env variable case insensitive
2021-04-16 19:40:25 +01:00
Adam Warner
6f865b1699 Remove some out of date info about not remapping port 80.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-16 18:40:47 +01:00
Adam Warner
ba6f7f9d62 remove Upgrade notices section. It's old, and there isn't really anything relevant in there any more. 2021-04-16 18:33:01 +01:00
Adam Warner
1207b5cb88 Merge pull request #836 from mdzw/patch-1
Move gravity on boot to a @reboot cron job
2021-04-16 17:51:28 +01:00
Matt Winter
1633a976a4 Only remove the cron.d file if it exists
Signed-off-by: Matt Winter <MattWinter@gmail.com>
2021-04-16 12:36:13 -04:00
Matt Winter
fa771f74fd Change gravity-on-boot so it's run by cron
Proposed solution to #834

I believe the correct way to solve this issue is to change when "Gravity on Boot" is run.

The s6 init system has different stages. Currently, "gravity on boot" is run during Stage 2.ii: cont-init.d. One instance of pihole-FTL is started during cont-init, but it is only there to check the validity of the config files; it exits soon after starting. The final "service mode" instance of pihole-FTL is not started until Stage 2.iii, when the supervisor starts doing work.

If gravity.sh is counting on FTL to do its DNS lookups, then we should not run gravity until the supervised instance of FTL is running. We can accomplish this by moving "Gravity on Boot" to a @reboot line in /etc/cron.d/gravity-on-boot, and making that file's existence dependent on the value of SKIPGRAVITYONBOOT.

This will work because cron isn't started until we've reached Stage 2.iii.

Signed-off-by: Matt Winter <MattWinter@gmail.com>
2021-04-16 10:58:14 -04:00
static-void-main
6f21b020f8 Add i386 arch to deployment script
Signed-off-by: static-void-main <33235498+static-void-main@users.noreply.github.com>
2021-04-15 01:09:22 +02:00
static-void-main
6292fd1294 Add i386 arch
Signed-off-by: static-void-main <33235498+static-void-main@users.noreply.github.com>
2021-04-15 00:15:31 +02:00
Adam Warner
68ad7b045d Merge pull request #833 from pi-hole/dev
Release 5.8 - Take 2
2021-04-14 23:03:00 +01:00
Adam Warner
fe7f0c8612 Merge pull request #832 from pi-hole/release/v5.8-1
Release prep
2021-04-14 22:47:07 +01:00
Adam Warner
692a12c2c6 Acccount for core 5.3.1
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-14 22:27:50 +01:00
Adam Warner
731cd5e907 Merge pull request #831 from pi-hole/dev
Release v5.8
2021-04-14 19:34:09 +01:00
Adam Warner
e6a45eb96b prep for new release (#830)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-14 19:18:20 +01:00
Kyle Kurz
f53015157d Issue #824 - Don't log password (#825)
When setting the password, explicitly disable bash logging. Leave the
re-enable code so that other functions work as expected. Additionally,
do not remove the print in generate_password so randomly generated
passwords are still logged for user consistency.

Signed-off-by: Kyle Kurz <kyle@doublekaudio.com>
2021-04-14 17:13:01 +01:00
Adam Warner
190844d0b0 remove no longer required code (#736)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-14 14:36:55 +01:00
Adam Warner
6532390647 Only set one PIHOLE_DNS_ entry in the install script (#826)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-13 19:09:40 +01:00
Daniel
26aea62e22 Added new Debian version: bullseye (#828)
Signed-off-by: Daniel <daniel@developerdan.com>
2021-04-13 18:09:31 +01:00
limes007
ededb44601 fix test of IPv6 env variable
Signed-off-by: limes007 <39467727+limes007@users.noreply.github.com>
2021-04-09 21:10:53 +02:00
Adam Warner
c0e55c156f Remove port 443 from templates and documentation. (Redo) (#808)
* Update docker_run.sh

* Update docker-compose.yml.example

* Update README.md

* Update Dockerfile

Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-02-26 20:09:31 +00:00
Adam Warner
6d9913e824 Merge pull request #807 from pi-hole/master
Master -> Dev
2021-02-26 19:44:48 +00:00
Dan Schaper
20cd9c3abf Merge pull request #803 from pi-hole/fix/GH_IssueTemplate2
Add required front matter to bug report template.
2021-02-18 13:05:53 -08:00
Dan Schaper
e6307df638 Add required front matter to bug report template. 2021-02-18 12:56:33 -08:00
Dan Schaper
14f6262491 Merge pull request #800 from pi-hole/fix/issue_templates
Override default issue templates
2021-02-18 12:50:21 -08:00
Dan Schaper
bcd9ad5157 Copy default config.yml
From the docs:

> If a repository has any files in its own .github/ISSUE_TEMPLATE folder, including issue templates or a config.yml file, none of the contents of the default .github/ISSUE_TEMPLATE folder will be used.

So we need to copy the config.yml since it will be ignored.
2021-02-18 10:25:05 -08:00
Dan Schaper
6e1e93112d Override default issue templates 2021-02-18 10:17:40 -08:00
Adam Warner
5acc88ef86 Merge pull request #798 from pi-hole/master
sync master back to dev
2021-02-17 00:12:15 +00:00
Adam Warner
8d57c8ce7b Merge pull request #797 from pi-hole/dev
Dev -> master
2021-02-16 23:31:34 +00:00
Adam Warner
ea7f659874 Merge branch 'master' into dev 2021-02-16 23:17:52 +00:00
Adam Warner
abdf9f1130 remove shared memory files before starting the FTL process. Mimics bare metal service script (to an extent) (#796)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-02-16 23:09:49 +00:00
Adam Warner
75328c63f8 Merge pull request #793 from pi-hole/dev
Release 5.7
2021-02-16 20:19:25 +00:00
Adam Warner
3f0a7d85b1 bump web version
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-02-16 19:50:09 +00:00
Adam Warner
c5484e6a85 Merge pull request #792 from optimusprime01/devel
fixing typos in ReadMe
2021-02-16 09:15:31 +00:00
Sachin Sunder Sagadevan
dad930f9d2 fixing typos in ReadMe
Signed-off-by: Sachin Sunder Sagadevan <sachsun2809@outlook.com>
2021-02-15 20:25:12 -08:00
Adam Warner
b39f53d12e Merge pull request #790 from Sounie/documentation-tidy-ups
Couple of typos in docs.
2021-02-12 20:34:45 +00:00
Stephen Souness
a51f69bef9 Couple of typos in docs. 2021-02-12 19:23:55 +00:00
Adam Warner
0669b0fe91 Merge pull request #786 from loehden/dev
Changed description of the DNSMASQ_LISTENING environment variable in README.md
2021-02-10 18:55:48 +00:00
Adam Warner
3d42c16217 Merge pull request #787 from pi-hole/new/falseErrors
Fixing errors with regexfile and chmod/chown [Alt]
2021-02-10 18:04:38 +00:00
Adam Warner
6b6ba9b458 accidentally a reference
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-02-10 17:46:09 +00:00
Tyler Spires
c23b1d6894 forgot to remove the dhcp.leases from the original line.
Signed-off-by: Tyler Spires <shadrach145@gmail.com>
2021-02-10 17:31:47 +00:00
Tyler Spires
29cf35b2c5 Fixing error with dhcp.leases too.
Signed-off-by: Tyler Spires <shadrach145@gmail.com>
2021-02-10 17:31:33 +00:00
Adam Warner
8cf36e6f7e Remove chmod of no longer used file
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-02-10 17:31:31 +00:00
Benjamin Löhden
7adccc0287 Update README.md
Signed-off-by: Benjamin Löhden <3964467+loehden@users.noreply.github.com>
2021-02-09 00:17:28 +01:00
Adam Warner
7c135f5ce8 Merge pull request #777 from pi-hole/master
master->dev
2021-01-27 18:38:37 +00:00
Ignacio Serrano
e40ed3b5cc update doc README.md with DHCP server setup
Signed-off-by: Ignacio Serrano <ignic@ignic.com>
2021-01-23 21:23:05 +01:00
Ignacio Serrano
c5f682d1e7 allows DHCP server setup with env vars
Signed-off-by: Ignacio Serrano <ignic@ignic.com>
2021-01-23 21:23:05 +01:00
Emilien Klein
8f53e1bd22 Using pi.hole as hostname
To be consistent with the parameter already defined in docker_run.sh
(leaving the jwilder-proxy example to pihole.yourDomain.lan to be 
consistent with the rest of that file's content, namely DEFAULT_HOST)
2020-12-27 16:10:45 +01:00
Emilien Klein
64a1f548ef Add hostname to docker-compose
If this is not set, the PiHole admin page shows the Docker container's 
ID as hostname instead.
2020-12-27 15:24:29 +01:00
Sebastian Haderecker
7485a84d2d Remove broken symlink
Signed-off-by: Sebastian Haderecker <sebastian.haderecker@gmail.com>
2020-12-23 15:50:23 +00:00
45 changed files with 764 additions and 418 deletions

View File

@@ -1,3 +1,12 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
<!-- Provide a general summary of the issue in the Title above -->
<!-- Note: these are comments that don't show up in the actual issue, no need to delete them as you fill out the template -->

12
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
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.

View File

@@ -1,3 +1,5 @@
`{Please select 'base: dev' as target branch above! (you can delete this line)}`
<!--- Provide a general summary of your changes in the Title above -->
## Description

2
.github/dco.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
require:
members: false

7
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

7
.github/release.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
changelog:
exclude:
labels:
- internal
authors:
- dependabot
- github-actions

25
.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Mark stale issues
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@v4
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'
exempt-issue-labels: 'pinned, Fixed in next release, bug, never-stale, documentation, investigating'
exempt-all-issue-assignees: true
operations-per-run: 300

28
.github/workflows/sync-back-to-dev.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Sync Back to Development
on:
push:
branches:
- master
jobs:
sync-branches:
runs-on: ubuntu-latest
name: Syncing branches
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Opening pull request
id: pull
uses: tretuna/sync-branches@1.4.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FROM_BRANCH: 'master'
TO_BRANCH: 'dev'
CONTENT_COMPARISON: true
- name: Label the pull request to ignore for release note generation
uses: actions-ecosystem/action-add-labels@v1
with:
labels: internal
repo: ${{ github.repository }}
number: ${{ steps.pull.outputs.PULL_REQUEST_NUMBER }}

View File

@@ -1,30 +1,20 @@
name: Test & Build
on:
schedule:
- cron: '0 2 * * *'
push:
branches:
- master
- dev
- v*
- beta-v*
- release/*
tags:
- v*
pull_request:
#env:
# DOCKER_HUB_REPO: pihole
release:
types: [published]
jobs:
test-and-build:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ARCH: [amd64, armhf, arm64]
DEBIAN_VERSION: [stretch, buster]
env:
ARCH: ${{matrix.ARCH}}
DEBIAN_VERSION: ${{matrix.DEBIAN_VERSION}}
ARCH: amd64
DEBIAN_VERSION: buster
steps:
- name: Checkout Repo
uses: actions/checkout@v2
@@ -32,34 +22,64 @@ jobs:
run: |
echo "Building ${ARCH}-${DEBIAN_VERSION}"
./gh-actions-test.sh
- name: Push the ARCH image
if: github.event_name != 'pull_request'
run: |
. gh-actions-vars.sh
echo "${{ secrets.DOCKERHUB_PASS }}" | docker login --username="${{ secrets.DOCKERHUB_USER }}" --password-stdin
docker push "${ARCH_IMAGE}"
- name: Upload gh-workspace
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v1
with:
name: gh-workspace
path: .gh-workspace
publish:
build-and-publish:
if: github.event_name != 'pull_request'
needs: test
runs-on: ubuntu-latest
needs: test-and-build
steps:
- name: Checkout Repo
-
name: Checkout
if: github.event_name != 'schedule'
uses: actions/checkout@v2
-
name: Checkout dev branch if we are building nightly
if: github.event_name == 'schedule'
uses: actions/checkout@v2
- name: Download workspace files
uses: actions/download-artifact@v1
with:
name: gh-workspace
path: .gh-workspace
- name: Tag and Publish multi-arch images
env:
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }}
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
run: |
./gh-actions-deploy.sh
ref: dev
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
images: |
${{ secrets.DOCKERHUB_NAMESPACE }}/pihole
ghcr.io/${{ github.repository_owner }}/pihole
flavor: |
latest=${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
type=schedule
type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
type=ref,event=tag
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64, linux/arm64, linux/386, linux/arm/v7, linux/arm/v6
build-args: |
PIHOLE_DOCKER_TAG=${{ steps.meta.outputs.version }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -2,4 +2,4 @@
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 unreleated to docker image releases
See the [Pi-hole releases](https://github.com/pi-hole/pi-hole/releases) for details on updates unrelated to docker image releases

View File

@@ -1,29 +1,27 @@
ARG PIHOLE_BASE
FROM $PIHOLE_BASE
FROM "${PIHOLE_BASE:-ghcr.io/pi-hole/docker-pi-hole-base:buster-slim}"
ARG PIHOLE_ARCH
ENV PIHOLE_ARCH "${PIHOLE_ARCH}"
ARG S6_ARCH
ARG S6_VERSION
ENV S6OVERLAY_RELEASE "https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-${S6_ARCH}.tar.gz"
ARG PIHOLE_DOCKER_TAG
ENV PIHOLE_DOCKER_TAG "${PIHOLE_DOCKER_TAG}"
ENV S6_OVERLAY_VERSION v2.1.0.2
COPY install.sh /usr/local/bin/install.sh
COPY VERSION /etc/docker-pi-hole-version
ENV PIHOLE_INSTALL /root/ph_install.sh
ENV PIHOLE_INSTALL /etc/.pihole/automated\ install/basic-install.sh
ENTRYPOINT [ "/s6-init" ]
COPY s6/debian-root /
COPY s6/service /usr/local/bin/service
RUN bash -ex install.sh 2>&1 && \
rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
ENTRYPOINT [ "/s6-init" ]
ADD s6/debian-root /
COPY s6/service /usr/local/bin/service
# php config start passes special ENVs into
ARG PHP_ENV_CONFIG
ENV PHP_ENV_CONFIG "${PHP_ENV_CONFIG}"
ENV PHP_ENV_CONFIG /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
ARG PHP_ERROR_LOG
ENV PHP_ERROR_LOG "${PHP_ERROR_LOG}"
ENV PHP_ERROR_LOG /var/log/lighttpd/error.log
COPY ./start.sh /
COPY ./bash_functions.sh /
@@ -33,7 +31,6 @@ ENV IPv6 True
EXPOSE 53 53/udp
EXPOSE 67/udp
EXPOSE 80
EXPOSE 443
ENV S6_LOGGING 0
ENV S6_KEEP_ENV 1
@@ -41,18 +38,10 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
ENV ServerIP 0.0.0.0
ENV FTL_CMD no-daemon
ENV DNSMASQ_USER root
ENV DNSMASQ_USER pihole
ARG PIHOLE_VERSION
ENV VERSION "${PIHOLE_VERSION}"
ENV PATH /opt/pihole:${PATH}
ARG NAME
LABEL image="${NAME}:${PIHOLE_VERSION}_${PIHOLE_ARCH}"
ARG MAINTAINER
LABEL maintainer="${MAINTAINER}"
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
HEALTHCHECK CMD dig +short +norecurse +retry=0 @127.0.0.1 pi.hole || exit 1
HEALTHCHECK CMD dig +norecurse +retry=0 @127.0.0.1 pi.hole || exit 1
SHELL ["/bin/bash", "-c"]
SHELL ["/bin/bash", "-c"]

View File

@@ -10,7 +10,7 @@ Options:
--fail-fast Exit on first build error
--hub_tag=<tag> What the Docker Hub Image should be tagged as [default: None]
--arch=<arch> What Architecture(s) to build [default: amd64 armel armhf arm64]
--debian=<version> What debian version(s) to build [default: stretch buster]
--debian=<version> What debian version(s) to build [default: stretch buster bullseye]
-v Print docker's command output [default: False]
-t Print docker's build time [default: False]
@@ -20,13 +20,7 @@ from docopt import docopt
import os
import sys
import subprocess
__version__ = None
dot = os.path.abspath('.')
with open('{}/VERSION'.format(dot), 'r') as v:
raw_version = v.read().strip()
__version__ = raw_version.replace('release/', 'release-')
from dotenv import dotenv_values
def build_dockerfiles(args) -> bool:
all_success = True
@@ -60,12 +54,14 @@ def run_and_stream_command_output(command, environment_vars, verbose) -> bool:
def build(docker_repo: str, arch: str, debian_version: str, hub_tag: str, show_time: bool, no_cache: bool, verbose: bool) -> bool:
create_tag = f'{docker_repo}:{__version__}-{arch}-{debian_version}'
# remove the `pihole/pihole:` from hub_tag for use elsewhere
tag_name = hub_tag.split(":",1)[1]
create_tag = f'{docker_repo}:{tag_name}'
print(f' ::: Building {create_tag}')
time_arg = 'time' if show_time else ''
cache_arg = '--no-cache' if no_cache else ''
build_env = os.environ.copy()
build_env['PIHOLE_VERSION'] = __version__
build_env['PIHOLE_DOCKER_TAG'] = os.environ.get('GIT_TAG', None)
build_env['DEBIAN_VERSION'] = debian_version
build_command = f'{time_arg} docker-compose -f build.yml build {cache_arg} --pull {arch}'
print(f' ::: Building {arch} into {create_tag}')

11
Pipfile
View File

@@ -17,7 +17,7 @@ chardet = "==3.0.4"
configparser = "==4.0.2"
contextlib2 = "==0.6.0.post1"
coverage = "==5.0.1"
cryptography = "==2.8"
cryptography = "==3.3.2"
docker = "==4.1.0"
dockerpty = "==0.4.1"
docopt = "==0.6.2"
@@ -32,7 +32,7 @@ jsonschema = "==3.2.0"
more-itertools = "==5.0.0"
pathlib2 = "==2.3.5"
pluggy = "==0.13.1"
py = "==1.8.1"
py = "==1.10.0"
pycparser = "==2.19"
pyparsing = "==2.4.6"
pyrsistent = "==0.15.6"
@@ -48,16 +48,17 @@ testinfra = "==3.3.0"
texttable = "==1.6.2"
toml = "==0.10.0"
tox = "==3.14.3"
urllib3 = "==1.25.7"
urllib3 = "==1.25.8"
virtualenv = "==16.7.9"
wcwidth = "==0.1.7"
zipp = "==0.6.0"
"backports.shutil_get_terminal_size" = "==1.0.0"
"backports.ssl_match_hostname" = "==3.7.0.1"
Jinja2 = "==2.10.3"
Jinja2 = "==2.11.3"
MarkupSafe = "==1.1.1"
PyYAML = "==5.2"
PyYAML = "==5.4"
websocket_client = "==0.57.0"
python-dotenv = "==0.17.1"
[requires]
python_version = "3.8"

134
Pipfile.lock generated
View File

@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "ee7705112b315cad899e08bd6eac8f47e9a200a0d47a1920cc192995b79f8673"
"sha256": "2c7f1fb7f001bf70bba7309859b06dc323040f21518b32ee8993aa823c27df15"
},
"pipfile-spec": 6,
"requires": {
@@ -60,6 +60,7 @@
"sha256:0258f143f3de96b7c14f762c770f5fc56ccd72f8a1857a451c1cd9a655d9ac89",
"sha256:0b0069c752ec14172c5f78208f1863d7ad6755a6fae6fe76ec2c80d13be41e42",
"sha256:19a4b72a6ae5bb467fea018b825f0a7d917789bcfe893e53f15c92805d187294",
"sha256:436a487dec749bca7e6e72498a75a5fa2433bda13bac91d023e18df9089ae0b8",
"sha256:5432dd7b34107ae8ed6c10a71b4397f1c853bd39a4d6ffa7e35f40584cffd161",
"sha256:6305557019906466fc42dbc53b46da004e72fd7a551c044a827e572c82191752",
"sha256:69361315039878c0680be456640f8705d76cb4a3a3fe1e057e0f261b74be4b31",
@@ -197,30 +198,23 @@
},
"cryptography": {
"hashes": [
"sha256:02079a6addc7b5140ba0825f542c0869ff4df9a69c360e339ecead5baefa843c",
"sha256:1df22371fbf2004c6f64e927668734070a8953362cd8370ddd336774d6743595",
"sha256:369d2346db5934345787451504853ad9d342d7f721ae82d098083e1f49a582ad",
"sha256:3cda1f0ed8747339bbdf71b9f38ca74c7b592f24f65cdb3ab3765e4b02871651",
"sha256:44ff04138935882fef7c686878e1c8fd80a723161ad6a98da31e14b7553170c2",
"sha256:4b1030728872c59687badcca1e225a9103440e467c17d6d1730ab3d2d64bfeff",
"sha256:58363dbd966afb4f89b3b11dfb8ff200058fbc3b947507675c19ceb46104b48d",
"sha256:6ec280fb24d27e3d97aa731e16207d58bd8ae94ef6eab97249a2afe4ba643d42",
"sha256:7270a6c29199adc1297776937a05b59720e8a782531f1f122f2eb8467f9aab4d",
"sha256:73fd30c57fa2d0a1d7a49c561c40c2f79c7d6c374cc7750e9ac7c99176f6428e",
"sha256:7f09806ed4fbea8f51585231ba742b58cbcfbfe823ea197d8c89a5e433c7e912",
"sha256:90df0cc93e1f8d2fba8365fb59a858f51a11a394d64dbf3ef844f783844cc793",
"sha256:971221ed40f058f5662a604bd1ae6e4521d84e6cad0b7b170564cc34169c8f13",
"sha256:a518c153a2b5ed6b8cc03f7ae79d5ffad7315ad4569b2d5333a13c38d64bd8d7",
"sha256:b0de590a8b0979649ebeef8bb9f54394d3a41f66c5584fff4220901739b6b2f0",
"sha256:b43f53f29816ba1db8525f006fa6f49292e9b029554b3eb56a189a70f2a40879",
"sha256:d31402aad60ed889c7e57934a03477b572a03af7794fa8fb1780f21ea8f6551f",
"sha256:de96157ec73458a7f14e3d26f17f8128c959084931e8997b9e655a39c8fde9f9",
"sha256:df6b4dca2e11865e6cfbfb708e800efb18370f5a46fd601d3755bc7f85b3a8a2",
"sha256:ecadccc7ba52193963c0475ac9f6fa28ac01e01349a2ca48509667ef41ffd2cf",
"sha256:fb81c17e0ebe3358486cd8cc3ad78adbae58af12fc2bf2bc0bb84e8090fa5ce8"
"sha256:0d7b69674b738068fa6ffade5c962ecd14969690585aaca0a1b1fc9058938a72",
"sha256:1bd0ccb0a1ed775cd7e2144fe46df9dc03eefd722bbcf587b3e0616ea4a81eff",
"sha256:3c284fc1e504e88e51c428db9c9274f2da9f73fdf5d7e13a36b8ecb039af6e6c",
"sha256:49570438e60f19243e7e0d504527dd5fe9b4b967b5a1ff21cc12b57602dd85d3",
"sha256:541dd758ad49b45920dda3b5b48c968f8b2533d8981bcdb43002798d8f7a89ed",
"sha256:5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed",
"sha256:7951a966613c4211b6612b0352f5bf29989955ee592c4a885d8c7d0f830d0433",
"sha256:922f9602d67c15ade470c11d616f2b2364950602e370c76f0c94c94ae672742e",
"sha256:a0f0b96c572fc9f25c3f4ddbf4688b9b38c69836713fb255f4a2715d93cbaf44",
"sha256:a777c096a49d80f9d2979695b835b0f9c9edab73b59e4ceb51f19724dda887ed",
"sha256:a9a4ac9648d39ce71c2f63fe7dc6db144b9fa567ddfc48b9fde1b54483d26042",
"sha256:aa4969f24d536ae2268c902b2c3d62ab464b5a66bcb247630d208a79a8098e9b",
"sha256:c7390f9b2119b2b43160abb34f63277a638504ef8df99f11cb52c1fda66a2e6f",
"sha256:e18e6ab84dfb0ab997faf8cca25a86ff15dfea4027b986322026cc99e0a892da"
],
"index": "pypi",
"version": "==2.8"
"version": "==3.3.2"
},
"docker": {
"hashes": [
@@ -304,11 +298,11 @@
},
"jinja2": {
"hashes": [
"sha256:74320bb91f31270f9551d46522e33af46a80c3d619f4a4bf42b3164d30b5911f",
"sha256:9fe95f19286cfefaa917656583d020be14e7859c6b0252588391e47db34527de"
"sha256:03e47ad063331dd6a3f04a43eddca8a966a26ba0c5b7207a9a9e4e08f1b29419",
"sha256:a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6"
],
"index": "pypi",
"version": "==2.10.3"
"version": "==2.11.3"
},
"jsonschema": {
"hashes": [
@@ -325,8 +319,12 @@
"sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235",
"sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5",
"sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42",
"sha256:195d7d2c4fbb0ee8139a6cf67194f3973a6b3042d742ebe0a9ed36d8b6f0c07f",
"sha256:22c178a091fc6630d0d045bdb5992d2dfe14e3259760e713c490da5323866c39",
"sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff",
"sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b",
"sha256:2beec1e0de6924ea551859edb9e7679da6e4870d32cb766240ce17e0a0ba2014",
"sha256:3b8a6499709d29c2e2399569d96719a1b21dcd94410a586a18526b143ec8470f",
"sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1",
"sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e",
"sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183",
@@ -335,24 +333,39 @@
"sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1",
"sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15",
"sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1",
"sha256:6f1e273a344928347c1290119b493a1f0303c52f5a5eae5f16d74f48c15d4a85",
"sha256:6fffc775d90dcc9aed1b89219549b329a9250d918fd0b8fa8d93d154918422e1",
"sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e",
"sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b",
"sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905",
"sha256:7fed13866cf14bba33e7176717346713881f56d9d2bcebab207f7a036f41b850",
"sha256:84dee80c15f1b560d55bcfe6d47b27d070b4681c699c572af2e3c7cc90a3b8e0",
"sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735",
"sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d",
"sha256:98bae9582248d6cf62321dcb52aaf5d9adf0bad3b40582925ef7c7f0ed85fceb",
"sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e",
"sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d",
"sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c",
"sha256:a6a744282b7718a2a62d2ed9d993cad6f5f585605ad352c11de459f4108df0a1",
"sha256:acf08ac40292838b3cbbb06cfe9b2cb9ec78fce8baca31ddb87aaac2e2dc3bc2",
"sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21",
"sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2",
"sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5",
"sha256:b1dba4527182c95a0db8b6060cc98ac49b9e2f5e64320e2b56e47cb2831978c7",
"sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b",
"sha256:b7d644ddb4dbd407d31ffb699f1d140bc35478da613b441c582aeb7c43838dd8",
"sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6",
"sha256:bf5aa3cbcfdf57fa2ee9cd1822c862ef23037f5c832ad09cfea57fa846dec193",
"sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f",
"sha256:caabedc8323f1e93231b52fc32bdcde6db817623d33e100708d9a68e1f53b26b",
"sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f",
"sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2",
"sha256:d53bc011414228441014aa71dbec320c66468c1030aae3a6e29778a3382d96e5",
"sha256:d73a845f227b0bfe8a7455ee623525ee656a9e2e749e4742706d80a6065d5e2c",
"sha256:d9be0ba6c527163cbed5e0857c451fcd092ce83947944d6c14bc95441203f032",
"sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7",
"sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be"
"sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be",
"sha256:feb7b34d6325451ef96bc0e36e1a6c0c1c64bc1fbec4b854f4529e51887b1621"
],
"index": "pypi",
"version": "==1.1.1"
@@ -368,10 +381,11 @@
},
"packaging": {
"hashes": [
"sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8",
"sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181"
"sha256:5b327ac1320dc863dca72f4514ecc086f31186744b84a230374cc1fd776feae5",
"sha256:67714da7f7bc052e064859c05c595155bd1ee9f69f76557e21f051443c20947a"
],
"version": "==20.4"
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
"version": "==20.9"
},
"pathlib2": {
"hashes": [
@@ -391,11 +405,11 @@
},
"py": {
"hashes": [
"sha256:5e27081401262157467ad6e7f851b7aa402c5852dbcb3dae06768434de5752aa",
"sha256:c20fdd83a5dbc0af9efd622bee9a5564e278f6380fffcacc43ba6f43db2813b0"
"sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3",
"sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"
],
"index": "pypi",
"version": "==1.8.1"
"version": "==1.10.0"
},
"pycparser": {
"hashes": [
@@ -451,22 +465,40 @@
"index": "pypi",
"version": "==1.31.0"
},
"pyyaml": {
"python-dotenv": {
"hashes": [
"sha256:0e7f69397d53155e55d10ff68fdfb2cf630a35e6daf65cf0bdeaf04f127c09dc",
"sha256:2e9f0b7c5914367b0916c3c104a024bb68f269a486b9d04a2e8ac6f6597b7803",
"sha256:35ace9b4147848cafac3db142795ee42deebe9d0dad885ce643928e88daebdcc",
"sha256:38a4f0d114101c58c0f3a88aeaa44d63efd588845c5a2df5290b73db8f246d15",
"sha256:483eb6a33b671408c8529106df3707270bfacb2447bf8ad856a4b4f57f6e3075",
"sha256:4b6be5edb9f6bb73680f5bf4ee08ff25416d1400fbd4535fe0069b2994da07cd",
"sha256:7f38e35c00e160db592091751d385cd7b3046d6d51f578b29943225178257b31",
"sha256:8100c896ecb361794d8bfdb9c11fce618c7cf83d624d73d5ab38aef3bc82d43f",
"sha256:c0ee8eca2c582d29c3c2ec6e2c4f703d1b7f1fb10bc72317355a746057e7346c",
"sha256:e4c015484ff0ff197564917b4b4246ca03f411b9bd7f16e02a2f586eb48b6d04",
"sha256:ebc4ed52dcc93eeebeae5cf5deb2ae4347b3a81c3fa12b0b8c976544829396a4"
"sha256:00aa34e92d992e9f8383730816359647f358f4a3be1ba45e5a5cefd27ee91544",
"sha256:b1ae5e9643d5ed987fc57cc2583021e38db531946518130777734f9589b3141f"
],
"index": "pypi",
"version": "==5.2"
"version": "==0.17.1"
},
"pyyaml": {
"hashes": [
"sha256:02c78d77281d8f8d07a255e57abdbf43b02257f59f50cc6b636937d68efa5dd0",
"sha256:0dc9f2eb2e3c97640928dec63fd8dc1dd91e6b6ed236bd5ac00332b99b5c2ff9",
"sha256:124fd7c7bc1e95b1eafc60825f2daf67c73ce7b33f1194731240d24b0d1bf628",
"sha256:26fcb33776857f4072601502d93e1a619f166c9c00befb52826e7b774efaa9db",
"sha256:31ba07c54ef4a897758563e3a0fcc60077698df10180abe4b8165d9895c00ebf",
"sha256:3c49e39ac034fd64fd576d63bb4db53cda89b362768a67f07749d55f128ac18a",
"sha256:52bf0930903818e600ae6c2901f748bc4869c0c406056f679ab9614e5d21a166",
"sha256:5a3f345acff76cad4aa9cb171ee76c590f37394186325d53d1aa25318b0d4a09",
"sha256:5e7ac4e0e79a53451dc2814f6876c2fa6f71452de1498bbe29c0b54b69a986f4",
"sha256:7242790ab6c20316b8e7bb545be48d7ed36e26bbe279fd56f2c4a12510e60b4b",
"sha256:737bd70e454a284d456aa1fa71a0b429dd527bcbf52c5c33f7c8eee81ac16b89",
"sha256:8635d53223b1f561b081ff4adecb828fd484b8efffe542edcfdff471997f7c39",
"sha256:8b818b6c5a920cbe4203b5a6b14256f0e5244338244560da89b7b0f1313ea4b6",
"sha256:8bf38641b4713d77da19e91f8b5296b832e4db87338d6aeffe422d42f1ca896d",
"sha256:a36a48a51e5471513a5aea920cdad84cbd56d70a5057cca3499a637496ea379c",
"sha256:b2243dd033fd02c01212ad5c601dafb44fbb293065f430b0d3dbf03f3254d615",
"sha256:cc547d3ead3754712223abb7b403f0a184e4c3eae18c9bb7fd15adef1597cc4b",
"sha256:cc552b6434b90d9dbed6a4f13339625dc466fd82597119897e9489c953acbc22",
"sha256:f3790156c606299ff499ec44db422f66f05a7363b39eb9d5b064f17bd7d7c47b",
"sha256:f7a21e3d99aa3095ef0553e7ceba36fb693998fbb1226f1392ce33681047465f",
"sha256:fdc6b2cb4b19e431994f25a9160695cc59a4e861710cc6fc97161c5e845fc579"
],
"index": "pypi",
"version": "==5.4"
},
"requests": {
"hashes": [
@@ -504,6 +536,7 @@
"subprocess32": {
"hashes": [
"sha256:88e37c1aac5388df41cc8a8456bb49ebffd321a3ad4d70358e3518176de3a56b",
"sha256:e45d985aef903c5b7444d34350b05da91a9e0ea015415ab45a21212786c649d0",
"sha256:eb2937c80497978d181efa1b839ec2d9622cf9600a039a79d0e108d1f9aec79d"
],
"index": "pypi",
@@ -528,7 +561,8 @@
"toml": {
"hashes": [
"sha256:229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c",
"sha256:235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e"
"sha256:235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e",
"sha256:f1db651f9657708513243e61e6cc67d101a39bad662eaa9b5546f789338e07a3"
],
"index": "pypi",
"version": "==0.10.0"
@@ -543,11 +577,11 @@
},
"urllib3": {
"hashes": [
"sha256:a8a318824cc77d1fd4b2bec2ded92646630d7fe8619497b142c84a9e6f5a7293",
"sha256:f3c5fd51747d450d4dcf6f923c81f78f811aab8205fda64b0aba34a4e48b0745"
"sha256:2f3db8b19923a873b3e5256dc9c2dedfa883e33d87c690d9c7913e1f40673cdc",
"sha256:87716c2d2a7121198ebcb7ce7cccf6ce5e9ba539041cfbaeecfb641dc0bf6acc"
],
"index": "pypi",
"version": "==1.25.7"
"version": "==1.25.8"
},
"virtualenv": {
"hashes": [

156
README.md
View File

@@ -18,50 +18,36 @@ services:
pihole:
container_name: pihole
image: pihole/pihole:latest
# For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
ports:
- "53:53/tcp"
- "53:53/udp"
- "67:67/udp"
- "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
- "80:80/tcp"
- "443:443/tcp"
environment:
TZ: 'America/Chicago'
# WEBPASSWORD: 'set a secure password here or it will be random'
# Volumes store your data between container upgrades
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
# Recommended but not required (DHCP needs NET_ADMIN)
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
- NET_ADMIN
- NET_ADMIN # Recommended but not required (DHCP needs NET_ADMIN)
restart: unless-stopped
```
2. Run `docker-compose up --detach` to build and start pi-hole
2. Run `docker-compose up -d` to build and start pi-hole
3. Use the Pi-hole web UI to change the DNS settings *Interface listening behavior* to "Listen on all interfaces, permit all origins", if using Docker's default `bridge` network setting
[Here is an equivalent docker run script](https://github.com/pi-hole/docker-pi-hole/blob/master/docker_run.sh).
## Upgrade Notices:
## Upgrade Notes
In `2022.01` and later, the default `DNSMASQ_USER` has been changed to `pihole`, however this may cause issues on some systems such as Synology, see Issue [#963](https://github.com/pi-hole/docker-pi-hole/issues/963) for more information.
### Docker Pi-Hole v4.2.2
- ServerIP no longer a required enviroment variable **unless you run network 'host' mode**! Feel free to remove it unless you need it to customize lighttpd
- --cap-add NET_ADMIN no longer required unless using DHCP, leaving in examples for consistency
### Docker Pi-Hole v4.1.1+
Starting with the v4.1.1 release your Pi-hole container may encounter issues starting the DNS service unless ran with the following setting:
- `--dns=127.0.0.1 --dns=1.1.1.1` The second server can be any DNS IP of your choosing, but the **first dns must be 127.0.0.1**
- A WARNING stating "Misconfigured DNS in /etc/resolv.conf" may show in docker logs without this.
- 4.1 required --cap-add NET_ADMIN until 4.2.1-1
These are the raw [docker run cli](https://docs.docker.com/engine/reference/commandline/cli/) versions of the commands. We provide no official support for docker GUIs but the community forums may be able to help if you do not see a place for these settings. Remember, always consult your manual too!
If the container wont start due to issues setting capabilities, set `DNSMASQ_USER` to `root` in your environment.
## Overview
#### Renamed from `diginc/pi-hole` to `pihole/pihole`
A [Docker](https://www.docker.com/what-docker) project to make a lightweight x86 and ARM container with [Pi-hole](https://pi-hole.net) functionality.
1) Install docker for your [x86-64 system](https://www.docker.com/community-edition) or [ARMv7 system](https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/) using those links. [Docker-compose](https://docs.docker.com/compose/install/) is also recommended.
@@ -77,16 +63,14 @@ This container uses 2 popular ports, port 53 and port 80, so **may conflict with
If you're using a Red Hat based distribution with an SELinux Enforcing policy add `:z` to line with volumes like so:
```
-v "$(pwd)/etc-pihole/:/etc/pihole/:z" \
-v "$(pwd)/etc-dnsmasq.d/:/etc/dnsmasq.d/:z" \
-v "$(pwd)/etc-pihole:/etc/pihole:z" \
-v "$(pwd)/etc-dnsmasq.d:/etc/dnsmasq.d:z" \
```
Volumes are recommended for persisting data across container re-creations for updating images. The IP lookup variables may not work for everyone, please review their values and hard code IP and IPv6 if necessary.
You can customize where to store persistent data by setting the `PIHOLE_BASE` environment variable when invoking `docker_run.sh` (e.g. `PIHOLE_BASE=/opt/pihole-storage ./docker_run.sh`). If `PIHOLE_BASE` is not set, files are stored in your current directory when you invoke the script.
Port 443 is to provide a sinkhole for ads that use SSL. If only port 80 is used, then blocked HTTPS queries will fail to connect to port 443 and may cause long loading times. Rejecting 443 on your firewall can also serve this same purpose. Ubuntu firewall example: `sudo ufw reject https`
**Automatic Ad List Updates** - since the 3.0+ release, `cron` is baked into the container and will grab the newest versions of your lists and flush your logs. **Set your TZ** environment variable to make sure the midnight log rotation syncs up with your timezone's midnight.
## Running DHCP from Docker Pi-Hole
@@ -97,43 +81,77 @@ There are multiple different ways to run DHCP from within your Docker Pi-hole co
There are other environment variables if you want to customize various things inside the docker container:
| Docker Environment Var. | Description |
| ----------------------- | ----------- |
| `ADMIN_EMAIL: <email address>`<br/> *Optional Default: ''* | Set an administrative contact address for the Block Page
| `TZ: <Timezone>`<br/> **Recommended** *Default: 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.
| `WEBPASSWORD: <Admin password>`<br/> **Recommended** *Default: random* | http://pi.hole/admin password. Run `docker logs pihole \| grep random` to find your random pass.
| `PIHOLE_DNS_: <IPs delimited by ;>`<br/> *Optional* *Default: 8.8.8.8;8.8.4.4* | Upstream DNS server(s) for Pi-hole to forward queries to, seperated by a semicolon <br/> (supports non-standard ports with `#[port number]`) e.g `127.0.0.1#5053;8.8.8.8;8.8.4.4`
| `DNSSEC: <"true"\|"false">`<br/> *Optional* *Default: "false"* | Enable DNSSEC support
| `DNS_BOGUS_PRIV: <"true"\|"false">`<br/> *Optional* *Default: "true"* | Enable forwarding of reverse lookups for private ranges
| `DNS_FQDN_REQUIRED: <"true"\|"false">`<br/> *Optional* *Default: true* | Never forward non-FQDNs
| `REV_SERVER: <"true"\|"false">`<br/> *Optional* *Default: "false"* | Enable DNS conditional forwarding for device name resolution
| `REV_SERVER_DOMAIN: <Network Domain>`<br/> *Optional* | If conditional forwarding is enabled, set the domain of the local network router
| `REV_SERVER_TARGET: <Router's IP>`<br/> *Optional* | If conditional forwarding is enabled, set the IP of the local network router
| `REV_SERVER_CIDR: <Reverse DNS>`<br/> *Optional* | If conditional forwarding is enabled, set the reverse DNS zone (e.g. `192.168.0.0/24`)
| `ServerIP: <Host's IP>`<br/> **Recommended** | **--net=host mode requires** Set to your server's LAN IP, used by web block modes and lighttpd bind address
| `ServerIPv6: <Host's IPv6>`<br/> *Required if using IPv6* | **If you have a v6 network** set to your server's LAN IPv6 to block IPv6 ads fully
| `VIRTUAL_HOST: <Custom Hostname>`<br/> *Optional* *Default: $ServerIP* | What your web server 'virtual host' is, accessing admin through this Hostname/IP allows you to make changes to the whitelist / blacklists in addition to the default 'http://pi.hole/admin/' address
| `IPv6: <"true"\|"false">`<br/> *Optional* *Default: "true"* | For unraid compatibility, strips out all the IPv6 configuration from DNS/Web services when false.
| `INTERFACE: <NIC>`<br/> *Advanced/Optional* | The default works fine with our basic example docker run commands. If you're trying to use DHCP with `--net host` mode then you may have to customize this or DNSMASQ_LISTENING.
| `DNSMASQ_LISTENING: <local\|all\|NIC>`<br/> *Advanced/Optional* | `local` listens on all local subnets, `all` permits listening on internet origin subnets in addition to local.
| `WEB_PORT: <PORT>`<br/> *Advanced/Optional* | **This will break the 'webpage blocked' functionality of Pi-hole** however it may help advanced setups like those running synology or `--net=host` docker argument. This guide explains how to restore webpage blocked functionality using a linux router DNAT rule: [Alternative Synology installation method](https://discourse.pi-hole.net/t/alternative-synology-installation-method/5454?u=diginc)
| `DNSMASQ_USER: <pihole\|root>`<br/> *Experimental Default: root* | Allows running FTLDNS as non-root.
| `TEMPERATUREUNIT`: <c\|k\|f><br/>*Optional Default: c* | Set preferred temperature unit to `c`: Celsius, `k`: Kelvin, or `f` Fahrenheit units.
| `WEBUIBOXEDLAYOUT: <boxed\|traditional>`<br/>*Optional Default: boxed* | Use boxed layout (helpful when working on large screens)
| `SKIPGRAVITYONBOOT`: <Not Set\|1><br/> *Optional Default: Not Set* | Use this option to skip updating the Gravity Database when booting up the container. By default this environment variable is not set so the Gravity Database will be updated when the container starts up. Setting this environment variable to 1 (or anything) will cause the Gravity Database to not be updated when container starts up.
| `QUERY_LOGGING: <"true"\|"false">`<br/> *Optional* *Default: "true"* | Enable query logging or not.
### Recommended Variables
| Variable | Default | Value | Description |
| -------- | ------- | ----- | ---------- |
| `TZ` | UTC | `<Timezone>` | 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.
| `WEBPASSWORD` | random | `<Admin password>` | http://pi.hole/admin password. Run `docker logs pihole \| grep random` to find your random pass.
| `FTLCONF_REPLY_ADDR4` | unset | `<Host's IP>` | Set to your server's LAN IP, used by web block modes and lighttpd bind address.
### Optional Variables
| Variable | Default | Value | Description |
| -------- | ------- | ----- | ---------- |
| `ADMIN_EMAIL` | unset | email address | Set an administrative contact address for the Block Page |
| `PIHOLE_DNS_` | `8.8.8.8;8.8.4.4` | IPs delimited by `;` | Upstream DNS server(s) for Pi-hole to forward queries to, seperated by a semicolon <br/> (supports non-standard ports with `#[port number]`) e.g `127.0.0.1#5053;8.8.8.8;8.8.4.4` 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 |
| `DNSSEC` | `false` | `<"true"\|"false">` | Enable DNSSEC support |
| `DNS_BOGUS_PRIV` | `true` |`<"true"\|"false">`| Never forward reverse lookups for private ranges |
| `DNS_FQDN_REQUIRED` | `true` | `<"true"\|"false">`| Never forward non-FQDNs |
| `REV_SERVER` | `false` | `<"true"\|"false">` | Enable DNS conditional forwarding for device name resolution |
| `REV_SERVER_DOMAIN` | unset | Network Domain | If conditional forwarding is enabled, set the domain of the local network router |
| `REV_SERVER_TARGET` | unset | Router's IP | If conditional forwarding is enabled, set the IP of the local network router |
| `REV_SERVER_CIDR` | unset | Reverse DNS | If conditional forwarding is enabled, set the reverse DNS zone (e.g. `192.168.0.0/24`) |
| `DHCP_ACTIVE` | `false` | `<"true"\|"false">` | Enable DHCP server. Static DHCP leases can be configured with a custom `/etc/dnsmasq.d/04-pihole-static-dhcp.conf`
| `DHCP_START` | unset | `<Start IP>` | Start of the range of IP addresses to hand out by the DHCP server (mandatory if DHCP server is enabled).
| `DHCP_END` | unset | `<End IP>` | End of the range of IP addresses to hand out by the DHCP server (mandatory if DHCP server is enabled).
| `DHCP_ROUTER` | unset | `<Router's IP>` | Router (gateway) IP address sent by the DHCP server (mandatory if DHCP server is enabled).
| `DHCP_LEASETIME` | 24 | `<hours>` | DHCP lease time in hours.
| `PIHOLE_DOMAIN` | `lan` | `<domain>` | Domain name sent by the DHCP server.
| `DHCP_IPv6` | `false` | `<"true"\|"false">` | Enable DHCP server IPv6 support (SLAAC + RA).
| `DHCP_rapid_commit` | `false` | `<"true"\|"false">` | Enable DHCPv4 rapid commit (fast address assignment).
| `VIRTUAL_HOST` | `$ServerIP` | `<Custom Hostname>` | What your web server 'virtual host' is, accessing admin through this Hostname/IP allows you to make changes to the whitelist / blacklists in addition to the default 'http://pi.hole/admin/' address
| `IPv6:` | `true` | `<"true"\|"false">` | For unraid compatibility, strips out all the IPv6 configuration from DNS/Web services when false.
| `TEMPERATUREUNIT` | `c` | `<c\|k\|f>` | Set preferred temperature unit to `c`: Celsius, `k`: Kelvin, or `f` Fahrenheit units.
| `WEBUIBOXEDLAYOUT` | `boxed` | `<boxed\|traditional>` | 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.
| `WEBPASSWORD_FILE`| unset | `<Docker secret path>` |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
| Variable | Default | Value | Description |
| -------- | ------- | ----- | ---------- |
| `INTERFACE` | unset | `<NIC>` | The default works fine with our basic example docker run commands. If you're trying to use DHCP with `--net host` mode then you may have to customize this or DNSMASQ_LISTENING.
| `DNSMASQ_LISTENING` | unset | `<local\|all\|single>` | `local` listens on all local subnets, `all` permits listening on internet origin subnets in addition to local, `single` listens only on the interface specified.
| `WEB_PORT` | unset | `<PORT>` | **This will break the 'webpage blocked' functionality of Pi-hole** however it may help advanced setups like those running synology or `--net=host` docker argument. This guide explains how to restore webpage blocked functionality using a linux router DNAT rule: [Alternative Synology installation method](https://discourse.pi-hole.net/t/alternative-synology-installation-method/5454?u=diginc)
| `SKIPGRAVITYONBOOT` | unset | `<unset\|1>` | Use this option to skip updating the Gravity Database when booting up the container. By default this environment variable is not set so the Gravity Database will be updated when the container starts up. Setting this environment variable to 1 (or anything) will cause the Gravity Database to not be updated when container starts up.
| `CORS_HOSTS` | unset | `<FQDNs delimited by ,>` | List of domains/subdomains on which CORS is allowed. Wildcards are not supported. Eg: `CORS_HOSTS: domain.com,home.domain.com,www.domain.com`.
| `CUSTOM_CACHE_SIZE` | `10000` | Number | Set the cache size for dnsmasq. Useful for increasing the default cache size or to set it to 0. Note that when `DNSSEC` is "true", then this setting is ignored.
| `FTLCONF_[SETTING]` | unset | As per documentation | Customize pihole-FTL.conf with settings described in the [FTLDNS Configuration page](https://docs.pi-hole.net/ftldns/configfile/). For example, to customize REPLY_ADDR6, ensure you have the `FTLCONF_REPLY_ADDR6` environment variable set.
### Experimental Variables
| Variable | Default | Value | Description |
| -------- | ------- | ----- | ---------- |
| `DNSMASQ_USER` | unset | `<pihole\|root>` | Allows changing the user that FTLDNS runs as. Default: `pihole`
| PIHOLE_UID | debian system value | Number | Overrides image's default pihole user id to match a host user id |
| PIHOLE_GID | debian system value | Number | Overrides image's default pihole group id to match a host group id |
| WEB_UID | debian system value | Number | Overrides image's default www-data user id to match a host user id |
| WEB_GID | debian system value | Number | Overrides image's default www-data group id to match a host group id |
| WEBLOGS_STDOUT | 0 | 0&vert;1 | 0 logs to defined files, 1 redirect access and error logs to stdout |
## Deprecated environment variables:
While these may still work, they are likely to be removed in a future version. Where applicible, alternative variable names are indicated. Please review the table above for usage of the alternative variables
| Docker Environment Var. | Description | Replaced By |
| ----------------------- | ----------- | ----------- |
| `CONDITIONAL_FORWARDING: <"true"\|"false">`<br/> *Optional* *Default: "false"* | Enable DNS conditional forwarding for device name resolution | `REV_SERVER`|
| `CONDITIONAL_FORWARDING_IP: <Router's IP>`<br/> *Optional* | If conditional forwarding is enabled, set the IP of the local network router | `REV_SERVER_TARGET` |
| `CONDITIONAL_FORWARDING_DOMAIN: <Network Domain>`<br/> *Optional* | If conditional forwarding is enabled, set the domain of the local network router | `REV_SERVER_DOMAIN` |
| `CONDITIONAL_FORWARDING_REVERSE: <Reverse DNS>`<br/> *Optional* | If conditional forwarding is enabled, set the reverse DNS of the local network router (e.g. `0.168.192.in-addr.arpa`) | `REV_SERVER_CIDR` |
| `DNS1: <IP>`<br/> *Optional* *Default: 8.8.8.8* | Primary upstream DNS provider, default is google DNS | `PIHOLE_DNS_` |
| `DNS2: <IP>`<br/> *Optional* *Default: 8.8.4.4* | Secondary upstream DNS provider, default is google DNS, `no` if only one DNS should used | `PIHOLE_DNS_` |
| `CONDITIONAL_FORWARDING` | Enable DNS conditional forwarding for device name resolution | `REV_SERVER`|
| `CONDITIONAL_FORWARDING_IP` | If conditional forwarding is enabled, set the IP of the local network router | `REV_SERVER_TARGET` |
| `CONDITIONAL_FORWARDING_DOMAIN` | If conditional forwarding is enabled, set the domain of the local network router | `REV_SERVER_DOMAIN` |
| `CONDITIONAL_FORWARDING_REVERSE` | If conditional forwarding is enabled, set the reverse DNS of the local network router (e.g. `0.168.192.in-addr.arpa`) | `REV_SERVER_CIDR` |
| `DNS1` | Primary upstream DNS provider, default is google DNS | `PIHOLE_DNS_` |
| `DNS2` | Secondary upstream DNS provider, default is google DNS, `no` if only one DNS should used | `PIHOLE_DNS_` |
| `ServerIP` | Set to your server's LAN IP, used by web block modes and lighttpd bind address | `FTLCONF_REPLY_ADDR4` |
| `ServerIPv6` | **If you have a v6 network** set to your server's LAN IPv6 to block IPv6 ads fully | `FTLCONF_REPLY_ADDR6` |
To use these env vars in docker run format style them like: `-e DNS1=1.1.1.1`
@@ -141,13 +159,13 @@ Here is a rundown of other arguments for your docker-compose / docker run.
| Docker Arguments | Description |
| ---------------- | ----------- |
| `-p <port>:<port>` **Recommended** | Ports to expose (53, 80, 67, 443), the bare minimum ports required for Pi-holes HTTP and DNS services
| `-p <port>:<port>` **Recommended** | Ports to expose (53, 80, 67), the bare minimum ports required for Pi-holes HTTP and DNS services
| `--restart=unless-stopped`<br/> **Recommended** | Automatically (re)start your Pi-hole on boot or in the event of a crash
| `-v $(pwd)/etc-pihole:/etc/pihole`<br/> **Recommended** | Volumes for your Pi-hole configs help persist changes across docker image updates
| `-v $(pwd)/etc-dnsmasq.d:/etc/dnsmasq.d`<br/> **Recommended** | Volumes for your dnsmasq configs help persist changes across docker image updates
| `--net=host`<br/> *Optional* | Alternative to `-p <port>:<port>` 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`<br/> *Recommended* | Commonly added capability for DHCP, see [Note on Capabilities](#note-on-capabilities) below for other capabilities.
| `--dns=127.0.0.1`<br/> *Recommended* | Sets your container's resolve settings to localhost so it can resolve DHCP hostnames from Pi-hole's DNSMasq, also fixes common resolution errors on container restart.
| `--dns=127.0.0.1`<br/> *Optional* | Sets your container's resolve settings to localhost so it can resolve DHCP hostnames from Pi-hole's DNSMasq, may fix resolution errors on container restart.
| `--dns=1.1.1.1`<br/> *Optional* | Sets a backup server of your choosing in case DNSMasq has problems starting
| `--env-file .env` <br/> *Optional* | File to store environment variables for docker replacing `-e key=value` settings. Here for convenience
@@ -159,9 +177,9 @@ Here is a rundown of other arguments for your docker-compose / docker run.
* Port conflicts? Stop your server's existing DNS / Web services.
* Don't forget to stop your services from auto-starting again after you reboot
* Ubuntu users see below for more detailed information
* Port 80 is highly recommended because if you have another site/service using port 80 by default then the ads may not transform into blank ads correctly. To make sure docker-pi-hole plays nicely with an existing webserver you run you'll probably need a reverse proxy webserver config if you don't have one already. Pi-hole must be the default web app on the proxy e.g. if you go to your host by IP instead of domain then Pi-hole is served out instead of any other sites hosted by the proxy. This is the '[default_server](http://nginx.org/en/docs/http/ngx_http_core_module.html#listen)' in nginx or ['_default_' virtual host](https://httpd.apache.org/docs/2.4/vhosts/examples.html#default) in Apache and is taken advantage of so any undefined ad domain can be directed to your webserver and get a 'blocked' response instead of ads.
* You can still map other ports to Pi-hole port 80 using docker's port forwarding like this `-p 8080:80`, but again the ads won't render properly. Changing the inner port 80 shouldn't be required unless you run docker host networking mode.
* [Here is an example of running with jwilder/proxy](https://github.com/pi-hole/docker-pi-hole/blob/master/docker-compose-jwilder-proxy.yml) (an nginx auto-configuring docker reverse proxy for docker) on my port 80 with Pi-hole on another port. Pi-hole needs to be `DEFAULT_HOST` env in jwilder/proxy and you need to set the matching `VIRTUAL_HOST` for the Pi-hole's container. Please read jwilder/proxy readme for more info if you have trouble.
* You can map other ports to Pi-hole port 80 using docker's port forwarding like this `-p 8080:80` if you are using the default blocking mode. If you are using the legacy IP blocking mode, you should not remap this port.
* [Here is an example of running with nginxproxy/nginx-proxy](https://github.com/pi-hole/docker-pi-hole/blob/master/docker-compose-nginx-proxy.yml) (an nginx auto-configuring docker reverse proxy for docker) on my port 80 with Pi-hole on another port. Pi-hole needs to be `DEFAULT_HOST` env in nginxproxy/nginx-proxy and you need to set the matching `VIRTUAL_HOST` for the Pi-hole's container. Please read nginxproxy/nginx-proxy readme for more info if you have trouble.
* 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".
### Installing on Ubuntu
Modern releases of Ubuntu (17.10+) 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.
@@ -200,6 +218,8 @@ The primary docker tags / versions are explained in the following table. [Click
| `v5.0-buster` | auto detect | Versioned tags, if you want to pin against a specific Pi-hole and Debian version, use one of these | |
| `v5.0-<arch>-buster ` | based on tag | Specific architectures and Debian version tags | |
| `dev` | auto detect | like latest tag, but for the development branch (pushed occasionally) | |
| `beta-*` | auto detect | Early beta releases of upcoming versions - here be dragons | |
| `nightly` | auto detect | Like `dev` but pushed every night and pulls from the latest `development` branches of the core Pi-hole components (Pi-hole, AdminLTE, FTL) | |
### `pihole/pihole:latest` [![](https://images.microbadger.com/badges/image/pihole/pihole:latest.svg)](https://microbadger.com/images/pihole/pihole "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/version/pihole/pihole:latest.svg)](https://microbadger.com/images/pihole/pihole "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/version/pihole/pihole:latest.svg)](https://microbadger.com/images/pihole/pihole "Get your own version badge on microbadger.com")
@@ -209,7 +229,7 @@ https://hub.docker.com/r/pihole/pihole/tags/
## Upgrading, Persistence, and Customizations
The standard Pi-hole customization abilities apply to this docker, but with docker twists such as using docker volume mounts to map host stored file configurations over the container defaults. Volumes are also important to persist the configuration in case you have removed the Pi-hole container which is a typical docker upgrade pattern.
The standard Pi-hole customization abilities apply to this docker, but with docker twists such as using docker volume mounts to map host stored file configurations over the container defaults. However, mounting these configuration files as read-only should be avoided. Volumes are also important to persist the configuration in case you have removed the Pi-hole container which is a typical docker upgrade pattern.
### Upgrading / Reconfiguring
@@ -220,11 +240,11 @@ Do not attempt to upgrade (`pihole -up`) or reconfigure (`pihole -r`). New imag
* 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 inturruption **OR** always have a fallback DNS server configured in DHCP to avoid this problem altogether.
* **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 **OR** always have a fallback DNS server configured in DHCP to avoid this problem altogether.
* 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 <args> pihole/pihole` (`<args>` 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 reducing 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://www.google.com/?q=phoenix+servers) 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.
@@ -256,6 +276,8 @@ DNSMasq / [FTLDNS](https://docs.pi-hole.net/ftldns/in-depth/#linux-capabilities)
- `CAP_NET_BIND_SERVICE`: Allows FTLDNS binding to TCP/UDP sockets below 1024 (specifically DNS service on port 53)
- `CAP_NET_RAW`: use raw and packet sockets (needed for handling DHCPv6 requests, and verifying that an IP is not in use before leasing it)
- `CAP_NET_ADMIN`: modify routing tables and other network-related operations (in particular inserting an entry in the neighbor table to answer DHCP requests using unicast packets)
- `CAP_SYS_NICE`: FTL sets itself as an important process to get some more processing time if the latter is running low
- `CAP_CHOWN`: we need to be able to change ownership of log files and databases in case FTL is started as a different user than `pihole`
This image automatically grants those capabilities, if available, to the FTLDNS process, even when run as non-root.\
By default, docker does not include the `NET_ADMIN` capability for non-privileged containers, and it is recommended to explicitly add it to the container using `--cap-add=NET_ADMIN`.\

View File

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

View File

@@ -1 +0,0 @@
v5.2.4

View File

@@ -3,17 +3,18 @@
. /opt/pihole/webpage.sh
fix_capabilities() {
setcap CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_NET_ADMIN+ei $(which pihole-FTL) || ret=$?
setcap CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_NET_ADMIN,CAP_SYS_NICE,CAP_CHOWN+ei $(which pihole-FTL) || ret=$?
if [[ $ret -ne 0 && "${DNSMASQ_USER:-root}" != "root" ]]; then
echo "ERROR: Failed to set capabilities for pihole-FTL. Cannot run as non-root."
if [[ $ret -ne 0 && "${DNSMASQ_USER:-pihole}" != "root" ]]; then
echo "ERROR: Unable to set capabilities for pihole-FTL. Cannot run as non-root."
echo " If you are seeing this error, please set the environment variable 'DNSMASQ_USER' to the value 'root'"
exit 1
fi
}
prepare_configs() {
# Done in /start.sh, don't do twice
PH_TEST=true . $PIHOLE_INSTALL
PH_TEST=true . "${PIHOLE_INSTALL}"
# Set Debian webserver variables for installConfigs
LIGHTTPD_USER="www-data"
LIGHTTPD_GROUP="www-data"
@@ -22,18 +23,13 @@ prepare_configs() {
touch "$setupVars"
set +e
mkdir -p /var/run/pihole /var/log/pihole
# Re-apply perms from basic-install over any volume mounts that may be present (or not)
# Also similar to preflights for FTL https://github.com/pi-hole/pi-hole/blob/master/advanced/Templates/pihole-FTL.service
chown pihole:root /etc/lighttpd
chown pihole:pihole "${PI_HOLE_CONFIG_DIR}/pihole-FTL.conf" "/var/log/pihole" "${regexFile}"
chmod 644 "${PI_HOLE_CONFIG_DIR}/pihole-FTL.conf"
# not sure why pihole:pihole user/group write perms are not enough for web to write...dirty fix:
chmod 777 "${regexFile}"
touch /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log
chown pihole:pihole /var/run/pihole /var/log/pihole
test -f /var/run/pihole/FTL.sock && rm /var/run/pihole/FTL.sock
chown pihole:pihole /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /etc/pihole /etc/pihole/dhcp.leases /var/log/pihole.log
chmod 0644 /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log
# In case of `pihole` UID being changed, re-chown the pihole scripts and pihole commmand
chown -R pihole:root "${PI_HOLE_INSTALL_DIR}"
chown pihole:root "${PI_HOLE_BIN_DIR}/pihole"
set -e
# Update version numbers
pihole updatechecker
@@ -102,6 +98,7 @@ setup_dnsmasq() {
setup_dnsmasq_interface "$interface"
setup_dnsmasq_listening_behaviour "$dnsmasq_listening_behaviour"
setup_dnsmasq_user "${DNSMASQ_USER}"
setup_cache_size "${CUSTOM_CACHE_SIZE}"
ProcessDNSSettings
}
@@ -156,6 +153,32 @@ setup_dnsmasq_hostnames() {
fi
}
setup_cache_size() {
local warning="WARNING: CUSTOM_CACHE_SIZE not used"
local dnsmasq_pihole_01_location="/etc/dnsmasq.d/01-pihole.conf"
# Quietly exit early for empty or default
if [[ -z "${1}" || "${1}" == '10000' ]] ; then return ; fi
if [[ "${DNSSEC}" == "true" ]] ; then
echo "$warning - Cannot change cache size if DNSSEC is enabled"
return
fi
if ! echo $1 | grep -q '^[0-9]*$' ; then
echo "$warning - $1 is not an integer"
return
fi
local -i custom_cache_size="$1"
if (( $custom_cache_size < 0 )); then
echo "$warning - $custom_cache_size is not a positive integer or zero"
return
fi
echo "Custom CUSTOM_CACHE_SIZE set to $custom_cache_size"
sed -i "s/^cache-size=\s*[0-9]*/cache-size=$custom_cache_size/" ${dnsmasq_pihole_01_location}
}
setup_lighttpd_bind() {
local serverip="$1"
# if using '--net=host' only bind lighttpd on $ServerIP and localhost
@@ -170,20 +193,20 @@ setup_php_env() {
if [ -z "$VIRTUAL_HOST" ] ; then
VIRTUAL_HOST="$ServerIP"
fi;
local vhost_line="\t\t\t\"VIRTUAL_HOST\" => \"${VIRTUAL_HOST}\","
local serverip_line="\t\t\t\"ServerIP\" => \"${ServerIP}\","
local php_error_line="\t\t\t\"PHP_ERROR_LOG\" => \"${PHP_ERROR_LOG}\","
# idempotent line additions
grep -qP "$vhost_line" "$PHP_ENV_CONFIG" || \
sed -i "/bin-environment/ a\\${vhost_line}" "$PHP_ENV_CONFIG"
grep -qP "$serverip_line" "$PHP_ENV_CONFIG" || \
sed -i "/bin-environment/ a\\${serverip_line}" "$PHP_ENV_CONFIG"
grep -qP "$php_error_line" "$PHP_ENV_CONFIG" || \
sed -i "/bin-environment/ a\\${php_error_line}" "$PHP_ENV_CONFIG"
for config_var in "VIRTUAL_HOST" "CORS_HOSTS" "ServerIP" "PHP_ERROR_LOG" "PIHOLE_DOCKER_TAG" "TZ"; do
local beginning_of_line="\t\t\t\"${config_var}\" => "
if grep -qP "$beginning_of_line" "$PHP_ENV_CONFIG" ; then
# replace line if already present
sed -i "/${beginning_of_line}/c\\${beginning_of_line}\"${!config_var}\"," "$PHP_ENV_CONFIG"
else
# add line otherwise
sed -i "/bin-environment/ a\\${beginning_of_line}\"${!config_var}\"," "$PHP_ENV_CONFIG"
fi
done
echo "Added ENV to php:"
grep -E '(VIRTUAL_HOST|ServerIP|PHP_ERROR_LOG)' "$PHP_ENV_CONFIG"
grep -E '(VIRTUAL_HOST|CORS_HOSTS|ServerIP|PHP_ERROR_LOG|PIHOLE_DOCKER_TAG|TZ)' "$PHP_ENV_CONFIG"
}
setup_web_port() {
@@ -229,17 +252,14 @@ setup_web_password() {
setup_var_exists "WEBPASSWORD" && return
PASS="$1"
# Turn bash debug on while setting up password (to print it)
# Explicitly turn off bash printing when working with secrets
{ set +x; } 2>/dev/null
if [[ "$PASS" == "" ]] ; then
echo "" | pihole -a -p
else
echo "Setting password: ${PASS}"
set -x
pihole -a -p "$PASS" "$PASS"
fi
# Turn bash debug back off after print password setup
# (subshell to null hides printing output)
{ set +x; } 2>/dev/null
# To avoid printing this if conditional in bash debug, turn off debug above..
# then re-enable debug if necessary (more code but cleaner printed output)
@@ -250,7 +270,7 @@ setup_web_password() {
setup_ipv4_ipv6() {
local ip_versions="IPv4 and IPv6"
if [ "$IPv6" != "True" ] ; then
if [ "${IPv6,,}" != "true" ] ; then
ip_versions="IPv4"
sed -i '/use-ipv6.pl/ d' /etc/lighttpd/lighttpd.conf
fi;
@@ -259,8 +279,6 @@ setup_ipv4_ipv6() {
test_configs() {
set -e
echo -n '::: Testing pihole-FTL DNS: '
sudo -u ${DNSMASQ_USER:-root} pihole-FTL test || exit 1
echo -n '::: Testing lighttpd config: '
lighttpd -t -f /etc/lighttpd/lighttpd.conf || exit 1
set +e
@@ -335,3 +353,19 @@ setup_admin_email() {
pihole -a -e "$EMAIL"
fi
}
setup_dhcp() {
if [ -z "${DHCP_START}" ] || [ -z "${DHCP_END}" ] || [ -z "${DHCP_ROUTER}" ]; then
echo "ERROR: Won't enable DHCP server because mandatory Environment variables are missing: DHCP_START, DHCP_END and/or DHCP_ROUTER"
change_setting "DHCP_ACTIVE" "false"
else
change_setting "DHCP_ACTIVE" "${DHCP_ACTIVE}"
change_setting "DHCP_START" "${DHCP_START}"
change_setting "DHCP_END" "${DHCP_END}"
change_setting "DHCP_ROUTER" "${DHCP_ROUTER}"
change_setting "DHCP_LEASETIME" "${DHCP_LEASETIME}"
change_setting "PIHOLE_DOMAIN" "${PIHOLE_DOMAIN}"
change_setting "DHCP_IPv6" "${DHCP_IPv6}"
change_setting "DHCP_rapid_commit" "${DHCP_rapid_commit}"
fi
}

View File

@@ -2,48 +2,16 @@
version: "3.7"
x-common-args: &common-args
PIHOLE_VERSION: ${PIHOLE_VERSION}
NAME: pihole/pihole
MAINTAINER: adam@diginc.us
S6_VERSION: v2.1.0.2
PHP_ENV_CONFIG: /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
PHP_ERROR_LOG: /var/log/lighttpd/error.log
PIHOLE_DOCKER_TAG: ${PIHOLE_DOCKER_TAG}
CORE_VERSION: ${CORE_VERSION}
WEB_VERSION: ${WEB_VERSION}
FTL_VERSION: ${FTL_VERSION}
services:
amd64:
image: pihole:${PIHOLE_VERSION}-amd64-${DEBIAN_VERSION:-buster}
image: pihole:${PIHOLE_DOCKER_TAG}-amd64-${DEBIAN_VERSION:-buster}
build:
context: .
args:
<<: *common-args
PIHOLE_BASE: pihole/debian-base:${DEBIAN_VERSION:-buster}
PIHOLE_ARCH: amd64
S6_ARCH: amd64
armel:
image: pihole:${PIHOLE_VERSION}-armel-${DEBIAN_VERSION:-buster}
build:
context: .
args:
<<: *common-args
PIHOLE_BASE: multiarch/debian-debootstrap:armel-${DEBIAN_VERSION:-buster}-slim
PIHOLE_ARCH: armel
S6_ARCH: arm
armhf:
image: pihole:${PIHOLE_VERSION}-armhf-${DEBIAN_VERSION:-buster}
build:
context: .
args:
<<: *common-args
PIHOLE_BASE: multiarch/debian-debootstrap:armhf-${DEBIAN_VERSION:-buster}-slim
PIHOLE_ARCH: arm
S6_ARCH: arm
arm64:
image: pihole:${PIHOLE_VERSION}-arm64-${DEBIAN_VERSION:-buster}
build:
context: .
args:
<<: *common-args
PIHOLE_BASE: multiarch/debian-debootstrap:arm64-${DEBIAN_VERSION:-buster}-slim
PIHOLE_ARCH: arm64
S6_ARCH: aarch64
PIHOLE_BASE: ghcr.io/pi-hole/docker-pi-hole-base:${DEBIAN_VERSION:-buster}-slim

View File

@@ -3,8 +3,8 @@ version: "3"
# https://github.com/pi-hole/docker-pi-hole/blob/master/README.md
services:
jwilder-proxy:
image: jwilder/nginx-proxy
nginx-proxy:
image: nginxproxy/nginx-proxy
ports:
- '80:80'
environment:
@@ -20,10 +20,9 @@ services:
- '53:53/udp'
- "67:67/udp"
- '8053:80/tcp'
- "443:443/tcp"
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
# run `touch ./var-log/pihole.log` first unless you like errors
# - './var-log/pihole.log:/var/log/pihole.log'
# Recommended but not required (DHCP needs NET_ADMIN)
@@ -38,7 +37,7 @@ services:
extra_hosts:
# Resolve to nothing domains (terminate connection)
- 'nw2master.bioware.com nwn2.master.gamespy.com:0.0.0.0'
# LAN hostnames for other docker containers using jwilder
# LAN hostnames for other docker containers using nginx-proxy
- 'yourDomain.lan:192.168.41.55'
- 'pihole pihole.yourDomain.lan:192.168.41.55'
- 'ghost ghost.yourDomain.lan:192.168.41.55'
@@ -52,7 +51,7 @@ services:
# ports:
# - '2368:2368/tcp'
# volumes:
# - '/etc/ghost/:/ghost-override'
# - '/etc/ghost:/ghost-override'
# environment:
# PROXY_LOCATION: ghost
# VIRTUAL_HOST: ghost.yourDomain.lan

View File

@@ -12,18 +12,14 @@ services:
- "53:53/udp"
- "67:67/udp"
- "80:80/tcp"
- "443:443/tcp"
environment:
TZ: 'America/Chicago'
# WEBPASSWORD: 'set a secure password here or it will be random'
# Volumes store your data between container upgrades
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
# run `touch ./var-log/pihole.log` first unless you like errors
# - './var-log/pihole.log:/var/log/pihole.log'
# Recommended but not required (DHCP needs NET_ADMIN)
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
- NET_ADMIN
restart: unless-stopped
restart: unless-stopped # Recommended but not required (DHCP needs NET_ADMIN)

View File

@@ -10,10 +10,9 @@ docker run -d \
--name pihole \
-p 53:53/tcp -p 53:53/udp \
-p 80:80 \
-p 443:443 \
-e TZ="America/Chicago" \
-v "${PIHOLE_BASE}/etc-pihole/:/etc/pihole/" \
-v "${PIHOLE_BASE}/etc-dnsmasq.d/:/etc/dnsmasq.d/" \
-v "${PIHOLE_BASE}/etc-pihole:/etc/pihole" \
-v "${PIHOLE_BASE}/etc-dnsmasq.d:/etc/dnsmasq.d" \
--dns=127.0.0.1 --dns=1.1.1.1 \
--restart=unless-stopped \
--hostname pi.hole \

View File

@@ -1 +0,0 @@
docker-compose.yml

View File

@@ -53,6 +53,7 @@ declare -A annotate_map=(
["armel"]="--arch arm --variant v6"
["armhf"]="--arch arm --variant v7"
["arm64"]="--arch arm64 --variant v8"
["i386"]="--arch 386"
)
mkdir -p ~/.docker

View File

@@ -25,6 +25,10 @@ docker run --rm \
--env ARCH="${ARCH}" \
--env ARCH_IMAGE="${ARCH_IMAGE}" \
--env DEBIAN_VERSION="${DEBIAN_VERSION}" \
--env GIT_TAG="${GIT_TAG}" \
--env CORE_VERSION="${CORE_VERSION}" \
--env WEB_VERSION="${WEB_VERSION}" \
--env FTL_VERSION="${FTL_VERSION}" \
${enter} image_pipenv
mkdir -p ".gh-workspace/${DEBIAN_VERSION}/"

View File

@@ -2,44 +2,40 @@
mkdir -p /etc/pihole/
mkdir -p /var/run/pihole
# Production tags with valid web footers
export CORE_VERSION="$(cat /etc/docker-pi-hole-version)"
export WEB_VERSION="${CORE_VERSION}"
export PIHOLE_SKIP_OS_CHECK=true
# Overwrite WEB_VERSION if core and web versions are different
export WEB_VERSION="v5.3.2"
# Only use for pre-production / testing
export CHECKOUT_BRANCHES=false
# Search for release/* branch naming convention for custom checkouts
if [[ "$CORE_VERSION" == *"release/"* ]] ; then
CHECKOUT_BRANCHES=true
fi
CORE_LOCAL_REPO=/etc/.pihole
WEB_LOCAL_REPO=/var/www/html/admin
setupVars=/etc/pihole/setupVars.conf
s6_download_url() {
DETECTED_ARCH=$(dpkg --print-architecture)
S6_ARCH=$DETECTED_ARCH
case $DETECTED_ARCH in
armel)
S6_ARCH="arm";;
armhf)
S6_ARCH="arm";;
arm64)
S6_ARCH="aarch64";;
i386)
S6_ARCH="x86";;
ppc64el)
S6_ARCH="ppc64le";;
esac
echo "https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.gz"
}
apt-get update
apt-get install --no-install-recommends -y curl procps ca-certificates
# curl in armhf-buster's image has SSL issues. Running c_rehash fixes it.
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923479
c_rehash
ln -s `which echo` /usr/local/bin/whiptail
curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C /
curl -L -s "$(s6_download_url)" | tar xvzf - -C /
mv /init /s6-init
# debconf-apt-progress seems to hang so get rid of it too
which debconf-apt-progress
mv "$(which debconf-apt-progress)" /bin/no_debconf-apt-progress
# Get the install functions
curl https://raw.githubusercontent.com/pi-hole/pi-hole/${CORE_VERSION}/automated%20install/basic-install.sh > "$PIHOLE_INSTALL"
PH_TEST=true . "${PIHOLE_INSTALL}"
# Preseed variables to assist with using --unattended install
{
echo "PIHOLE_INTERFACE=eth0"
echo "IPV4_ADDRESS=0.0.0.0"
echo "IPV6_ADDRESS=0:0:0:0:0:0"
echo "PIHOLE_DNS_1=8.8.8.8"
echo "PIHOLE_DNS_2=8.8.4.4"
echo "QUERY_LOGGING=true"
echo "INSTALL_WEB_SERVER=true"
echo "INSTALL_WEB_INTERFACE=true"
@@ -48,60 +44,36 @@ PH_TEST=true . "${PIHOLE_INSTALL}"
source $setupVars
export USER=pihole
distro_check
# fix permission denied to resolvconf post-inst /etc/resolv.conf moby/moby issue #1297
apt-get -y install debconf-utils
echo resolvconf resolvconf/linkify-resolvconf boolean false | debconf-set-selections
export PIHOLE_SKIP_OS_CHECK=true
ln -s /bin/true /usr/local/bin/service
bash -ex "./${PIHOLE_INSTALL}" --unattended
rm /usr/local/bin/service
# Run the installer in unattended mode using the preseeded variables above and --reconfigure so that local repos are not updated
curl -sSL https://install.pi-hole.net | bash -sex -- --unattended
# IPv6 support for nc openbsd better than traditional
apt-get install -y --force-yes netcat-openbsd
fetch_release_metadata() {
local directory="$1"
local version="$2"
pushd "$directory"
git fetch -t
git remote set-branches origin '*'
git fetch --depth 10
git checkout master
git reset --hard "$version"
popd
}
if [[ $CHECKOUT_BRANCHES == true ]] ; then
ln -s /bin/true /usr/local/bin/service
ln -s /bin/true /usr/local/bin/update-rc.d
echo "${CORE_VERSION}" | sudo tee /etc/pihole/ftlbranch
echo y | bash -x pihole checkout core ${CORE_VERSION}
echo y | bash -x pihole checkout web ${WEB_VERSION}
# echo y | bash -x pihole checkout ftl ${CORE_VERSION}
# If the v is forgotten: ${CORE_VERSION/v/}
unlink /usr/local/bin/service
unlink /usr/local/bin/update-rc.d
else
# Reset to our tags so version numbers get detected correctly
fetch_release_metadata "${PI_HOLE_LOCAL_REPO}" "${CORE_VERSION}"
fetch_release_metadata "${webInterfaceDir}" "${WEB_VERSION}"
fi
# FTL Armel fix not in prod yet
# Remove once https://github.com/pi-hole/pi-hole/commit/3fbb0ac8dde14b8edc1982ae3a2a021f3cf68477 is in master
if [[ "$ARCH" == 'armel' ]]; then
curl -o /usr/bin/pihole-FTL https://ftl.pi-hole.net/development/pihole-FTL-armel-native
# At this stage, if we are building a :nightly tag, then switch the Pi-hole install to dev versions
if [[ "${PIHOLE_DOCKER_TAG}" = 'nightly' ]]; then
yes | pihole checkout dev
fi
sed -i 's/readonly //g' /opt/pihole/webpage.sh
sed -i '/^WEBPASSWORD/d' /etc/pihole/setupVars.conf
# Replace the call to `updatePiholeFunc` in arg parse with new `unsupportedFunc`
# sed a new function into the `pihole` script just above the `helpFunc()` function for later use.
sed -i $'s/helpFunc() {/unsupportedFunc() {\\\n echo "Function not supported in Docker images"\\\n exit 0\\\n}\\\n\\\nhelpFunc() {/g' /usr/local/bin/pihole
# Replace a few of the `pihole` options with calls to `unsupportedFunc`:
# pihole -up / pihole updatePihole
sed -i $'s/)\s*updatePiholeFunc/) unsupportedFunc/g' /usr/local/bin/pihole
# pihole uninstall
sed -i $'s/)\s*uninstallFunc/) unsupportedFunc/g' /usr/local/bin/pihole
# pihole -r / pihole reconfigure
sed -i $'s/)\s*reconfigurePiholeFunc/) unsupportedFunc/g' /usr/local/bin/pihole
if [[ "${PIHOLE_DOCKER_TAG}" != "dev" && "${PIHOLE_DOCKER_TAG}" != "nightly" ]]; then
# If we are on a version other than dev or nightly, disable `pihole checkout`, otherwise it is useful to have for quick troubleshooting sometimes
sed -i $'s/)\s*piholeCheckoutFunc/) unsupportedFunc/g' /usr/local/bin/pihole
fi
touch /.piholeFirstBoot
echo 'Docker install successful'
echo 'Docker install successful'

View File

@@ -1,3 +1,4 @@
-i https://pypi.org/simple/
apipkg==1.5
atomicwrites==1.3.0
attrs==19.3.0
@@ -11,7 +12,7 @@ chardet==3.0.4
configparser==4.0.2
contextlib2==0.6.0.post1
coverage==5.0.1
cryptography==2.8
cryptography==3.3.2
docker==4.1.0
dockerpty==0.4.1
docopt==0.6.2
@@ -22,22 +23,22 @@ funcsigs==1.0.2
idna==2.8
importlib-metadata==1.3.0
ipaddress==1.0.23
Jinja2==2.10.3
jinja2==2.11.3
jsonschema==3.2.0
MarkupSafe==1.1.1
markupsafe==1.1.1
more-itertools==5.0.0
packaging==19.2
packaging==20.9
pathlib2==2.3.5
pluggy==0.13.1
py==1.8.1
py==1.10.0
pycparser==2.19
pyparsing==2.4.6
pyrsistent==0.15.6
pytest==4.6.8
pytest-cov==2.8.1
pytest-forked==1.1.3
pytest-xdist==1.31.0
PyYAML==5.2
pytest==4.6.8
pyyaml==5.4
requests==2.22.0
scandir==1.10.0
six==1.13.0
@@ -46,8 +47,9 @@ testinfra==3.3.0
texttable==1.6.2
toml==0.10.0
tox==3.14.3
urllib3==1.25.7
urllib3==1.25.8
virtualenv==16.7.9
wcwidth==0.1.7
websocket-client==0.57.0
zipp==0.6.0
python-dotenv==0.17.1

View File

@@ -0,0 +1,35 @@
#!/usr/bin/with-contenv bash
set -e
if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then
set -x ;
fi
modifyUser()
{
declare username=${1:-} newId=${2:-}
[[ -z ${username} || -z ${newId} ]] && return
local currentId=$(id -u ${username})
[[ ${currentId} -eq ${newId} ]] && return
echo "Changing ID for user: ${username} (${currentId} => ${newId})"
usermod -o -u ${newId} ${username}
}
modifyGroup()
{
declare groupname=${1:-} newId=${2:-}
[[ -z ${groupname} || -z ${newId} ]] && return
local currentId=$(id -g ${groupname})
[[ ${currentId} -eq ${newId} ]] && return
echo "Changing ID for group: ${groupname} (${currentId} => ${newId})"
groupmod -o -g ${newId} ${groupname}
}
modifyUser www-data ${WEB_UID}
modifyGroup www-data ${WEB_GID}
modifyUser pihole ${PIHOLE_UID}
modifyGroup pihole ${PIHOLE_GID}

View File

@@ -2,25 +2,38 @@
set -e
bashCmd='bash -e'
if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then
if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then
set -x ;
bashCmd='bash -e -x'
fi
# used to start dnsmasq here for gravity to use...now that conflicts port 53
$bashCmd /start.sh
# Gotta go fast, no time for gravity
if [ -n "$PYTEST" ]; then
sed -i 's/^gravity_spinup$/#gravity_spinup # DISABLED FOR PYTEST/g' "$(which gravity.sh)"
if [ -n "$PYTEST" ]; then
sed -i 's/^gravity_spinup$/#gravity_spinup # DISABLED FOR PYTEST/g' "$(which gravity.sh)"
fi
if [ -z "$SKIPGRAVITYONBOOT" ]; then
gravity.sh
gravityDBfile="/etc/pihole/gravity.db"
config_file="/etc/pihole/pihole-FTL.conf"
# make a point to mention which config file we're checking, as breadcrumb to revisit if/when pihole-FTL.conf is succeeded by TOML
echo " Checking if custom gravity.db is set in ${config_file}"
if [[ -f "${config_file}" ]]; then
gravityDBfile="$(grep --color=never -Po "^GRAVITYDB=\K.*" "${config_file}" 2> /dev/null || echo "/etc/pihole/gravity.db")"
fi
if [ -z "$SKIPGRAVITYONBOOT" ] || [ ! -e "${gravityDBfile}" ]; then
if [ -n "$SKIPGRAVITYONBOOT" ];then
echo " SKIPGRAVITYONBOOT is set, however ${gravityDBfile} does not exist (Likely due to a fresh volume). This is a required file for Pi-hole to operate."
echo " Ignoring SKIPGRAVITYONBOOT on this occaision."
fi
echo '@reboot root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updateGravity >/var/log/pihole_updateGravity.log || cat /var/log/pihole_updateGravity.log' > /etc/cron.d/gravity-on-boot
else
echo " Skipping Gravity Database Update."
[ ! -e /etc/cron.d/gravity-on-boot ] || rm /etc/cron.d/gravity-on-boot &>/dev/null
fi
# Kill dnsmasq because s6 won't like it if it's running when s6 services start
kill -9 $(pgrep pihole-FTL) || true
pihole -v
echo " Container tag is: ${PIHOLE_DOCKER_TAG}"

View File

@@ -0,0 +1,8 @@
#!/usr/bin/with-contenv bash
s6-echo "Stopping lighttpd-access-log"
pid=$(ps -C cat -o pid=,args= |grep -oP "([0-9]+).+access\.log" |cut -f1 -d" ")
if [[ -n ${pid} ]]; then
kill -9 ${pid}
fi
s6-echo "Stopped lighttpd-access-log"

View File

@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
s6-echo "Starting lighttpd-access-log"
s6-setuidgid www-data cat /var/log/lighttpd/access.log 2>&1

View File

@@ -0,0 +1,8 @@
#!/usr/bin/with-contenv bash
s6-echo "Stopping lighttpd-error-log"
pid=$(ps -C cat -o pid=,args= |grep -oP "([0-9]+).+error\.log" |cut -f1 -d" ")
if [[ -n ${pid} ]]; then
kill -9 ${pid}
fi
s6-echo "Stopped lighttpd-error-log"

View File

@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
s6-echo "Starting lighttpd-error-log"
s6-setuidgid www-data cat /var/log/lighttpd/error.log 2>&1

View File

@@ -1,4 +1,6 @@
#!/usr/bin/with-contenv bash
s6-echo "Stopping lighttpd"
service lighttpd-access-log stop
service lighttpd-error-log stop
killall -9 lighttpd

View File

@@ -1,4 +1,30 @@
#!/usr/bin/with-contenv bash
s6-echo "Starting lighttpd"
if [[ 1 -eq ${WEBLOGS_STDOUT:-0} ]]; then
#lighthttpd cannot use /dev/stdout https://redmine.lighttpd.net/issues/2731
for fi in /var/log/lighttpd/access.log /var/log/lighttpd/error.log
do
if [[ ! -p ${fi} ]]; then
rm -f ${fi}
mkfifo -m 600 ${fi}
fi
done
chown -R www-data:www-data /var/log/lighttpd
service lighttpd-access-log start
service lighttpd-error-log start
sleep 2
else
#remove fifo if exists
[[ -p /var/log/lighttpd/access.log ]] && rm -Rf /var/log/lighttpd/access.log
[[ -p /var/log/lighttpd/error.log ]] && rm -Rf /var/log/lighttpd/error.log
# Touch log files to ensure they exist (create if non-existing, preserve if existing)
touch /var/log/lighttpd/access.log /var/log/lighttpd/error.log
# Ensure that permissions are set so that lighttpd can write to the logs
chown -R www-data:www-data /var/log/lighttpd
chmod 0644 /var/log/lighttpd/access.log /var/log/lighttpd/error.log
fi
lighttpd -D -f /etc/lighttpd/lighttpd.conf

View File

@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash
s6-echo "Stopping pihole-FTL"
kill -9 $(pgrep pihole-FTL)
killall -15 pihole-FTL

View File

@@ -1,9 +1,28 @@
#!/usr/bin/with-contenv bash
s6-echo "Starting pihole-FTL ($FTL_CMD) as ${DNSMASQ_USER}"
# Remove possible leftovers from previous pihole-FTL processes
rm -f /dev/shm/FTL-* 2> /dev/null
rm /run/pihole/FTL.sock 2> /dev/null
# Touch files to ensure they exist (create if non-existing, preserve if existing)
mkdir -pm 0755 /run/pihole
touch /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole-FTL.log /var/log/pihole.log /etc/pihole/dhcp.leases
# Ensure that permissions are set so that pihole-FTL can edit all necessary files
chown pihole:pihole /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole-FTL.log /var/log/pihole.log /etc/pihole/dhcp.leases /run/pihole /etc/pihole
chmod 0644 /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole-FTL.log /var/log/pihole.log /etc/pihole/dhcp.leases
# Ensure that permissions are set so that pihole-FTL can edit the files. We ignore errors as the file may not (yet) exist
chmod -f 0644 /etc/pihole/macvendor.db
# Chown database files to the user FTL runs as. We ignore errors as the files may not (yet) exist
chown -f pihole:pihole /etc/pihole/pihole-FTL.db /etc/pihole/gravity.db /etc/pihole/macvendor.db
# Chown database file permissions so that the pihole group (web interface) can edit the file. We ignore errors as the files may not (yet) exist
chmod -f 0664 /etc/pihole/pihole-FTL.db
s6-setuidgid ${DNSMASQ_USER} pihole-FTL $FTL_CMD >/dev/null 2>&1
# Notes on above:
# - DNSMASQ_USER default of root is in Dockerfile & can be overwritten by runtime container env
# - DNSMASQ_USER default of pihole is in Dockerfile & can be overwritten by runtime container env
# - /var/log/pihole*.log has FTL's output that no-daemon would normally print in FG too
# prevent duplicating it in docker logs by sending to dev null

View File

@@ -2,29 +2,49 @@
# This script patches all service commands into the appropriate s6- commands
# pi-hole upstream scripts need a 'service' interface. why not systemd? docker said so.
start() {
s6-svc -wU -u -T2500 /var/run/s6/services/$service
s6-svc -wu -u -T2500 /var/run/s6/services/$service
}
stop() {
s6-svc -wD -d -T2500 /var/run/s6/services/$service
s6-svc -wD -d -T2500 /var/run/s6/services/$service
}
restart() {
local pid
# Get the PID of the service we are asking to restart
pid=$(pgrep $service)
# Only attempt to stop the service if it is already running
if [ -n "$pid" ]; then
stop
# Loop until we are certain that the process has been stopped
while test -d /proc/$pid; do
sleep 0.2
done
fi
# Check it hasn't been started by something else in the meantime
pid=$(pgrep $service)
# Only attempt to start the service if it is not already running
if [ -z "$pid" ]; then
start
#s6-svc -t -wR -T5000 /var/run/s6/services/$service
fi
}
status() {
s6-svstat /var/run/s6/services/$service
s6-svstat /var/run/s6/services/$service
}
service="$1"
command="$2"
if [[ ! -d "/var/run/s6/services/$service" ]] ; then
echo "s6 service not found for $service, exiting..."
exit
echo "s6 service not found for $service, exiting..."
exit
fi;
${command} "${service}"

View File

@@ -30,6 +30,16 @@ export ADMIN_EMAIL
export WEBUIBOXEDLAYOUT
export QUERY_LOGGING
export PIHOLE_DNS_
export DHCP_ACTIVE
export DHCP_START
export DHCP_END
export DHCP_ROUTER
export DHCP_LEASETIME
export PIHOLE_DOMAIN
export DHCP_IPv6
export DHCP_rapid_commit
export WEBTHEME
export CUSTOM_CACHE_SIZE
export adlistFile='/etc/pihole/adlists.list'
@@ -44,7 +54,7 @@ export adlistFile='/etc/pihole/adlists.list'
. /opt/pihole/webpage.sh
# PH_TEST prevents the install from actually running (someone should rename that)
PH_TEST=true . $PIHOLE_INSTALL
PH_TEST=true . "${PIHOLE_INSTALL}"
echo " ::: Starting docker specific checks & setup for docker pihole/pihole"
@@ -66,9 +76,9 @@ prepare_configs
[ -n "${INSTALL_WEB_SERVER}" ] && change_setting "INSTALL_WEB_SERVER" "$INSTALL_WEB_SERVER"
[ -n "${INSTALL_WEB_INTERFACE}" ] && change_setting "INSTALL_WEB_INTERFACE" "$INSTALL_WEB_INTERFACE"
[ -n "${LIGHTTPD_ENABLED}" ] && change_setting "LIGHTTPD_ENABLED" "$LIGHTTPD_ENABLED"
[ -n "${ServerIP}" ] && change_setting "IPV4_ADDRESS" "$ServerIP"
[ -n "${ServerIPv6}" ] && change_setting "IPV6_ADDRESS" "$ServerIPv6"
[ -n "${DNS_BOGUS_PRIV}" ] && change_setting "DNS_BOGUS_PRIV" "$DNS_BOGUS_PRIV"
[ -n "${ServerIP}" ] && changeFTLsetting "REPLY_ADDR4" "$ServerIP"
[ -n "${ServerIPv6}" ] && changeFTLsetting "REPLY_ADDR6" "$ServerIPv6"
[ -n "${DNS_FQDN_REQUIRED}" ] && change_setting "DNS_FQDN_REQUIRED" "$DNS_FQDN_REQUIRED"
[ -n "${DNSSEC}" ] && change_setting "DNSSEC" "$DNSSEC"
[ -n "${REV_SERVER}" ] && change_setting "REV_SERVER" "$REV_SERVER"
@@ -76,6 +86,15 @@ prepare_configs
[ -n "${REV_SERVER_TARGET}" ] && change_setting "REV_SERVER_TARGET" "$REV_SERVER_TARGET"
[ -n "${REV_SERVER_CIDR}" ] && change_setting "REV_SERVER_CIDR" "$REV_SERVER_CIDR"
# Get all exported environment variables starting with FTLCONF_ as a prefix and call the changeFTLsetting
# function with the environment variable's suffix as the key. This allows applying any pihole-FTL.conf
# setting defined here: https://docs.pi-hole.net/ftldns/configfile/
declare -px | grep FTLCONF_ | sed -E 's/declare -x FTLCONF_([^=]+)=\"(.+)\"/\1 \2/' | while read -r name value
do
echo "Applying pihole-FTL.conf setting $name=$value"
changeFTLsetting "$name" "$value"
done
if [ -z "$REV_SERVER" ];then
# If the REV_SERVER* variables are set, then there is no need to add these.
# If it is not set, then adding these variables is fine, and they will be converted by the Pi-hole install script
@@ -96,13 +115,27 @@ fi
# Parse the PIHOLE_DNS variable, if it exists, and apply upstream servers to Pi-hole config
if [ -n "${PIHOLE_DNS_}" ]; then
echo "Setting DNS servers based on PIHOLE_DNS_ variable"
# Remove any PIHOLE_DNS_ entries from setupVars.conf, if they exist
sed -i '/PIHOLE_DNS_/d' /etc/pihole/setupVars.conf
# Split into an array (delimited by ;)
# Loop through and add them one by one to setupVars.conf
PIHOLE_DNS_ARR=(${PIHOLE_DNS_//;/ })
count=1
valid_entries=0
for i in "${PIHOLE_DNS_ARR[@]}"; do
change_setting "PIHOLE_DNS_$count" "$i"
((count=count+1))
if valid_ip "$i" || valid_ip6 "$i" ; then
change_setting "PIHOLE_DNS_$count" "$i"
((count=count+1))
((valid_entries=valid_entries+1))
else
echo "Invalid IP detected in PIHOLE_DNS_: ${i}"
fi
done
if [ $valid_entries -eq 0 ]; then
echo "No Valid IPs dectected in PIHOLE_DNS_. Aborting"
exit 1
fi
else
# Environment variable has not been set, but there may be existing values in an existing setupVars.conf
# if this is the case, we do not want to overwrite these with the defaults of 8.8.8.8 and 8.8.4.4
@@ -118,6 +151,23 @@ else
fi
fi
# Parse the WEBTHEME variable, if it exists, and set the selected theme if it is one of the supported values.
# 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")
echo "Setting Web Theme based on WEBTHEME variable, using value ${WEBTHEME}"
change_setting "WEBTHEME" "${WEBTHEME}"
;;
*)
echo "Invalid theme name supplied: ${WEBTHEME}, falling back to default-light."
change_setting "WEBTHEME" "default-light"
;;
esac
fi
[[ -n "${DHCP_ACTIVE}" && ${DHCP_ACTIVE} == "true" ]] && echo "Setting DHCP server" && setup_dhcp
setup_web_port "$WEB_PORT"
setup_web_password "$WEBPASSWORD"
setup_temp_unit "$TEMPERATUREUNIT"

View File

@@ -1,27 +1,20 @@
import functools
import os
import pytest
import subprocess
import testinfra
import types
local_host = testinfra.get_host('local://')
check_output = local_host.check_output
DEBIAN_VERSION = os.environ.get('DEBIAN_VERSION', 'buster')
__version__ = None
dotdot = os.path.abspath(os.path.join(os.path.abspath(__file__), os.pardir, os.pardir))
with open('{}/VERSION'.format(dotdot), 'r') as v:
raw_version = v.read().strip()
__version__ = raw_version.replace('release/', 'release-')
@pytest.fixture()
def run_and_stream_command_output():
def run_and_stream_command_output_inner(command, verbose=False):
print("Running", command)
build_env = os.environ.copy()
build_env['PIHOLE_VERSION'] = __version__
build_env['PIHOLE_DOCKER_TAG'] = version
build_result = subprocess.Popen(command.split(), env=build_env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
bufsize=1, universal_newlines=True)
if verbose:
@@ -82,7 +75,7 @@ def Docker(request, test_args, args, image, cmd, entrypoint):
def DockerPersist(request, persist_test_args, persist_args, persist_image, persist_cmd, persist_entrypoint, Dig):
''' Persistent Docker container for multiple tests, instead of stopping container after one test '''
''' Uses DUP'd module scoped fixtures because smaller scoped fixtures won't mix with module scope '''
persistent_container = DockerGeneric(request, persist_test_args, persist_args, persist_image, persist_cmd, persist_entrypoint)
persistent_container = DockerGeneric(request, persist_test_args, persist_args, persist_image, persist_cmd, persist_entrypoint)
''' attach a dig conatiner for lookups '''
persistent_container.dig = Dig(persistent_container.id)
return persistent_container
@@ -91,13 +84,13 @@ def DockerPersist(request, persist_test_args, persist_args, persist_image, persi
def entrypoint():
return ''
@pytest.fixture(params=['amd64', 'armhf', 'arm64', 'armel'])
@pytest.fixture(params=['amd64', 'armhf', 'arm64', 'armel', 'i386'])
def arch(request):
return request.param
@pytest.fixture()
def version():
return __version__
return os.environ.get('GIT_TAG', None)
@pytest.fixture()
def debian_version():
@@ -128,7 +121,7 @@ def persist_arch():
@pytest.fixture(scope='module')
def persist_version():
return __version__
return version
@pytest.fixture(scope='module')
def persist_debian_version():

View File

@@ -48,6 +48,39 @@ def test_bad_input_to_WEB_PORT(Docker, test_args, expected_error):
assert expected_error in function.stdout
@pytest.mark.parametrize('test_args,cache_size', [('-e CUSTOM_CACHE_SIZE="0"', '0'), ('-e CUSTOM_CACHE_SIZE="20000"', '20000')])
def test_overrides_default_CUSTOM_CACHE_SIZE(Docker, Slow, test_args, cache_size):
''' Changes the cache_size setting to increase or decrease the cache size for dnsmasq'''
CONFIG_LINE = r'cache-size\s*=\s*{}'.format(cache_size)
DNSMASQ_CONFIG = '/etc/dnsmasq.d/01-pihole.conf'
function = Docker.run('echo ${CUSTOM_CACHE_SIZE};. ./bash_functions.sh; echo ${CUSTOM_CACHE_SIZE}; eval `grep setup_dnsmasq /start.sh`')
assert "Custom CUSTOM_CACHE_SIZE set to {}".format(cache_size) in function.stdout
Slow(lambda: re.search(CONFIG_LINE, Docker.run('cat {}'.format(DNSMASQ_CONFIG)).stdout) != None)
@pytest.mark.parametrize('test_args', [
'-e CUSTOM_CACHE_SIZE="-1"',
'-e CUSTOM_CACHE_SIZE="1,000"',
])
def test_bad_input_to_CUSTOM_CACHE_SIZE(Docker, Slow, test_args):
CONFIG_LINE = r'cache-size\s*=\s*10000'
DNSMASQ_CONFIG = '/etc/dnsmasq.d/01-pihole.conf'
Docker.run('. ./bash_functions.sh; eval `grep setup_dnsmasq /start.sh`')
Slow(lambda: re.search(CONFIG_LINE, Docker.run('cat {}'.format(DNSMASQ_CONFIG)).stdout) != None)
@pytest.mark.parametrize('test_args', [
'-e DNSSEC="true" -e CUSTOM_CACHE_SIZE="0"',
])
def test_dnssec_enabled_with_CUSTOM_CACHE_SIZE(Docker, Slow, test_args):
CONFIG_LINE = r'cache-size\s*=\s*10000'
DNSMASQ_CONFIG = '/etc/dnsmasq.d/01-pihole.conf'
Docker.run('. ./bash_functions.sh; eval `grep setup_dnsmasq /start.sh`')
Slow(lambda: re.search(CONFIG_LINE, Docker.run('cat {}'.format(DNSMASQ_CONFIG)).stdout) != None)
# DNS Environment Variable behavior in combinations of modified pihole LTE settings
@pytest.mark.skip('broke, needs investigation in v5.0 beta')
@pytest.mark.parametrize('args_env, expected_stdout, dns1, dns2', [
@@ -110,16 +143,15 @@ def test_DNS_Envs_are_secondary_to_setupvars(Docker, Slow, args_env, expected_st
expected_servers)
@pytest.mark.parametrize('args_env, expected_stdout, expected_config_line', [
('', 'binding to default interface: eth0', 'interface=eth0' ),
('-e INTERFACE="eth0"', 'binding to default interface: eth0', 'interface=eth0' ),
('-e INTERFACE="br0"', 'binding to custom interface: br0', 'interface=br0'),
@pytest.mark.parametrize('args_env, expected_stdout, expected_config_line', [
('', 'binding to default interface: eth0', 'PIHOLE_INTERFACE=eth0'),
('-e INTERFACE="br0"', 'binding to custom interface: br0', 'PIHOLE_INTERFACE=br0'),
])
def test_DNS_interface_override_defaults(Docker, Slow, args_env, expected_stdout, expected_config_line):
''' When INTERFACE environment var is passed in, overwrite dnsmasq interface '''
function = Docker.run('. /bash_functions.sh ; eval `grep "^setup_dnsmasq " /start.sh`')
assert expected_stdout in function.stdout
Slow(lambda: expected_config_line + '\n' == Docker.run('grep "^interface" /etc/dnsmasq.d/01-pihole.conf').stdout)
Slow(lambda: expected_config_line + '\n' == Docker.run('grep "^PIHOLE_INTERFACE" /etc/pihole/setupVars.conf').stdout)
expected_debian_lines = [

View File

@@ -46,8 +46,8 @@ echo "Testing $IMAGE with volumes base path $VOLUMES"
# Running stock+empty volumes (no ports to avoid conflicts)
CONTAINER="$(
docker run -d \
-v "$VOL_PH:/etc/pihole/" \
-v "$VOL_DM:/etc/dnsmasq.d/" \
-v "$VOL_PH:/etc/pihole" \
-v "$VOL_DM:/etc/dnsmasq.d" \
-v "/dev/null:/etc/pihole/adlists.list" \
--entrypoint='' \
$IMAGE \
@@ -92,8 +92,8 @@ assert_new_settings
docker rm -f $CONTAINER
CONTAINER="$(
docker run -d \
-v "$VOL_PH:/etc/pihole/" \
-v "$VOL_DM:/etc/dnsmasq.d/" \
-v "$VOL_PH:/etc/pihole" \
-v "$VOL_DM:/etc/dnsmasq.d" \
-v "/dev/null:/etc/pihole/adlists.list" \
--entrypoint='' \
$IMAGE \

View File

@@ -1,3 +1,6 @@
import pytest
@pytest.mark.skip('broke, needs further investigation.')
def test_volume_shell_script(arch, run_and_stream_command_output):
# only one arch should be necessary
if arch == 'amd64':