From 268dcc9d043b3414dd1dc4dc673a5b2b4b81a9c8 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Mon, 2 Feb 2026 22:33:26 +0100 Subject: [PATCH] feat(backup): remove overcomplicated backup settings - remove databasesToBackup and dumpAll settings --- app/Livewire/Project/Database/BackupEdit.php | 29 ---------------- .../Database/CreateScheduledBackup.php | 8 ----- .../project/database/backup-edit.blade.php | 34 ------------------- 3 files changed, 71 deletions(-) diff --git a/app/Livewire/Project/Database/BackupEdit.php b/app/Livewire/Project/Database/BackupEdit.php index 35262d7b0..dfd32f2cf 100644 --- a/app/Livewire/Project/Database/BackupEdit.php +++ b/app/Livewire/Project/Database/BackupEdit.php @@ -69,12 +69,6 @@ class BackupEdit extends Component #[Validate(['nullable', 'integer'])] public ?int $s3StorageId = 1; - #[Validate(['nullable', 'string'])] - public ?string $databasesToBackup = null; - - #[Validate(['required', 'boolean'])] - public bool $dumpAll = false; - #[Validate(['required', 'int', 'min:60', 'max:36000'])] public int $timeout = 3600; @@ -103,27 +97,6 @@ class BackupEdit extends Component $this->backup->save_s3 = $this->saveS3; $this->backup->disable_local_backup = $this->disableLocalBackup; $this->backup->s3_storage_id = $this->s3StorageId; - - // Validate databases_to_backup to prevent command injection - if (filled($this->databasesToBackup)) { - $databases = str($this->databasesToBackup)->explode(','); - foreach ($databases as $index => $db) { - $dbName = trim($db); - try { - validateShellSafePath($dbName, 'database name'); - } catch (\Exception $e) { - // Provide specific error message indicating which database failed validation - $position = $index + 1; - throw new \Exception( - "Database #{$position} ('{$dbName}') validation failed: ". - $e->getMessage() - ); - } - } - } - - $this->backup->databases_to_backup = $this->databasesToBackup; - $this->backup->dump_all = $this->dumpAll; $this->backup->timeout = $this->timeout; $this->customValidate(); $this->backup->save(); @@ -140,8 +113,6 @@ class BackupEdit extends Component $this->saveS3 = $this->backup->save_s3; $this->disableLocalBackup = $this->backup->disable_local_backup ?? false; $this->s3StorageId = $this->backup->s3_storage_id; - $this->databasesToBackup = $this->backup->databases_to_backup; - $this->dumpAll = $this->backup->dump_all; $this->timeout = $this->backup->timeout; } } diff --git a/app/Livewire/Project/Database/CreateScheduledBackup.php b/app/Livewire/Project/Database/CreateScheduledBackup.php index 7f807afe2..238e51ecd 100644 --- a/app/Livewire/Project/Database/CreateScheduledBackup.php +++ b/app/Livewire/Project/Database/CreateScheduledBackup.php @@ -65,14 +65,6 @@ class CreateScheduledBackup extends Component 'team_id' => currentTeam()->id, ]; - if ($this->database->type() === 'standalone-postgresql') { - $payload['databases_to_backup'] = $this->database->postgres_db; - } elseif ($this->database->type() === 'standalone-mysql') { - $payload['databases_to_backup'] = $this->database->mysql_database; - } elseif ($this->database->type() === 'standalone-mariadb') { - $payload['databases_to_backup'] = $this->database->mariadb_database; - } - $databaseBackup = ScheduledDatabaseBackup::create($payload); if ($this->database->getMorphClass() === \App\Models\ServiceDatabase::class) { $this->dispatch('refreshScheduledBackups', $databaseBackup->id); diff --git a/resources/views/livewire/project/database/backup-edit.blade.php b/resources/views/livewire/project/database/backup-edit.blade.php index bb5dcfc4d..4afb116f2 100644 --- a/resources/views/livewire/project/database/backup-edit.blade.php +++ b/resources/views/livewire/project/database/backup-edit.blade.php @@ -46,40 +46,6 @@ @endif