|
|
|
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|
|
|
|
file_env POSTGRES_USER
|
|
|
|
|
|
|
|
|
|
install=false
|
|
|
|
|
db_wait='1s'
|
|
|
|
|
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
|
|
|
|
echo "Installing with SQLite database"
|
|
|
|
|
# shellcheck disable=SC2016
|
|
|
|
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|
|
|
|
# shellcheck disable=SC2016
|
|
|
|
|
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
|
|
|
|
install=true
|
|
|
|
|
db_wait='10s'
|
|
|
|
|
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
|
|
|
|
echo "Installing with PostgreSQL database"
|
|
|
|
|
# shellcheck disable=SC2016
|
|
|
|
|
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
|
|
|
|
install=true
|
|
|
|
|
db_wait='10s'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$install" = true ]; then
|
|
|
|
|
run_path pre-installation
|
|
|
|
|
|
|
|
|
|
echo "Starting nextcloud installation"
|
|
|
|
|
echo "Starting Nextcloud installation"
|
|
|
|
|
max_retries=10
|
|
|
|
|
try=0
|
|
|
|
|
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
|
|
|
|
sleep $db_wait
|
|
|
|
|
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
|
|
|
|
do
|
|
|
|
|
echo "Retrying install..."
|
|
|
|
|
echo "Retrying installation..."
|
|
|
|
|
try=$((try+1))
|
|
|
|
|
sleep 10s
|
|
|
|
|
done
|
|
|
|
|
if [ "$try" -gt "$max_retries" ]; then
|
|
|
|
|
echo "Installing of nextcloud failed!"
|
|
|
|
|
echo "Installation of Nextcloud failed!"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
|
|
|
|
|