mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2024-06-27 03:35:09 +02:00
Adding CORS_HOSTS to PHP environment
Signed-off-by: Adyanth H <33192449+adyanth@users.noreply.github.com>
This commit is contained in:
parent
5ed2b9ab2c
commit
901ee3d10b
|
@ -199,19 +199,22 @@ setup_php_env() {
|
||||||
VIRTUAL_HOST="$ServerIP"
|
VIRTUAL_HOST="$ServerIP"
|
||||||
fi;
|
fi;
|
||||||
local vhost_line="\t\t\t\"VIRTUAL_HOST\" => \"${VIRTUAL_HOST}\","
|
local vhost_line="\t\t\t\"VIRTUAL_HOST\" => \"${VIRTUAL_HOST}\","
|
||||||
|
local corshosts_line="\t\t\t\"CORS_HOSTS\" => \"${CORS_HOSTS}\","
|
||||||
local serverip_line="\t\t\t\"ServerIP\" => \"${ServerIP}\","
|
local serverip_line="\t\t\t\"ServerIP\" => \"${ServerIP}\","
|
||||||
local php_error_line="\t\t\t\"PHP_ERROR_LOG\" => \"${PHP_ERROR_LOG}\","
|
local php_error_line="\t\t\t\"PHP_ERROR_LOG\" => \"${PHP_ERROR_LOG}\","
|
||||||
|
|
||||||
# idempotent line additions
|
# idempotent line additions
|
||||||
grep -qP "$vhost_line" "$PHP_ENV_CONFIG" || \
|
grep -qP "$vhost_line" "$PHP_ENV_CONFIG" || \
|
||||||
sed -i "/bin-environment/ a\\${vhost_line}" "$PHP_ENV_CONFIG"
|
sed -i "/bin-environment/ a\\${vhost_line}" "$PHP_ENV_CONFIG"
|
||||||
grep -qP "$serverip_line" "$PHP_ENV_CONFIG" || \
|
grep -qP "$corshosts_line" "$PHP_ENV_CONFIG" || \
|
||||||
|
sed -i "/bin-environment/ a\\${corshosts_line}" "$PHP_ENV_CONFIG"
|
||||||
|
grep -qP "$serverip_line" "$PHP_ENV_CONFIG" || \
|
||||||
sed -i "/bin-environment/ a\\${serverip_line}" "$PHP_ENV_CONFIG"
|
sed -i "/bin-environment/ a\\${serverip_line}" "$PHP_ENV_CONFIG"
|
||||||
grep -qP "$php_error_line" "$PHP_ENV_CONFIG" || \
|
grep -qP "$php_error_line" "$PHP_ENV_CONFIG" || \
|
||||||
sed -i "/bin-environment/ a\\${php_error_line}" "$PHP_ENV_CONFIG"
|
sed -i "/bin-environment/ a\\${php_error_line}" "$PHP_ENV_CONFIG"
|
||||||
|
|
||||||
echo "Added ENV to php:"
|
echo "Added ENV to php:"
|
||||||
grep -E '(VIRTUAL_HOST|ServerIP|PHP_ERROR_LOG)' "$PHP_ENV_CONFIG"
|
grep -E '(VIRTUAL_HOST|CORS_HOSTS|ServerIP|PHP_ERROR_LOG)' "$PHP_ENV_CONFIG"
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_web_port() {
|
setup_web_port() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user