From 29e338ac01b970416074699e6e0271aa3ca87fcf Mon Sep 17 00:00:00 2001 From: szaimen Date: Tue, 18 Oct 2022 23:20:29 +0200 Subject: [PATCH 1/2] rework postgresql docs Signed-off-by: szaimen --- .../linux_database_configuration.rst | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/admin_manual/configuration_database/linux_database_configuration.rst b/admin_manual/configuration_database/linux_database_configuration.rst index 9ac1a1181..2aa3e6055 100644 --- a/admin_manual/configuration_database/linux_database_configuration.rst +++ b/admin_manual/configuration_database/linux_database_configuration.rst @@ -182,6 +182,11 @@ Adjust the paths to the pem files for your environment. PostgreSQL database ^^^^^^^^^^^^^^^^^^^ +In order to run Nextcloud securely on PostgreSQL, it is assumed that only +Nextcloud uses this database and thus only one user accesses the database. +For further services and users, please create a separate database. +(Install a separate PostgreSQL instance.) + If you decide to use a PostgreSQL database make sure that you have installed and enabled the PostgreSQL extension in PHP. The PHP configuration in :file:`/etc/php7/conf.d/pgsql.ini` could look like this: @@ -210,7 +215,8 @@ Then a **template1=#** prompt will appear. Now enter the following lines and con :: CREATE USER username CREATEDB; - CREATE DATABASE nextcloud OWNER username; + CREATE DATABASE nextcloud OWNER username TEMPLATE template0 ENCODING 'UTF8'; + GRANT CREATE ON SCHEMA public TO username; You can quit the prompt by entering:: @@ -248,10 +254,11 @@ Then a **postgres=#** prompt will appear. Now enter the following lines and conf :: - CREATE USER username WITH PASSWORD 'password'; - CREATE DATABASE nextcloud TEMPLATE template0 ENCODING 'UNICODE'; + CREATE USER username WITH PASSWORD 'password' CREATEDB; + CREATE DATABASE nextcloud TEMPLATE template0 ENCODING 'UTF8'; ALTER DATABASE nextcloud OWNER TO username; GRANT ALL PRIVILEGES ON DATABASE nextcloud TO username; + GRANT ALL PRIVILEGES ON SCHEMA public TO username; You can quit the prompt by entering:: From 976f2c01e0757c180d3bd3839f3508c38640439a Mon Sep 17 00:00:00 2001 From: Simon L Date: Thu, 27 Oct 2022 13:06:42 +0200 Subject: [PATCH 2/2] address review Co-authored-by: Vitor Mattos Signed-off-by: Simon L. --- .../configuration_database/linux_database_configuration.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin_manual/configuration_database/linux_database_configuration.rst b/admin_manual/configuration_database/linux_database_configuration.rst index 2aa3e6055..0d77289d9 100644 --- a/admin_manual/configuration_database/linux_database_configuration.rst +++ b/admin_manual/configuration_database/linux_database_configuration.rst @@ -184,8 +184,8 @@ PostgreSQL database In order to run Nextcloud securely on PostgreSQL, it is assumed that only Nextcloud uses this database and thus only one user accesses the database. -For further services and users, please create a separate database. -(Install a separate PostgreSQL instance.) +For further services and users, we recommend to create a separate +database or PostgreSQL instance. If you decide to use a PostgreSQL database make sure that you have installed and enabled the PostgreSQL extension in PHP. The PHP configuration in :file:`/etc/php7/conf.d/pgsql.ini` could look