mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 07:22:34 +00:00
Add Caddy Server Support Alongside Nginx (#600)
* added enum * add config for caddy * add svg icon * add caddy service class * wip * install caddy * create base Caddyfile with common snippets * Create a systemd service to run Caddy in the background. * create uninstall file * wip * create path * create vhost * get vhost * delete site * add php version change file * add custom ssl * create redirect file * add vhost for caddy site & load balancer * update svg * fix caddy icon * fix style * add systemctl reload method * Reload systemd after modifying the Caddy service file. * add caddy * added tests * format with pint * prevent multiple web server installations * added error log & access log
This commit is contained in:
@ -83,6 +83,63 @@ public function test_create_regular_server(): void
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_create_regular_server_with_caddy(): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
|
||||
SSH::fake('Active: active'); // fake output for service installations
|
||||
|
||||
Livewire::test(Index::class)
|
||||
->callAction('create', [
|
||||
'provider' => ServerProvider::CUSTOM,
|
||||
'name' => 'caddy-test',
|
||||
'ip' => '2.2.2.2',
|
||||
'port' => '22',
|
||||
'os' => OperatingSystem::UBUNTU22,
|
||||
'webserver' => Webserver::CADDY,
|
||||
'database' => Database::MYSQL80,
|
||||
'php' => '8.2',
|
||||
])
|
||||
->assertSuccessful();
|
||||
|
||||
$this->assertDatabaseHas('servers', [
|
||||
'name' => 'caddy-test',
|
||||
'ip' => '2.2.2.2',
|
||||
'status' => ServerStatus::READY,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('services', [
|
||||
'server_id' => 2,
|
||||
'type' => 'php',
|
||||
'version' => '8.2',
|
||||
'status' => ServiceStatus::READY,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('services', [
|
||||
'server_id' => 2,
|
||||
'type' => 'webserver',
|
||||
'name' => 'caddy',
|
||||
'version' => 'latest',
|
||||
'status' => ServiceStatus::READY,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('services', [
|
||||
'server_id' => 2,
|
||||
'type' => 'database',
|
||||
'name' => 'mysql',
|
||||
'version' => '8.0',
|
||||
'status' => ServiceStatus::READY,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('services', [
|
||||
'server_id' => 2,
|
||||
'type' => 'firewall',
|
||||
'name' => 'ufw',
|
||||
'version' => 'latest',
|
||||
'status' => ServiceStatus::READY,
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_delete_server(): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
|
Reference in New Issue
Block a user