mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 07:22:34 +00:00
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:
@ -38,19 +38,4 @@ public function ssh(Server $server): Storage
|
||||
{
|
||||
return new \App\SSH\Storage\Dropbox($server, $this->storageProvider);
|
||||
}
|
||||
|
||||
public function delete(array $paths): void
|
||||
{
|
||||
$data = [];
|
||||
foreach ($paths as $path) {
|
||||
$data[] = ['path' => $path];
|
||||
}
|
||||
Http::withToken($this->storageProvider->credentials['token'])
|
||||
->withHeaders([
|
||||
'Content-Type:application/json',
|
||||
])
|
||||
->post($this->apiUrl.'/files/delete_batch', [
|
||||
'entries' => $data,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -57,23 +57,6 @@ public function ssh(Server $server): Storage
|
||||
return new \App\SSH\Storage\FTP($server, $this->storageProvider);
|
||||
}
|
||||
|
||||
public function delete(array $paths): void
|
||||
{
|
||||
$connection = $this->connection();
|
||||
|
||||
if ($connection && $this->login($connection)) {
|
||||
if ($this->storageProvider->credentials['passive']) {
|
||||
\App\Facades\FTP::passive($connection, true);
|
||||
}
|
||||
|
||||
foreach ($paths as $path) {
|
||||
\App\Facades\FTP::delete($connection, $this->storageProvider->credentials['path'].'/'.$path);
|
||||
}
|
||||
}
|
||||
|
||||
\App\Facades\FTP::close($connection);
|
||||
}
|
||||
|
||||
private function connection(): bool|Connection
|
||||
{
|
||||
$credentials = $this->storageProvider->credentials;
|
||||
|
@ -30,9 +30,4 @@ public function ssh(Server $server): Storage
|
||||
{
|
||||
return new \App\SSH\Storage\Local($server, $this->storageProvider);
|
||||
}
|
||||
|
||||
public function delete(array $paths): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
@ -95,6 +95,4 @@ public function ssh(Server $server): Storage
|
||||
{
|
||||
return new S3Storage($server, $this->storageProvider);
|
||||
}
|
||||
|
||||
public function delete(array $paths): void {}
|
||||
}
|
||||
|
@ -14,6 +14,4 @@ public function credentialData(array $input): array;
|
||||
public function connect(): bool;
|
||||
|
||||
public function ssh(Server $server): Storage;
|
||||
|
||||
public function delete(array $paths): void;
|
||||
}
|
||||
|
Reference in New Issue
Block a user