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,16 +2,21 @@
namespace Tests;
use App\Enums\Database;
use App\Enums\ServiceStatus;
use App\Enums\UserRole;
use App\Enums\Webserver;
use App\Models\NotificationChannel;
use App\Models\Redirect;
use App\Models\Server;
use App\Models\Site;
use App\Models\SourceControl;
use App\Models\User;
use App\NotificationChannels\Email;
use App\Services\Database\Mysql;
use App\Services\Firewall\Ufw;
use App\Services\PHP\PHP;
use App\Services\ProcessManager\Supervisor;
use App\Services\Redis\Redis;
use App\Services\Webserver\Nginx;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Facades\File;
@ -46,7 +51,7 @@ protected function setUp(): void
$this->user->createDefaultProject();
$this->notificationChannel = NotificationChannel::factory()->create([
'provider' => \App\Enums\NotificationChannel::EMAIL,
'provider' => Email::id(),
'connected' => true,
'data' => [
'email' => 'user@example.com',
@ -81,10 +86,35 @@ private function setupServer(): void
$this->server->provider()->generateKeyPair();
}
$this->server->type()->createServices([
'webserver' => Webserver::NGINX,
'database' => Database::MYSQL80,
'php' => '8.2',
$this->server->services()->create([
'type' => Nginx::type(),
'name' => Nginx::id(),
'version' => 'latest',
]);
$this->server->services()->create([
'type' => Mysql::type(),
'name' => Mysql::id(),
'version' => '8.0',
]);
$this->server->services()->create([
'type' => PHP::type(),
'name' => PHP::id(),
'version' => '8.2',
]);
$this->server->services()->create([
'type' => Ufw::type(),
'name' => Ufw::id(),
'version' => 'latest',
]);
$this->server->services()->create([
'type' => Supervisor::type(),
'name' => Supervisor::id(),
'version' => 'latest',
]);
$this->server->services()->create([
'type' => Redis::type(),
'name' => Redis::id(),
'version' => 'latest',
]);
$this->server->services()->update([