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:
Rasel Islam Rafi
2025-05-29 15:25:36 +06:00
committed by GitHub
parent 65898b0ee6
commit 2318e1b1df
24 changed files with 590 additions and 18 deletions

View File

@ -75,6 +75,29 @@ public function test_install_nginx(): void
$this->assertNotNull($service->type_data);
}
public function test_install_caddy(): void
{
$this->server->webserver()->delete();
SSH::fake('Active: active');
$service = app(Install::class)->install($this->server, [
'type' => 'webserver',
'name' => 'caddy',
'version' => 'latest',
]);
$this->assertDatabaseHas('services', [
'server_id' => $this->server->id,
'name' => 'caddy',
'type' => 'webserver',
'version' => 'latest',
'status' => ServiceStatus::READY,
]);
$this->assertNotNull($service->type_data);
}
public function test_install_mysql(): void
{
$this->server->database()->delete();