From cbf5d6620cd7c52128ff09fb858f0afe84a2e320 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 18 Jan 2023 22:37:07 +0000 Subject: [PATCH] lighttpd does not like it if VIRTUAL_HOST and FTLCONF_LOCAL_IPV4 are the same value - but that makes sense. Instead we set VIRTUAL_HOST to HOSTNAME if it is not already set by the user Also goes back to making the modifications to 15-pihole-admin.conf in conf-available - as otherwise it overwrites the symlink. Not a big deal, but I think we got confused earlier on Signed-off-by: Adam Warner --- src/s6/debian-root/usr/local/bin/bash_functions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/s6/debian-root/usr/local/bin/bash_functions.sh b/src/s6/debian-root/usr/local/bin/bash_functions.sh index 726329139..9098c9dcb 100644 --- a/src/s6/debian-root/usr/local/bin/bash_functions.sh +++ b/src/s6/debian-root/usr/local/bin/bash_functions.sh @@ -349,10 +349,10 @@ setup_lighttpd_bind() { setup_web_php_env() { local config_file - config_file="/etc/lighttpd/conf-enabled/15-pihole-admin.conf" - # if the environment variable VIRTUAL_HOST is not set, or is empty, then set it to the IP address of the container + config_file="/etc/lighttpd/conf-available/15-pihole-admin.conf" + # if the environment variable VIRTUAL_HOST is not set, or is empty, then set it to the hostname of the container if [ -z "${VIRTUAL_HOST}" ] || [ "${VIRTUAL_HOST}" == "" ]; then - VIRTUAL_HOST="${FTLCONF_LOCAL_IPV4}" + VIRTUAL_HOST="${HOSTNAME}" fi for config_var in "VIRTUAL_HOST" "CORS_HOSTS" "PHP_ERROR_LOG" "PIHOLE_DOCKER_TAG" "TZ"; do