feat(v5): expose corrosion and firewall diagnostics

This commit is contained in:
Andras Bacsai
2026-06-22 13:52:17 +02:00
parent 4cdd45070d
commit 2007d802ef
9 changed files with 938 additions and 35 deletions
+12 -9
View File
@@ -12,7 +12,7 @@ class StartCaddyIngress
{
use AsAction;
private const FIREWALL_RULE_ID = 'v5-caddy-ingress:80';
private const FIREWALL_PORTS = [80, 443];
public function __construct(private readonly FluxClient $fluxClient) {}
@@ -30,14 +30,17 @@ class StartCaddyIngress
$configuration = GenerateCaddyIngressConfiguration::run($this->applications($server));
$output = $this->fluxClient->applyIngress($hostId, 'caddy', $configuration['caddyfile'], $this->ingressApps($configuration['apps']));
$this->fluxClient->applyFirewallRule($hostId, [
'id' => self::FIREWALL_RULE_ID,
'namespace' => 'default',
'src' => '0.0.0.0/0',
'dst' => 'coolify-v5-caddy',
'proto' => 'tcp',
'port' => 80,
]);
foreach (self::FIREWALL_PORTS as $port) {
$this->fluxClient->applyFirewallRule($hostId, [
'id' => "v5-caddy-ingress:{$port}",
'namespace' => 'default',
'src' => '0.0.0.0/0',
'dst' => 'coolify-v5-caddy',
'proto' => 'tcp',
'port' => $port,
]);
}
if ($server->exists) {
$server->update([
+5 -2
View File
@@ -10,7 +10,7 @@ class StopCaddyIngress
{
use AsAction;
private const FIREWALL_RULE_ID = 'v5-caddy-ingress:80';
private const FIREWALL_PORTS = [80, 443];
public function __construct(private readonly FluxClient $fluxClient) {}
@@ -23,7 +23,10 @@ class StopCaddyIngress
}
$output = $this->fluxClient->stopIngress($hostId, 'caddy');
$this->fluxClient->revokeFirewallRule($hostId, self::FIREWALL_RULE_ID);
foreach (self::FIREWALL_PORTS as $port) {
$this->fluxClient->revokeFirewallRule($hostId, "v5-caddy-ingress:{$port}");
}
if ($server->exists) {
$server->update(['ingress_status' => 'exited']);