Address comments.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2024-03-11 18:14:26 +00:00
parent 9fefa11c41
commit 24006c7a00
No known key found for this signature in database
8 changed files with 14 additions and 22 deletions

View File

@ -41,7 +41,7 @@ services:
- "53:53/udp"
# Default HTTP Port
- "80:80/tcp"
# Default HTTPs Port. FTL Will generate a self-signed certificate
# Default HTTPs Port. FTL will generate a self-signed certificate
- "443:443/tcp"
# Uncomment the below if using Pi-hole as your DHCP Server
#- "67:67/udp"
@ -80,7 +80,9 @@ There are multiple different ways to run DHCP from within your Docker Pi-hole co
## Configuration
It is recommended that you use environment variables to configure the Pi-hole docker container (more details below), however if you are persisting your `/etc/pihole` directory, you may also set them via the web interface or by directly editing `pihole.toml`
It is recommended that you use environment variables to configure the Pi-hole docker container (more details below), however if you are persisting your `/etc/pihole` directory, you may choose instead to set them via the web interface or by directly editing `pihole.toml`.
**Please Note**: Settings that are set via environment variables effectively become read-only, meaning that you will not be able to change them in the web interface or CLI. This is to ensure a "single source of truth" on the config.
### Web interface password
@ -217,7 +219,7 @@ Valid args are:
### Pi-hole features
Here are some relevant wiki pages from [Pi-hole's documentation](https://github.com/pi-hole/pi-hole/blob/master/README.md#get-help-or-connect-with-us-on-the-web). The web interface or command line tools can be used to implement changes to pihole.
Here are some relevant wiki pages from [Pi-hole's documentation](https://docs.pi-hole.net).
We install all pihole utilities so the the built in [pihole commands](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738) will work via `docker exec <container> <command>` like so:

View File

@ -6,7 +6,7 @@ if [[ "$1" == "enter" ]]; then
fi
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD | sed "s/\//-/g")
GIT_TAG=$(git describe --tags --exact-match 2> /dev/null || true)
GIT_TAG=$(git describe --tags --exact-match 2>/dev/null || true)
GIT_TAG="${GIT_TAG:-$GIT_BRANCH}"
PLATFORM="${PLATFORM:-linux/amd64}"

View File

@ -70,6 +70,10 @@ ensure_basic_configuration() {
exit 1
fi
setup_web_password
}
setup_web_password() {
# If FTLCONF_webserver_api_password is not set
if [ -z "${FTLCONF_webserver_api_password+x}" ]; then
# Is this already set to something other than blank (default) in FTL's config file? (maybe in a volume mount)

View File

@ -1,5 +1,5 @@
ARG alpine_version="3.19"
ARG docker_version="24.0.7"
ARG docker_version="25.0.4"
FROM docker:${docker_version}-cli-alpine${alpine_version}

View File

@ -8,5 +8,4 @@ docker images pihole:${GIT_TAG}
python -m black ./test/tests/
# TODO: Add junitxml output and have something consume it
# 2 parallel max b/c race condition with docker fixture (I think?)
py.test -vv -n auto ./test/tests/

View File

@ -37,7 +37,7 @@ def run_and_stream_command_output():
@pytest.fixture()
def args_env():
return '-e TZ="Europe/London" -e FTLCONF_ENV_ONLY=true'
return '-e TZ="Europe/London" -e FTLCONF_dns_upstreams="8.8.8.8"'
@pytest.fixture()

View File

@ -18,11 +18,9 @@ def test_ftlconf_dns_upstreams(docker):
CMD_SETUP_WEB_PASSWORD = ". bash_functions.sh ; setup_web_password"
@pytest.mark.parametrize("test_args", ['-e "FTLCONF_ENV_ONLY=false"'])
def test_random_password_assigned_fresh_start(docker):
func = docker.run(CMD_SETUP_WEB_PASSWORD)
assert "assigning random password:" in func.stdout
assert "New password set" in func.stdout
@pytest.mark.parametrize(
@ -31,12 +29,3 @@ def test_random_password_assigned_fresh_start(docker):
def test_password_set_by_envvar(docker):
func = docker.run(CMD_SETUP_WEB_PASSWORD)
assert "Assigning password defined by Environment Variable" in func.stdout
@pytest.mark.parametrize("test_args", ['-e "FTLCONF_ENV_ONLY=true"'])
def test_password_envonly_true(docker):
func = docker.run(CMD_SETUP_WEB_PASSWORD)
assert (
"No password supplied via FTLCONF_webserver_api_password, but FTLCONF_ENV_ONLY is set to true, using default (none)"
in func.stdout
)

View File

@ -13,10 +13,8 @@ def test_pihole_gid_env_var(docker):
assert "456" in func.stdout
# We immediately remove the adlists.list file so that gravity does not attempt to download a default list
# Wait 5 seconds for gravity to finish, then kill the start.sh script
# Finally, tail the FTL log to see if it shuts down cleanly
@pytest.mark.parametrize("test_args", ['-e "PH_VERBOSE=1"'])
# Wait 5 seconds for startup, then kill the start.sh script
# Finally, tail the FTL log to see if it has been shut down cleanly
def test_pihole_ftl_clean_shutdown(docker):
func = docker.run(
"""