feat(v5): sync server status and ingress access

Add Flux agent token issuing, open and revoke Caddy ingress firewall
rules, broadcast server-scoped application status updates, and update
the dashboard to show unreachable servers as unknown.
This commit is contained in:
Andras Bacsai committed 2026-06-22 11:56:26 +02:00
1 parent 75cbcad240
commit e3e91b7741
14 files changed
+557 -47

No files matched your search

@@ -12,6 +12,8 @@ class StartCaddyIngress
{
use AsAction;
private const FIREWALL_RULE_ID = 'v5-caddy-ingress:80';
public function __construct(private readonly FluxClient $fluxClient) {}
public function handle(Server $server): string
@@ -28,6 +30,14 @@ 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,
]);
if ($server->exists) {
$server->update([
@@ -10,6 +10,8 @@ class StopCaddyIngress
{
use AsAction;
private const FIREWALL_RULE_ID = 'v5-caddy-ingress:80';
public function __construct(private readonly FluxClient $fluxClient) {}
public function handle(Server $server): string
@@ -21,6 +23,7 @@ class StopCaddyIngress
}
$output = $this->fluxClient->stopIngress($hostId, 'caddy');
$this->fluxClient->revokeFirewallRule($hostId, self::FIREWALL_RULE_ID);
if ($server->exists) {
$server->update(['ingress_status' => 'exited']);