server->id)]; } public function __construct(Server $server) { $this->server = $server; } public function uniqueId(): int { return $this->server->id; } public function handle(): void { try { $container = get_container_status(server: $this->server, all_data: true, container_id: 'coolify-proxy', throwError: true); $status = $container['State']['Status']; if ($this->server->proxy->status !== $status) { $this->server->proxy->status = $status; if ($this->server->proxy->status === 'running') { $traefik = $container['Config']['Labels']['org.opencontainers.image.title']; $version = $container['Config']['Labels']['org.opencontainers.image.version']; if (isset($version) && isset($traefik) && $traefik === 'Traefik' && Str::of($version)->startsWith('v2')) { $this->server->proxy->type = ProxyTypes::TRAEFIK_V2->value; } } $this->server->save(); } } catch (\Exception $e) { if ($e->getCode() === 1) { $this->server->proxy->status = 'exited'; $this->server->save(); } } } }