selfoss/entrypoint.sh.tmpl

36 lines
1002 B
Cheetah
Raw Normal View History

2024-01-21 03:06:41 +00:00
#!/usr/bin/env sh
2020-09-23 11:35:54 +00:00
configure_php() {
2020-09-23 11:53:34 +00:00
# 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
2024-02-10 23:23:40 +00:00
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
2020-09-23 11:35:54 +00:00
fi
2024-02-10 23:23:40 +00:00
if ! grep -q '^clear_env = no' /etc/php8/php-fpm.conf; then
echo 'clear_env = no' >> /etc/php8/php-fpm.conf
2020-09-23 11:35:54 +00:00
fi
2024-02-10 23:23:40 +00:00
if ! grep -q 'variables_order = "EGPCS"' /etc/php8/php.ini; then
2020-09-23 11:35:54 +00:00
sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/g' \
2024-02-10 23:23:40 +00:00
/etc/php8/php.ini
2020-09-23 11:35:54 +00:00
fi
}
load_vars() {
2024-02-10 23:23:40 +00:00
#export SELFOSS_PASSWORD=$(cat $SELFOSS_PASSWORD_FILE)
2024-01-21 03:06:41 +00:00
export SELFOSS_DB_PASSWORD=$(cat $SELFOSS_DB_PASSWORD_FILE)
2020-09-23 11:35:54 +00:00
}
main() {
2020-09-23 11:53:34 +00:00
set -eu
2020-09-23 11:35:54 +00:00
2020-09-23 11:53:34 +00:00
configure_php
load_vars
2020-09-23 11:35:54 +00:00
}
main
2020-09-23 11:53:34 +00:00
# 3wc: upstream ENTRYPOINT
# https://github.com/theAkito/docker-selfoss/blob/master/Dockerfile
2020-09-23 11:35:54 +00:00
run.sh