File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -482,6 +482,9 @@ php /var/www/html/occ config:system:set overwrite.cli.url --value="https://$NC_D
482482php /var/www/html/occ config:system:set htaccess.RewriteBase --value=" /"
483483php /var/www/html/occ maintenance:update:htaccess
484484
485+ # Apply dbpersistent setting in order to fix too many db connections
486+ php /var/www/html/occ config:system:set dbpersistent --value=true --type=bool
487+
485488# Disallow creating local external storages when nothing was mounted
486489if [ -z " $NEXTCLOUD_MOUNT " ]; then
487490 php /var/www/html/occ config:system:set files_external_allow_create_new_local --type=bool --value=false
Original file line number Diff line number Diff line change @@ -6,13 +6,23 @@ while ! sudo -u www-data nc -z "$POSTGRES_HOST" 5432; do
66 sleep 5
77done
88
9- # Wait for database to actually start
9+ # Use the correct Postgres username
10+ POSTGRES_USER=" oc_$POSTGRES_USER "
11+ export POSTGRES_USER
12+
13+ # Fix false database connection on old instances
1014if [ -f " /var/www/html/config/config.php" ]; then
1115 sleep 2
1216 while ! sudo -u www-data psql -d " postgresql://$POSTGRES_USER :$POSTGRES_PASSWORD @$POSTGRES_HOST :5432/$POSTGRES_DB " -c " select now()" ; do
1317 echo " Waiting for the database to start..."
1418 sleep 5
1519 done
20+ if [ " $POSTGRES_USER " = " oc_nextcloud" ] && [ " $POSTGRES_DB " = " nextcloud_database" ] && echo " $POSTGRES_PASSWORD " | grep -q ' ^[a-z0-9]\+$' ; then
21+ # This was introduced with https://github.com/nextcloud/all-in-one/pull/218
22+ sed -i " s|'dbuser'.*=>.*$|'dbuser' => '$POSTGRES_USER ',|" /var/www/html/config/config.php
23+ sed -i " s|'dbpassword'.*=>.*$|'dbpassword' => '$POSTGRES_PASSWORD ',|" /var/www/html/config/config.php
24+ sed -i " s|'db_name'.*=>.*$|'db_name' => '$POSTGRES_DB ',|" /var/www/html/config/config.php
25+ fi
1626fi
1727
1828# Trust additional Cacerts, if the user provided $TRUSTED_CACERTS_DIR
You can’t perform that action at this time.
0 commit comments