mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
* 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>
65 lines
2.3 KiB
PHP
65 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\SSH\Storage;
|
|
|
|
use App\SSH\HasScripts;
|
|
|
|
class FTP extends AbstractStorage
|
|
{
|
|
use HasScripts;
|
|
|
|
public function upload(string $src, string $dest): array
|
|
{
|
|
$this->server->ssh()->exec(
|
|
$this->getScript('ftp/upload.sh', [
|
|
'src' => $src,
|
|
'dest' => $dest,
|
|
'host' => $this->storageProvider->credentials['host'],
|
|
'port' => $this->storageProvider->credentials['port'],
|
|
'username' => $this->storageProvider->credentials['username'],
|
|
'password' => $this->storageProvider->credentials['password'],
|
|
'ssl' => $this->storageProvider->credentials['ssl'],
|
|
'passive' => $this->storageProvider->credentials['passive'],
|
|
]),
|
|
'upload-to-ftp'
|
|
);
|
|
|
|
return [
|
|
'size' => null,
|
|
];
|
|
}
|
|
|
|
public function download(string $src, string $dest): void
|
|
{
|
|
$this->server->ssh()->exec(
|
|
$this->getScript('ftp/download.sh', [
|
|
'src' => $src,
|
|
'dest' => $dest,
|
|
'host' => $this->storageProvider->credentials['host'],
|
|
'port' => $this->storageProvider->credentials['port'],
|
|
'username' => $this->storageProvider->credentials['username'],
|
|
'password' => $this->storageProvider->credentials['password'],
|
|
'ssl' => $this->storageProvider->credentials['ssl'],
|
|
'passive' => $this->storageProvider->credentials['passive'],
|
|
]),
|
|
'download-from-ftp'
|
|
);
|
|
}
|
|
|
|
public function delete(string $src): void
|
|
{
|
|
$this->server->ssh()->exec(
|
|
$this->getScript('ftp/delete-file.sh', [
|
|
'src' => $src,
|
|
'host' => $this->storageProvider->credentials['host'],
|
|
'port' => $this->storageProvider->credentials['port'],
|
|
'username' => $this->storageProvider->credentials['username'],
|
|
'password' => $this->storageProvider->credentials['password'],
|
|
'ssl' => $this->storageProvider->credentials['ssl'],
|
|
'passive' => $this->storageProvider->credentials['passive'],
|
|
]),
|
|
'delete-from-ftp'
|
|
);
|
|
}
|
|
}
|