feat: restart database
feat: public dbs stay public after restart feat: patch database conf
This commit is contained in:
@@ -151,6 +151,14 @@ function validateIncomingRequest(Request $request)
|
||||
'error' => 'Invalid JSON.',
|
||||
], 400);
|
||||
}
|
||||
// check if valid json is empty
|
||||
if (empty($request->json()->all())) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Invalid request.',
|
||||
'error' => 'Empty JSON.',
|
||||
], 400);
|
||||
}
|
||||
}
|
||||
|
||||
function removeUnnecessaryFieldsFromRequest(Request $request)
|
||||
|
||||
@@ -178,9 +178,6 @@ function create_standalone_clickhouse($environment_id, $destination_uuid, ?array
|
||||
return $database;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete file locally on the filesystem.
|
||||
*/
|
||||
function delete_backup_locally(?string $filename, Server $server): void
|
||||
{
|
||||
if (empty($filename)) {
|
||||
@@ -188,3 +185,17 @@ function delete_backup_locally(?string $filename, Server $server): void
|
||||
}
|
||||
instant_remote_process(["rm -f \"{$filename}\""], $server, throwError: false);
|
||||
}
|
||||
|
||||
function isPublicPortAlreadyUsed(Server $server, int $port, ?string $id = null): bool
|
||||
{
|
||||
if ($id) {
|
||||
$foundDatabase = $server->databases()->where('public_port', $port)->where('is_public', true)->where('id', '!=', $id)->first();
|
||||
} else {
|
||||
$foundDatabase = $server->databases()->where('public_port', $port)->where('is_public', true)->first();
|
||||
}
|
||||
if ($foundDatabase) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user