36 lines
1002 B
Bash
36 lines
1002 B
Bash
#!/usr/bin/env sh
|
|
|
|
configure_php() {
|
|
# 3wc: these changes allow environment variables to propagate to PHP; Selfoss
|
|
# already loads its config from environment variables but unless we make these
|
|
# changes, it can't access them. See
|
|
# https://github.com/docker-library/php/pull/93/files
|
|
if ! grep -q '^clear_env = no' /etc/php8/php-fpm.d/www.conf; then
|
|
sed -i 's/;clear_env = no/clear_env = no/' /etc/php8/php-fpm.d/www.conf
|
|
fi
|
|
if ! grep -q '^clear_env = no' /etc/php8/php-fpm.conf; then
|
|
echo 'clear_env = no' >> /etc/php8/php-fpm.conf
|
|
fi
|
|
if ! grep -q 'variables_order = "EGPCS"' /etc/php8/php.ini; then
|
|
sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/g' \
|
|
/etc/php8/php.ini
|
|
fi
|
|
}
|
|
load_vars() {
|
|
#export SELFOSS_PASSWORD=$(cat $SELFOSS_PASSWORD_FILE)
|
|
export SELFOSS_DB_PASSWORD=$(cat $SELFOSS_DB_PASSWORD_FILE)
|
|
}
|
|
|
|
main() {
|
|
set -eu
|
|
|
|
configure_php
|
|
load_vars
|
|
}
|
|
|
|
main
|
|
|
|
# 3wc: upstream ENTRYPOINT
|
|
# https://github.com/theAkito/docker-selfoss/blob/master/Dockerfile
|
|
run.sh
|