add better error handling to entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3a135da3ba
commit
a6850c8478
@ -1,2 +1,5 @@
|
|||||||
|
* ENHANCEMENT
|
||||||
|
* better error handling in entrypoint script
|
||||||
|
|
||||||
* BUGFIX
|
* BUGFIX
|
||||||
* move healthcheck to wrapper script
|
* symling `/etc/ssl/certs/ca-certificates.crt` to freshrss root as workaround for [#2549](https://github.com/FreshRSS/FreshRSS/issues/2549)
|
||||||
|
@ -1,13 +1,42 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
/usr/local/bin/gomplate -V -o /etc/php7/php.ini -f /etc/templates/php.ini.tmpl
|
/usr/local/bin/gomplate -V -o /etc/php7/php.ini -f /etc/templates/php.ini.tmpl
|
||||||
/usr/local/bin/gomplate -V -o /var/www/app/data/config.php -f /etc/templates/config.php.tmpl
|
/usr/local/bin/gomplate -V -o /var/www/app/data/config.php -f /etc/templates/config.php.tmpl
|
||||||
/usr/local/bin/gomplate -V -o /var/www/app/constants.local.php -f /etc/templates/constants.local.php.tmpl
|
/usr/local/bin/gomplate -V -o /var/www/app/constants.local.php -f /etc/templates/constants.local.php.tmpl
|
||||||
|
|
||||||
/usr/bin/php -f ./cli/prepare.php
|
printf "\nPrepare FreshRSS...\n"
|
||||||
|
PREP=$(/usr/bin/phpp -f ./cli/prepare.php)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo $PREP
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${FRESHRSS_DEFAULT_USER}" ]; then
|
if [ "${FRESHRSS_DEFAULT_USER}" ]; then
|
||||||
/usr/bin/php ./cli/create-user.php --user "$FRESHRSS_DEFAULT_USER" --password "$FRESHRSS_DEFAULT_PASSWORD"
|
printf "\nEnsure default user exists...\n"
|
||||||
/usr/bin/php ./cli/do-install.php --default_user "$FRESHRSS_DEFAULT_USER"
|
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
|
||||||
|
*"username already taken"*) echo "Result: success" ;;
|
||||||
|
*)
|
||||||
|
echo $UCREATE
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "\nEnsure FreshRSS is installed...\n"
|
||||||
|
INSTALL=$(/usr/bin/php ./cli/do-install.php --default_user "$FRESHRSS_DEFAULT_USER" 2>&1)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
case "$INSTALL" in
|
||||||
|
*"already installed"*)
|
||||||
|
/usr/bin/php ./cli/reconfigure.php --default_user "$FRESHRSS_DEFAULT_USER"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $INSTALL
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec supercronic -split-logs /etc/crontabs/nginx 1> /dev/null &
|
exec supercronic -split-logs /etc/crontabs/nginx 1> /dev/null &
|
||||||
|
Reference in New Issue
Block a user