I don't know why PHP_ENV_CONFIG is an environment variable. We don't need it to be
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
91161b7ec6
commit
61bd3c756a
|
@ -12,9 +12,6 @@ COPY s6/service /usr/local/bin/service
|
|||
RUN bash -ex install.sh 2>&1 && \
|
||||
rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
|
||||
|
||||
# php config start passes special ENVs into
|
||||
ARG PHP_ENV_CONFIG
|
||||
ENV PHP_ENV_CONFIG /etc/lighttpd/conf-enabled/15-pihole-admin.conf
|
||||
ARG PHP_ERROR_LOG
|
||||
ENV PHP_ERROR_LOG /var/log/lighttpd/error-pihole.log
|
||||
|
||||
|
|
|
@ -348,6 +348,8 @@ setup_lighttpd_bind() {
|
|||
}
|
||||
|
||||
setup_web_php_env() {
|
||||
local config_file
|
||||
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 IP address of the container
|
||||
if [ -z "${VIRTUAL_HOST}" ] || [ "${VIRTUAL_HOST}" == "" ]; then
|
||||
VIRTUAL_HOST="${FTLCONF_LOCAL_IPV4}"
|
||||
|
@ -355,17 +357,17 @@ setup_web_php_env() {
|
|||
|
||||
for config_var in "VIRTUAL_HOST" "CORS_HOSTS" "PHP_ERROR_LOG" "PIHOLE_DOCKER_TAG" "TZ"; do
|
||||
local beginning_of_line=" \"${config_var}\" => "
|
||||
if grep -qP "^$beginning_of_line" "$PHP_ENV_CONFIG" ; then
|
||||
if grep -qP "^$beginning_of_line" "$config_file" ; then
|
||||
# replace line if already present
|
||||
sed -i "/${beginning_of_line}/c\\${beginning_of_line}\"${!config_var}\"," "$PHP_ENV_CONFIG"
|
||||
sed -i "/${beginning_of_line}/c\\${beginning_of_line}\"${!config_var}\"," "$config_file"
|
||||
else
|
||||
# add line otherwise
|
||||
sed -i "/bin-environment/ a\\${beginning_of_line}\"${!config_var}\"," "$PHP_ENV_CONFIG"
|
||||
sed -i "/bin-environment/ a\\${beginning_of_line}\"${!config_var}\"," "$config_file"
|
||||
fi
|
||||
done
|
||||
|
||||
echo " [i] Added ENV to php:"
|
||||
grep -E '(VIRTUAL_HOST|CORS_HOSTS|PHP_ERROR_LOG|PIHOLE_DOCKER_TAG|TZ)' "$PHP_ENV_CONFIG"
|
||||
grep -E '(VIRTUAL_HOST|CORS_HOSTS|PHP_ERROR_LOG|PIHOLE_DOCKER_TAG|TZ)' "$config_file"
|
||||
}
|
||||
|
||||
setup_web_port() {
|
||||
|
|
Loading…
Reference in New Issue