Skip to content

Commit

Permalink
improve comment
Browse files Browse the repository at this point in the history
Signed-off-by: szaimen <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Oct 18, 2022
1 parent f9f64e6 commit a582133
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/private/Setup/PostgreSQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ public function setupDatabase($username) {
$this->dbPassword = \OC::$server->getSecureRandom()->generate(30, ISecureRandom::CHAR_ALPHANUMERIC);

$this->createDBUser($connection);
// Go to main database and grant create on schema public
// This is implemented to make possible work with PostgreSQL version 15:

// Go to the main database and grant create on the public schema
// The code below is implemented to make installing possible with PostgreSQL version 15:
// https://www.postgresql.org/docs/release/15.0/
//
// From release note: For new databases having no need to defend against insider threats, granting CREATE permission will yield the behavior of prior releases.
// From the release notes: For new databases having no need to defend against insider threats, granting CREATE permission will yield the behavior of prior releases
// Therefore we assume that the database is only used by one user/service which is Nextcloud
// Additional services should get installed in a separate database in order to stay secure
// Also see https://www.postgresql.org/docs/15/ddl-schemas.html#DDL-SCHEMAS-PATTERNS
$connectionMainDatabase->executeQuery('GRANT CREATE ON SCHEMA public TO ' . $this->dbUser);
$connectionMainDatabase->close();
}
Expand Down

0 comments on commit a582133

Please sign in to comment.