Skip to content

Commit 70c0b60

Browse files
refactor(setup): Use shared generateDbPassword() in PostgreSQL setup
Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent 08fc972 commit 70c0b60

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/private/Setup/PostgreSQL.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
use OC\DatabaseSetupException;
1212
use OC\DB\Connection;
1313
use OC\DB\QueryBuilder\Literal;
14-
use OCP\Security\ISecureRandom;
15-
use OCP\Server;
1614

1715
class PostgreSQL extends AbstractDatabase {
1816
public $dbprettyname = 'PostgreSQL';
@@ -48,8 +46,9 @@ public function setupDatabase(): void {
4846

4947
//add prefix to the postgresql user name to prevent collisions
5048
$this->dbUser = 'oc_admin';
51-
//create a new password so we don't need to store the admin config in the config file
52-
$this->dbPassword = Server::get(ISecureRandom::class)->generate(30, ISecureRandom::CHAR_ALPHANUMERIC);
49+
50+
// Create a new password so we don't need to store the admin config in the config file
51+
$this->dbPassword = $this->generateDbPassword();
5352

5453
$this->createDBUser($connection);
5554
}

0 commit comments

Comments
 (0)