mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-01-09 15:07:36 +08:00
Revert "https://github.com/nextcloud/all-in-one/pull/3021" partially
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
bc4bdfdc99
commit
369226f9df
3 changed files with 14 additions and 8 deletions
|
@ -1,7 +0,0 @@
|
|||
<?php
|
||||
$CONFIG = array (
|
||||
'dbuser' => 'oc_' . getenv('POSTGRES_USER'),
|
||||
'dbpassword' => getenv('POSTGRES_PASSWORD'),
|
||||
'db_name' => getenv('POSTGRES_DB'),
|
||||
'dbpersistent' => true,
|
||||
);
|
|
@ -482,6 +482,9 @@ php /var/www/html/occ config:system:set overwrite.cli.url --value="https://$NC_D
|
|||
php /var/www/html/occ config:system:set htaccess.RewriteBase --value="/"
|
||||
php /var/www/html/occ maintenance:update:htaccess
|
||||
|
||||
# Apply dbpersistent setting in order to fix too many db connections
|
||||
php /var/www/html/occ config:system:set dbpersistent --value=true --type=bool
|
||||
|
||||
# Disallow creating local external storages when nothing was mounted
|
||||
if [ -z "$NEXTCLOUD_MOUNT" ]; then
|
||||
php /var/www/html/occ config:system:set files_external_allow_create_new_local --type=bool --value=false
|
||||
|
|
|
@ -6,13 +6,23 @@ while ! sudo -u www-data nc -z "$POSTGRES_HOST" 5432; do
|
|||
sleep 5
|
||||
done
|
||||
|
||||
# Wait for database to actually start
|
||||
# Use the correct Postgres username
|
||||
POSTGRES_USER="oc_$POSTGRES_USER"
|
||||
export POSTGRES_USER
|
||||
|
||||
# Fix false database connection on old instances
|
||||
if [ -f "/var/www/html/config/config.php" ]; then
|
||||
sleep 2
|
||||
while ! sudo -u www-data psql -d "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/$POSTGRES_DB" -c "select now()"; do
|
||||
echo "Waiting for the database to start..."
|
||||
sleep 5
|
||||
done
|
||||
if [ "$POSTGRES_USER" = "oc_nextcloud" ] && [ "$POSTGRES_DB" = "nextcloud_database" ] && echo "$POSTGRES_PASSWORD" | grep -q '^[a-z0-9]\+$'; then
|
||||
# This was introduced with https://github.com/nextcloud/all-in-one/pull/218
|
||||
sed -i "s|'dbuser'.*=>.*$|'dbuser' => '$POSTGRES_USER',|" /var/www/html/config/config.php
|
||||
sed -i "s|'dbpassword'.*=>.*$|'dbpassword' => '$POSTGRES_PASSWORD',|" /var/www/html/config/config.php
|
||||
sed -i "s|'db_name'.*=>.*$|'db_name' => '$POSTGRES_DB',|" /var/www/html/config/config.php
|
||||
fi
|
||||
fi
|
||||
|
||||
# Trust additional Cacerts, if the user provided $TRUSTED_CACERTS_DIR
|
||||
|
|
Loading…
Reference in a new issue