fix: proxy fixes
This commit is contained in:
@@ -651,8 +651,9 @@ class GetContainersStatus
|
|||||||
// $this->server->team?->notify(new ContainerStopped($containerName, $this->server, $url));
|
// $this->server->team?->notify(new ContainerStopped($containerName, $this->server, $url));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if proxy is running
|
if (! $this->server->proxySet() || $this->server->proxy->force_stop) {
|
||||||
$this->server->proxyType();
|
return;
|
||||||
|
}
|
||||||
$foundProxyContainer = $this->containers->filter(function ($value, $key) {
|
$foundProxyContainer = $this->containers->filter(function ($value, $key) {
|
||||||
if ($this->server->isSwarm()) {
|
if ($this->server->isSwarm()) {
|
||||||
return data_get($value, 'Spec.Name') === 'coolify-proxy_traefik';
|
return data_get($value, 'Spec.Name') === 'coolify-proxy_traefik';
|
||||||
|
@@ -35,7 +35,7 @@ class StartProxy
|
|||||||
"echo 'Creating required Docker Compose file.'",
|
"echo 'Creating required Docker Compose file.'",
|
||||||
"echo 'Starting coolify-proxy.'",
|
"echo 'Starting coolify-proxy.'",
|
||||||
'docker stack deploy -c docker-compose.yml coolify-proxy',
|
'docker stack deploy -c docker-compose.yml coolify-proxy',
|
||||||
"echo 'Proxy started successfully.'",
|
"echo 'Successfully started coolify-proxy.'",
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
$caddfile = 'import /dynamic/*.caddy';
|
$caddfile = 'import /dynamic/*.caddy';
|
||||||
@@ -53,7 +53,7 @@ class StartProxy
|
|||||||
'fi',
|
'fi',
|
||||||
"echo 'Starting coolify-proxy.'",
|
"echo 'Starting coolify-proxy.'",
|
||||||
'docker compose up -d --remove-orphans',
|
'docker compose up -d --remove-orphans',
|
||||||
"echo 'Proxy started successfully.'",
|
"echo 'Successfully started coolify-proxy.'",
|
||||||
]);
|
]);
|
||||||
$commands = $commands->merge(connectProxyToNetworks($server));
|
$commands = $commands->merge(connectProxyToNetworks($server));
|
||||||
}
|
}
|
||||||
|
@@ -69,8 +69,10 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
return 'No containers found.';
|
return 'No containers found.';
|
||||||
}
|
}
|
||||||
GetContainersStatus::run($this->server, $this->containers, $containerReplicates);
|
GetContainersStatus::run($this->server, $this->containers, $containerReplicates);
|
||||||
|
if ($this->server->isLogDrainEnabled()) {
|
||||||
$this->checkLogDrainContainer();
|
$this->checkLogDrainContainer();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
ray($e->getMessage());
|
ray($e->getMessage());
|
||||||
@@ -115,9 +117,6 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
|
|
||||||
private function checkLogDrainContainer()
|
private function checkLogDrainContainer()
|
||||||
{
|
{
|
||||||
if (! $this->server->isLogDrainEnabled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$foundLogDrainContainer = $this->containers->filter(function ($value, $key) {
|
$foundLogDrainContainer = $this->containers->filter(function ($value, $key) {
|
||||||
return data_get($value, 'Name') === '/coolify-log-drain';
|
return data_get($value, 'Name') === '/coolify-log-drain';
|
||||||
})->first();
|
})->first();
|
||||||
|
@@ -49,6 +49,10 @@ class Status extends Component
|
|||||||
if ($this->server->proxy->status === 'running') {
|
if ($this->server->proxy->status === 'running') {
|
||||||
$this->polling = false;
|
$this->polling = false;
|
||||||
$notification && $this->dispatch('success', 'Proxy is running.');
|
$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 {
|
} else {
|
||||||
$notification && $this->dispatch('error', 'Proxy is not running.');
|
$notification && $this->dispatch('error', 'Proxy is not running.');
|
||||||
}
|
}
|
||||||
|
@@ -96,6 +96,8 @@ function connectProxyToNetworks(Server $server)
|
|||||||
"echo 'Connecting coolify-proxy to $network network...'",
|
"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 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",
|
"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 {
|
} else {
|
||||||
@@ -104,6 +106,8 @@ function connectProxyToNetworks(Server $server)
|
|||||||
"echo 'Connecting coolify-proxy to $network network...'",
|
"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 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",
|
"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') {
|
} elseif ($proxy_type === 'CADDY') {
|
||||||
$config = [
|
$config = [
|
||||||
'version' => '3.8',
|
|
||||||
'networks' => $array_of_networks->toArray(),
|
'networks' => $array_of_networks->toArray(),
|
||||||
'services' => [
|
'services' => [
|
||||||
'caddy' => [
|
'caddy' => [
|
||||||
@@ -236,12 +239,9 @@ function generate_default_proxy_configuration(Server $server)
|
|||||||
'80:80',
|
'80:80',
|
||||||
'443:443',
|
'443:443',
|
||||||
],
|
],
|
||||||
// "healthcheck" => [
|
'labels' => [
|
||||||
// "test" => "wget -qO- http://localhost:80|| exit 1",
|
'coolify.managed=true',
|
||||||
// "interval" => "4s",
|
],
|
||||||
// "timeout" => "2s",
|
|
||||||
// "retries" => 5,
|
|
||||||
// ],
|
|
||||||
'volumes' => [
|
'volumes' => [
|
||||||
'/var/run/docker.sock:/var/run/docker.sock:ro',
|
'/var/run/docker.sock:/var/run/docker.sock:ro',
|
||||||
"{$proxy_path}/dynamic:/dynamic",
|
"{$proxy_path}/dynamic:/dynamic",
|
||||||
|
@@ -3,10 +3,12 @@
|
|||||||
<x-status.running status="Proxy Running" />
|
<x-status.running status="Proxy Running" />
|
||||||
@elseif (data_get($server, 'proxy.status') === 'restarting')
|
@elseif (data_get($server, 'proxy.status') === 'restarting')
|
||||||
<x-status.restarting status="Proxy Restarting" />
|
<x-status.restarting status="Proxy Restarting" />
|
||||||
@else
|
@elseif (data_get($server, 'proxy.force_stop'))
|
||||||
<x-status.stopped status="Proxy Stopped" />
|
<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
|
@endif
|
||||||
@if (data_get($server, 'proxy.status') === 'running')
|
|
||||||
<x-forms.button wire:click='checkProxy(true)'>Refresh</x-forms.button>
|
<x-forms.button wire:click='checkProxy(true)'>Refresh</x-forms.button>
|
||||||
@endif
|
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user