mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
init
This commit is contained in:
24
app/Contracts/Database.php
Executable file
24
app/Contracts/Database.php
Executable file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
use App\Models\BackupFile;
|
||||
|
||||
interface Database
|
||||
{
|
||||
public function create(string $name): void;
|
||||
|
||||
public function delete(string $name): void;
|
||||
|
||||
public function createUser(string $username, string $password, string $host): void;
|
||||
|
||||
public function deleteUser(string $username, string $host): void;
|
||||
|
||||
public function link(string $username, string $host, array $databases): void;
|
||||
|
||||
public function unlink(string $username, string $host): void;
|
||||
|
||||
public function runBackup(BackupFile $backupFile): void;
|
||||
|
||||
public function restoreBackup(BackupFile $backupFile, string $database): void;
|
||||
}
|
10
app/Contracts/Firewall.php
Executable file
10
app/Contracts/Firewall.php
Executable file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
interface Firewall
|
||||
{
|
||||
public function addRule(string $type, string $protocol, int $port, string $source, string $mask): void;
|
||||
|
||||
public function removeRule(string $type, string $protocol, int $port, string $source, string $mask): void;
|
||||
}
|
10
app/Contracts/Notification.php
Normal file
10
app/Contracts/Notification.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
interface Notification
|
||||
{
|
||||
public function subject(): string;
|
||||
|
||||
public function message(bool $mail = false): mixed;
|
||||
}
|
14
app/Contracts/NotificationChannel.php
Normal file
14
app/Contracts/NotificationChannel.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
interface NotificationChannel
|
||||
{
|
||||
public function validationRules(): array;
|
||||
|
||||
public function data(array $input): array;
|
||||
|
||||
public function connect(): bool;
|
||||
|
||||
public function sendMessage(string $subject, string $text): void;
|
||||
}
|
27
app/Contracts/ProcessManager.php
Executable file
27
app/Contracts/ProcessManager.php
Executable file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
interface ProcessManager
|
||||
{
|
||||
public function create(
|
||||
int $id,
|
||||
string $command,
|
||||
string $user,
|
||||
bool $autoStart,
|
||||
bool $autoRestart,
|
||||
int $numprocs,
|
||||
string $logFile,
|
||||
?int $siteId = null
|
||||
): void;
|
||||
|
||||
public function delete(int $id, int $siteId = null): void;
|
||||
|
||||
public function restart(int $id, int $siteId = null): void;
|
||||
|
||||
public function stop(int $id, int $siteId = null): void;
|
||||
|
||||
public function start(int $id, int $siteId = null): void;
|
||||
|
||||
public function getLogs(string $logPath): string;
|
||||
}
|
10
app/Contracts/SSHCommand.php
Executable file
10
app/Contracts/SSHCommand.php
Executable file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
interface SSHCommand
|
||||
{
|
||||
public function file(string $os): string;
|
||||
|
||||
public function content(string $os): string;
|
||||
}
|
26
app/Contracts/ServerProvider.php
Executable file
26
app/Contracts/ServerProvider.php
Executable file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
interface ServerProvider
|
||||
{
|
||||
public function createValidationRules(array $input): array;
|
||||
|
||||
public function credentialValidationRules(array $input): array;
|
||||
|
||||
public function credentialData(array $input): array;
|
||||
|
||||
public function data(array $input): array;
|
||||
|
||||
public function connect(array $credentials = null): bool;
|
||||
|
||||
public function plans(): array;
|
||||
|
||||
public function regions(): array;
|
||||
|
||||
public function create(): void;
|
||||
|
||||
public function isRunning(): bool;
|
||||
|
||||
public function delete(): void;
|
||||
}
|
14
app/Contracts/ServerType.php
Executable file
14
app/Contracts/ServerType.php
Executable file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
interface ServerType
|
||||
{
|
||||
public function createValidationRules(array $input): array;
|
||||
|
||||
public function data(array $input): array;
|
||||
|
||||
public function createServices(array $input): void;
|
||||
|
||||
public function install(): void;
|
||||
}
|
22
app/Contracts/SiteType.php
Executable file
22
app/Contracts/SiteType.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
interface SiteType
|
||||
{
|
||||
public function language(): string;
|
||||
|
||||
public function createValidationRules(array $input): array;
|
||||
|
||||
public function createFields(array $input): array;
|
||||
|
||||
public function data(array $input): array;
|
||||
|
||||
public function install(): void;
|
||||
|
||||
public function delete(): void;
|
||||
|
||||
public function editValidationRules(array $input): array;
|
||||
|
||||
public function edit(): void;
|
||||
}
|
18
app/Contracts/SourceControlProvider.php
Executable file
18
app/Contracts/SourceControlProvider.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
interface SourceControlProvider
|
||||
{
|
||||
public function connect(): bool;
|
||||
|
||||
public function getRepo(string $repo = null): mixed;
|
||||
|
||||
public function fullRepoUrl(string $repo): string;
|
||||
|
||||
public function deployHook(string $repo, array $events, string $secret): array;
|
||||
|
||||
public function destroyHook(string $repo, string $hookId): void;
|
||||
|
||||
public function getLastCommit(string $repo, string $branch): ?array;
|
||||
}
|
17
app/Contracts/StorageProvider.php
Normal file
17
app/Contracts/StorageProvider.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
use App\Models\Server;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
|
||||
interface StorageProvider
|
||||
{
|
||||
public function connect(): RedirectResponse;
|
||||
|
||||
public function upload(Server $server, string $src, string $dest): array;
|
||||
|
||||
public function download(Server $server, string $src, string $dest): void;
|
||||
|
||||
public function delete(array $paths): void;
|
||||
}
|
23
app/Contracts/Webserver.php
Executable file
23
app/Contracts/Webserver.php
Executable file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
use App\Models\Site;
|
||||
use App\Models\Ssl;
|
||||
|
||||
interface Webserver
|
||||
{
|
||||
public function createVHost(Site $site): void;
|
||||
|
||||
public function updateVHost(Site $site): void;
|
||||
|
||||
public function deleteSite(Site $site): void;
|
||||
|
||||
public function changePHPVersion(Site $site, string $version): void;
|
||||
|
||||
public function setupSSL(Ssl $ssl): void;
|
||||
|
||||
public function removeSSL(Ssl $ssl): void;
|
||||
|
||||
public function updateRedirects(Site $site, array $redirects): void;
|
||||
}
|
Reference in New Issue
Block a user