diff --git a/app/Http/Controllers/Admin/ServersController.php b/app/Http/Controllers/Admin/ServersController.php index 161e8aba6..44eebcccf 100644 --- a/app/Http/Controllers/Admin/ServersController.php +++ b/app/Http/Controllers/Admin/ServersController.php @@ -599,7 +599,7 @@ class ServersController extends Controller ['id', '=', $request->input('database')], ]); - $this->databasePasswordService->handle($database, str_random(20)); + $this->databasePasswordService->handle($database, str_random(24)); return response('', 204); } diff --git a/app/Http/Controllers/Server/DatabaseController.php b/app/Http/Controllers/Server/DatabaseController.php index be7d501ba..7d8e4cda2 100644 --- a/app/Http/Controllers/Server/DatabaseController.php +++ b/app/Http/Controllers/Server/DatabaseController.php @@ -142,7 +142,7 @@ class DatabaseController extends Controller { $this->authorize('reset-db-password', $request->attributes->get('server')); - $password = str_random(20); + $password = str_random(24); $this->passwordService->handle($request->attributes->get('database'), $password); return response()->json(['password' => $password]); diff --git a/app/Services/Databases/DatabaseManagementService.php b/app/Services/Databases/DatabaseManagementService.php index dc91e11f9..d7c942cba 100644 --- a/app/Services/Databases/DatabaseManagementService.php +++ b/app/Services/Databases/DatabaseManagementService.php @@ -69,7 +69,7 @@ class DatabaseManagementService $data['server_id'] = $server; $data['database'] = sprintf('s%d_%s', $server, $data['database']); $data['username'] = sprintf('u%d_%s', $server, str_random(10)); - $data['password'] = $this->encrypter->encrypt(str_random(16)); + $data['password'] = $this->encrypter->encrypt(str_random(24)); $this->database->beginTransaction(); try {