From 15526b6fed5525f4216b3ede7d6d9954cc0065b1 Mon Sep 17 00:00:00 2001 From: Simon L Date: Mon, 14 Nov 2022 17:31:45 +0100 Subject: [PATCH] re-add the password change Signed-off-by: Simon L --- Containers/nextcloud/start.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Containers/nextcloud/start.sh b/Containers/nextcloud/start.sh index 48cb2cd9..7b9d3d2c 100644 --- a/Containers/nextcloud/start.sh +++ b/Containers/nextcloud/start.sh @@ -17,9 +17,11 @@ if [ -f "/var/www/html/config/config.php" ]; then echo "Waiting for the database to start..." sleep 5 done - # The code below is hopefully not needed anymore. 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 + if [ "$POSTGRES_USER" = "oc_nextcloud" ] && 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 + fi fi # Trust additional Cacerts, if the user provided $TRUSTED_CACERTS_DIR