2020-02-21 22:54:20 +00:00
|
|
|
#!/usr/bin/env sh
|
2019-10-03 11:46:02 +00:00
|
|
|
|
2020-12-31 12:22:05 +00:00
|
|
|
/usr/local/bin/gomplate -o /etc/php7/php.ini -f /etc/templates/php.ini.tmpl
|
|
|
|
/usr/local/bin/gomplate -o /var/www/app/data/config.php -f /etc/templates/config.php.tmpl
|
|
|
|
/usr/local/bin/gomplate -o /var/www/app/constants.local.php -f /etc/templates/constants.local.php.tmpl
|
2019-10-02 07:43:32 +00:00
|
|
|
|
2020-02-21 22:54:20 +00:00
|
|
|
if [ -n "${FRESHRSS_POSTGRES_SSL_ROOTCERT}" ] && [ ! -f "/var/www/.postgresql/root.crt" ]; then
|
2019-10-05 13:30:54 +00:00
|
|
|
ln -s "${FRESHRSS_POSTGRES_SSL_ROOTCERT}" /var/www/.postgresql/root.crt
|
|
|
|
fi
|
|
|
|
|
2019-10-03 11:46:02 +00:00
|
|
|
printf "\nPrepare FreshRSS...\n"
|
2019-10-03 12:10:42 +00:00
|
|
|
PREP=$(/usr/bin/php -f ./cli/prepare.php)
|
2019-10-03 11:46:02 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
2020-02-21 22:54:20 +00:00
|
|
|
echo "$PREP"
|
2019-10-03 11:46:02 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2019-10-02 07:43:32 +00:00
|
|
|
|
|
|
|
if [ "${FRESHRSS_DEFAULT_USER}" ]; then
|
2019-10-03 11:46:02 +00:00
|
|
|
printf "\nEnsure default user exists...\n"
|
|
|
|
UCREATE=$(/usr/bin/php ./cli/create-user.php --user "$FRESHRSS_DEFAULT_USER" --password "$FRESHRSS_DEFAULT_PASSWORD" 2>&1)
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
case "$UCREATE" in
|
2019-10-03 16:13:05 +00:00
|
|
|
*"username already taken"*) ;;
|
2019-10-03 11:46:02 +00:00
|
|
|
*)
|
2020-02-21 22:54:20 +00:00
|
|
|
echo "$UCREATE"
|
2019-10-28 18:15:46 +00:00
|
|
|
rm -rf "/var/www/app/data/users/$FRESHRSS_DEFAULT_USER"
|
2019-10-03 11:46:02 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2020-02-21 22:54:20 +00:00
|
|
|
fi
|
2019-10-05 14:20:38 +00:00
|
|
|
printf "Result: success\n\n"
|
2019-10-03 16:13:05 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "/var/www/app/data/do-install.txt" ]; then
|
|
|
|
rm -rf /var/www/app/data/do-install.txt
|
2019-10-02 07:43:32 +00:00
|
|
|
fi
|
|
|
|
|
2019-10-09 08:01:15 +00:00
|
|
|
supercronic /etc/crontabs/nginx &
|
|
|
|
php-fpm7 -F &
|
2019-10-02 07:43:32 +00:00
|
|
|
exec nginx -g "daemon off;"
|