An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: proxy fixes
Andras Bacsaidedf2cf87b7c
diff --git a/app/Actions/Docker/GetContainersStatus.php b/app/Actions/Docker/GetContainersStatus.phpindex 0779da31de..ed563eaae9 100644--- a/app/Actions/Docker/GetContainersStatus.php+++ b/app/Actions/Docker/GetContainersStatus.php@@ -651,8 +651,9 @@ class GetContainersStatus// $this->server->team?->notify(new ContainerStopped($containerName, $this->server, $url));}- // Check if proxy is running- $this->server->proxyType();+ if (! $this->server->proxySet() || $this->server->proxy->force_stop) {+ return;+ }$foundProxyContainer = $this->containers->filter(function ($value, $key) {if ($this->server->isSwarm()) {return data_get($value, 'Spec.Name') === 'coolify-proxy_traefik';diff --git a/app/Actions/Proxy/StartProxy.php b/app/Actions/Proxy/StartProxy.phpindex 8cb3c644e1..4ef9618d0c 100644--- a/app/Actions/Proxy/StartProxy.php+++ b/app/Actions/Proxy/StartProxy.php@@ -35,7 +35,7 @@ class StartProxy"echo 'Creating required Docker Compose file.'","echo 'Starting coolify-proxy.'",'docker stack deploy -c docker-compose.yml coolify-proxy',- "echo 'Proxy started successfully.'",+ "echo 'Successfully started coolify-proxy.'",]);} else {$caddfile = 'import /dynamic/*.caddy';@@ -53,7 +53,7 @@ class StartProxy'fi',"echo 'Starting coolify-proxy.'",'docker compose up -d --remove-orphans',- "echo 'Proxy started successfully.'",+ "echo 'Successfully started coolify-proxy.'",]);$commands = $commands->merge(connectProxyToNetworks($server));}diff --git a/app/Jobs/ServerCheckJob.php b/app/Jobs/ServerCheckJob.phpindex 7fde44f499..39d4aa0c02 100644--- a/app/Jobs/ServerCheckJob.php+++ b/app/Jobs/ServerCheckJob.php@@ -69,7 +69,9 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueuereturn 'No containers found.';}GetContainersStatus::run($this->server, $this->containers, $containerReplicates);- $this->checkLogDrainContainer();+ if ($this->server->isLogDrainEnabled()) {+ $this->checkLogDrainContainer();+ }}} catch (\Throwable $e) {@@ -115,9 +117,6 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueueprivate function checkLogDrainContainer(){- if (! $this->server->isLogDrainEnabled()) {- return;- }$foundLogDrainContainer = $this->containers->filter(function ($value, $key) {return data_get($value, 'Name') === '/coolify-log-drain';})->first();diff --git a/app/Livewire/Server/Proxy/Status.php b/app/Livewire/Server/Proxy/Status.phpindex d23d7fc20e..20db4dad4f 100644--- a/app/Livewire/Server/Proxy/Status.php+++ b/app/Livewire/Server/Proxy/Status.php@@ -49,6 +49,10 @@ class Status extends Componentif ($this->server->proxy->status === 'running') {$this->polling = false;$notification && $this->dispatch('success', 'Proxy is running.');+ } elseif ($this->server->proxy->status === 'exited' and ! $this->server->proxy->force_stop) {+ $notification && $this->dispatch('error', 'Proxy has exited.');+ } elseif ($this->server->proxy->force_stop) {+ $notification && $this->dispatch('error', 'Proxy is stopped manually.');} else {$notification && $this->dispatch('error', 'Proxy is not running.');}diff --git a/bootstrap/helpers/proxy.php b/bootstrap/helpers/proxy.phpindex c4c15b8fe4..e90d54a78b 100644--- a/bootstrap/helpers/proxy.php+++ b/bootstrap/helpers/proxy.php@@ -96,6 +96,8 @@ function connectProxyToNetworks(Server $server)"echo 'Connecting coolify-proxy to $network network...'","docker network ls --format '{{.Name}}' | grep '^$network$' >/dev/null || docker network create --driver overlay --attachable $network >/dev/null","docker network connect $network coolify-proxy >/dev/null 2>&1 || true",+ "echo 'Successfully connected coolify-proxy to $network network.'",+ "echo 'Proxy started and configured successfully!'",];});} else {@@ -104,6 +106,8 @@ function connectProxyToNetworks(Server $server)"echo 'Connecting coolify-proxy to $network network...'","docker network ls --format '{{.Name}}' | grep '^$network$' >/dev/null || docker network create --attachable $network >/dev/null","docker network connect $network coolify-proxy >/dev/null 2>&1 || true",+ "echo 'Successfully connected coolify-proxy to $network network.'",+ "echo 'Proxy started and configured successfully!'",];});}@@ -217,7 +221,6 @@ function generate_default_proxy_configuration(Server $server)}} elseif ($proxy_type === 'CADDY') {$config = [- 'version' => '3.8','networks' => $array_of_networks->toArray(),'services' => ['caddy' => [@@ -236,12 +239,9 @@ function generate_default_proxy_configuration(Server $server)'80:80','443:443',],- // "healthcheck" => [- // "test" => "wget -qO- http://localhost:80|| exit 1",- // "interval" => "4s",- // "timeout" => "2s",- // "retries" => 5,- // ],+ 'labels' => [+ 'coolify.managed=true',+ ],'volumes' => ['/var/run/docker.sock:/var/run/docker.sock:ro',"{$proxy_path}/dynamic:/dynamic",diff --git a/resources/views/livewire/server/proxy/status.blade.php b/resources/views/livewire/server/proxy/status.blade.phpindex 2a2dd3be99..621e0bc8cd 100644--- a/resources/views/livewire/server/proxy/status.blade.php+++ b/resources/views/livewire/server/proxy/status.blade.php@@ -3,10 +3,12 @@<x-status.running status="Proxy Running" />@elseif (data_get($server, 'proxy.status') === 'restarting')<x-status.restarting status="Proxy Restarting" />- @else+ @elseif (data_get($server, 'proxy.force_stop'))<x-status.stopped status="Proxy Stopped" />+ @elseif (data_get($server, 'proxy.status') === 'exited')+ <x-status.stopped status="Proxy Exited" />+ @else+ <x-status.stopped status="Proxy Not Running" />@endif- @if (data_get($server, 'proxy.status') === 'running')- <x-forms.button wire:click='checkProxy(true)'>Refresh</x-forms.button>- @endif+ <x-forms.button wire:click='checkProxy(true)'>Refresh</x-forms.button></div>