Plugins base (#613)

* wip

* wip

* cleanup

* notification channels

* phpstan

* services

* remove server types

* refactoring

* refactoring
This commit is contained in:
Saeed Vaziry
2025-06-14 14:35:18 +02:00
committed by GitHub
parent adc0653d15
commit 131b828807
311 changed files with 3976 additions and 2660 deletions

View File

@ -2,20 +2,18 @@
namespace Tests\Traits;
use App\Enums\Database;
use App\Enums\LoadBalancerMethod;
use App\Enums\PHP;
use App\Enums\ServiceStatus;
use App\Enums\SiteType;
use App\Enums\Webserver;
use App\Models\Server;
use App\Models\Site;
use App\SiteTypes\LoadBalancer;
use App\SiteTypes\PHPBlank;
trait PrepareLoadBalancer
{
private function prepare(): void
{
$this->site->type = SiteType::LOAD_BALANCER;
$this->site->type = LoadBalancer::id();
$this->site->type_data = [
'method' => LoadBalancerMethod::ROUND_ROBIN,
];
@ -26,11 +24,6 @@ private function prepare(): void
'project_id' => $this->user->current_project_id,
]);
foreach ($servers as $server) {
$server->type()->createServices([
'webserver' => Webserver::NGINX,
'database' => Database::NONE,
'php' => PHP::NONE,
]);
$server->services()->update([
'status' => ServiceStatus::READY,
]);
@ -38,7 +31,7 @@ private function prepare(): void
'domain' => 'vito.test',
'aliases' => ['www.vito.test'],
'server_id' => $server->id,
'type' => SiteType::PHP_BLANK,
'type' => PHPBlank::id(),
'path' => '/home/vito/vito.test',
'web_directory' => '',
]);