From 71cd5d08528488b1092f224f792b04fe546f1e27 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:14:46 -0600 Subject: [PATCH] Update nextcloud-install.sh --- nextcloud/nextcloud-install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nextcloud/nextcloud-install.sh b/nextcloud/nextcloud-install.sh index 60867a1..d8cf394 100644 --- a/nextcloud/nextcloud-install.sh +++ b/nextcloud/nextcloud-install.sh @@ -229,13 +229,14 @@ else /usr/local/etc/rc.d/postgresql initdb su -m postgres -c '/usr/local/bin/pg_ctl -D /var/db/postgres/data'${PG_VERSION}' start' sed -i '' "s|mypassword|${DB_ROOT_PASSWORD}|" /root/.pgpass - if ! psql -U postgres -c "CREATE DATABASE ${DB_NAME};" + if ! psql -U postgres -c "CREATE DATABASE ${DB_NAME} TEMPLATE template0 ENCODING 'UTF8';" then echo "Failed to create ${APP_NAME} database, aborting" exit 1 fi - psql -U postgres -c "CREATE USER '${DB_USER}' WITH ENCRYPTED PASSWORD '${DB_PASSWORD}';" - psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE '${DB_NAME}' TO '${DB_USER}';" + psql -U postgres -c "CREATE USER ${DB_USER} WITH ENCRYPTED PASSWORD '${DB_PASSWORD}';" + psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE ${DB_NAME} TO ${DB_USER};" + psql -U postgres -c "GRANT ALL PRIVILEGES ON SCHEMA public TO ${DB_USER};" psql -U postgres -c "SELECT pg_reload_conf();" fi