Edit & Download (local) Backups (#436)

* Allow editing of backups

* pint updates

* setup of backup download

* allow download for local backup files

* delete uploaded files on delete of BackupFile

* pint updates

* S3 upload & download fixes

* Deletion of backup files

* support $ARCH selector for s3 installation

* delete files when deleting backup

* fixed ui issue

* adjustment

* Use system temp path for downloads

---------

Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
This commit is contained in:
Richard Anderson
2025-01-25 20:59:35 +00:00
committed by GitHub
parent 465951fd1e
commit a73476c1dd
31 changed files with 382 additions and 184 deletions

View File

@ -115,6 +115,43 @@ public function test_see_backups_list(): void
->assertSee($backup->database->name);
}
public function test_update_backup(): void
{
$this->actingAs($this->user);
$database = Database::factory()->create([
'server_id' => $this->server,
]);
$storage = StorageProvider::factory()->create([
'user_id' => $this->user->id,
'provider' => \App\Enums\StorageProvider::DROPBOX,
]);
$backup = Backup::factory()->create([
'server_id' => $this->server->id,
'database_id' => $database->id,
'storage_id' => $storage->id,
'interval' => '0 * * * *',
'keep_backups' => 5,
]);
Livewire::test(BackupsList::class, [
'server' => $this->server,
])
->callTableAction('edit', $backup->id, [
'interval' => '0 0 * * *',
'keep' => '10',
])
->assertSuccessful();
$this->assertDatabaseHas('backups', [
'id' => $backup->id,
'interval' => '0 0 * * *',
'keep_backups' => 10,
]);
}
public function test_delete_backup(): void
{
$this->actingAs($this->user);