Commit Graph

131 Commits

Author SHA1 Message Date
Adam Warner e1dc289d7d
Fix suggested spelling mistakes
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-22 17:41:29 +01:00
Adam Warner 51cffa7e56
Update bash_functions.sh
Co-authored-by: yubiuser <ckoenig@posteo.de>
2022-04-04 20:59:07 +01:00
Adam Warner 0db0df5231
change one more `touch` command to `install /dev/null` to prevent issues on fresh volumes (and for consistency with other usages)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-04 18:06:25 +01:00
Dan Schaper ce75910d28
Allow caps detection out of order.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-04-02 12:24:02 -07:00
Dan Schaper 6b9abc23a0
Apply capabilities to pihole-FTL and notify DHCP wihtout NET_ADMIN.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-04-02 11:58:42 -07:00
Adam Warner 70bad9f08f
Extend conditional cap setting to all caps before attempting to set them
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-02 11:08:20 +01:00
Adam Warner 4dc9504330
evert pihole-FTL service command to use s6-setuidgid command when running pihole-FTL
Update fix_capabilities to only apply net_admin and sys_nice if they are actually available to the container

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-02 10:50:55 +01:00
Dan Schaper 72b1c8679c
Add if/then guards to touch calls for Buster.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-03-31 11:49:35 -07:00
Dan Schaper a485e238ca
call capsh directly, no need to set uid/gid
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-03-28 18:37:03 -07:00
Dan Schaper 086dd6cc86
Bullseye based `capsh`
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-03-28 14:37:13 -07:00
Dan Schaper 1221d91685
Whistles.... 2022-03-24 14:40:25 -07:00
Dan Schaper 06232c767e
See Mattermost for discussion.
Trying again with DAC override.
2022-03-24 14:35:12 -07:00
Dan Schaper 3aee0e1eaf
Test fix for moby security update.
Change the permissions to `permitted` instead of `inherited`.

See https://github.com/moby/moby/issues/43420#issuecomment-1077870013
2022-03-24 12:48:24 -07: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 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 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 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 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 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 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 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
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
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
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 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 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 87c99a0b8c
Merge pull request #823 from limes007/master
Make test of IPv6 env variable case insensitive
2021-04-16 19:40:25 +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
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 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
MichaIng 512f610afa Skip full distro check on start
The distro_check function includes updating the APT cache, checking for dependencies, which is both not required on Docker start where all required packages are installed already. The only required steps from this function is the webserver user and config file names, which can be applied directly instead since we know that the Pi-hole Docker container is based on Debian.

Furthermore this solves the issue that updating the APT cache fails, when Pi-hole itself is used for DNS resolution, since pihole-FTL has not yet been started at this stage. That failure was not visible since "apt-get update" does not exist with error code (currently) when facing DNS resolving issues, even if not a single list could have been updated, and no other step is done that would require DNS resolving, until pihole-FTL is started. For a regular (non-Docker) install or update it is however reasonable to error out directly when the APT cache could not have been updated, to not defer the exit unnecessarily to a harder-to-debug stage.

Signed-off-by: MichaIng <micha@dietpi.com>
2021-01-24 15:14:18 +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
Adam Warner 0cb7324a60
Further simplifications
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2020-12-16 22:19:20 +00:00
Adam Warner f77e4609ce
Introduce new env VAR for setting PIHOLE_DNS_x values.
If not set, keep existing values in setupVars
if no existing values in setupVars - fall back to defaults

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2020-12-16 21:41:09 +00:00
Daniel 752d83aeaa
Introduce additional docker tags for the debian version.
* Added new docker tag variations to specify the debian version ('stretch', and 'buster').
* Arch images are alway as specific as possible: pihole/pihole:master-amd64-stretch
* Multiarch images have both the specific debian version tags as well as the generic non-debian tags: pihole/pihole:master-stretch & pihole/pihole:master
* Currently, the non-specific tags point to the 'stretch' images. Eventaully it can be migrated to 'buster'.
* Use GitHub actions to do the builds. Although the script names include 'gh-actions' to differentiate them from the 'circle' scripts, there is zero logic that is specific to Github (ie. no Github environment variables).
* 'armhf:buster' & 'arm64:buster' has an issue with `ip route get`. I think the issue is related to 'qemu', but I'm not sure. Update the `validate_env` function to only use `ip route get` if `nc` reports something strange.

Signed-off-by: Daniel <daniel@developerdan.com>
2020-06-29 09:34:19 -04:00
Adam Hill 9213bbd322 Merge branch 'dev' of github.com:diginc/docker-pi-hole into no_resolv_check
Signed-off-by: Adam Hill <adam@diginc.us>
2020-05-30 18:03:05 -05:00
Adam Hill e7bb456701
Merge branch 'dev' into patch-1 2020-05-30 14:23:27 -05:00
Sandro ecb0aaf805
Don't bind to 127.0.0.1 when listening on all ports
Closes #495

Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
2020-05-30 07:04:55 +02:00
Adam Hill 808359e832
Merge pull request #608 from ahuffman/master
Fixes #557
2020-05-27 00:02:06 -05:00
Adam Hill d7fdb188ed remove resolv conf checks
Signed-off-by: Adam Hill <adam@diginc.us>
2020-05-26 10:45:48 -05:00
Adam Hill d444a11ad1 Merge branch 'dev' of github.com:pi-hole/docker-pi-hole into beta-v5.0 2020-05-10 11:58:22 -05:00
Andrew J. Huffman 2228115a97
Fixes #557
* Refactored the prepare_configs function in bash_functions.sh
* Now able to set settings via the UI or ENV Variables - ENV Variables override when restarted
* Added ENV Variables for ADMIN_EMAIL, TEMPERATUREUNIT, and WEBUIBOXEDLAYOUT
    - Created setup_temp_unit function in bash_functions.sh
    - Created setup_ui_layout function in bash_functions.sh
    - Created setup_admin_email function in bash_functions.sh
* Updated README.md
    - Added docs on new ENV Variables
    - Updated True/False settings docs so they were quoted, otherwise misleading to k8s users and not "true" booleans

Signed-off-by: Andrew J. Huffman <ahuffman@vmware.com>
2020-05-04 17:29:47 -04:00
Adam Hill 3c510e2edb remove HTML web port sed/test, no hits exist anymore
Signed-off-by: Adam Hill <adam@diginc.us>
2020-04-18 15:18:15 -05:00