Merge pull request #1269 from pi-hole/fix/PHP_ENV_CONFIG
Change `PHP_ENV_CONFIG` and `setup_web_php_env()`
This commit is contained in:
commit
2c04346411
|
@ -14,7 +14,7 @@ RUN bash -ex install.sh 2>&1 && \
|
|||
|
||||
# php config start passes special ENVs into
|
||||
ARG PHP_ENV_CONFIG
|
||||
ENV PHP_ENV_CONFIG /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
|
||||
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
|
||||
|
||||
|
|
|
@ -353,8 +353,8 @@ setup_web_php_env() {
|
|||
fi;
|
||||
|
||||
for config_var in "VIRTUAL_HOST" "CORS_HOSTS" "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
|
||||
local beginning_of_line=" \"${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
|
||||
|
|
|
@ -182,7 +182,7 @@ def test_debian_setup_php_env(docker, expected_lines, repeat_function):
|
|||
)
|
||||
for expected_line in expected_lines:
|
||||
search_config_cmd = (
|
||||
"grep -c '{}' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf".format(
|
||||
"grep -c '{}' /etc/lighttpd/conf-enabled/15-pihole-admin.conf".format(
|
||||
expected_line
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue