Skip to content

Commit 6cc86a3

Browse files
authored
Merge pull request coollabsio#2881 from coollabsio/next
v4.0.0-beta.318
2 parents 7fd9a79 + f1e5b61 commit 6cc86a3

38 files changed

+1289
-379
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Special thanks to our biggest sponsors!
4848
<a href="https://trieve.ai/?ref=coolify.io" target="_blank"><img src="./other/logos/trieve_bg.png" alt="trieve logo" width="180"/></a>
4949
<a href="https://blacksmith.sh/?ref=coolify.io" target="_blank"><img src="./other/logos/blacksmith.svg" alt="blacksmith logo" width="200"/></a>
5050
<a href="https://latitude.sh/?ref=coolify.io" target="_blank"><img src="./other/logos/latitude.svg" alt="latitude logo" width="200"/></a>
51+
<a href="https://brand.dev/?ref=coolify.io" target="_blank"><img src="./other/logos/branddev.png" alt="branddev logo" width="200"/></a>
5152

5253
## Github Sponsors ($40+)
5354
<a href="https://serpapi.com/?ref=coolify.io"><img width="60px" alt="SerpAPI" src="https://github.com/serpapi.png"/></a>

app/Actions/Application/StopApplication.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class StopApplication
99
{
1010
use AsAction;
1111

12-
public function handle(Application $application)
12+
public function handle(Application $application, bool $previewDeployments = false)
1313
{
1414
if ($application->destination->server->isSwarm()) {
1515
instant_remote_process(["docker stack rm {$application->uuid}"], $application->destination->server);
@@ -26,7 +26,12 @@ public function handle(Application $application)
2626
if (! $server->isFunctional()) {
2727
return 'Server is not functional';
2828
}
29-
$containers = getCurrentApplicationContainerStatus($server, $application->id, 0);
29+
if ($previewDeployments) {
30+
$containers = getCurrentApplicationContainerStatus($server, $application->id, includePullrequests: true);
31+
} else {
32+
$containers = getCurrentApplicationContainerStatus($server, $application->id, 0);
33+
}
34+
ray($containers);
3035
if ($containers->count() > 0) {
3136
foreach ($containers as $container) {
3237
$containerName = data_get($container, 'Names');

app/Actions/Proxy/CheckConfiguration.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public function handle(Server $server, bool $reset = false)
2121
"cat $proxy_path/docker-compose.yml",
2222
];
2323
$proxy_configuration = instant_remote_process($payload, $server, false);
24-
2524
if ($reset || ! $proxy_configuration || is_null($proxy_configuration)) {
2625
$proxy_configuration = str(generate_default_proxy_configuration($server))->trim()->value;
2726
}

app/Actions/Server/ValidateServer.php

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
namespace App\Actions\Server;
4+
5+
use App\Models\Server;
6+
use Lorisleiva\Actions\Concerns\AsAction;
7+
8+
class ValidateServer
9+
{
10+
use AsAction;
11+
12+
public ?string $uptime = null;
13+
14+
public ?string $error = null;
15+
16+
public ?string $supported_os_type = null;
17+
18+
public ?string $docker_installed = null;
19+
20+
public ?string $docker_compose_installed = null;
21+
22+
public ?string $docker_version = null;
23+
24+
public function handle(Server $server)
25+
{
26+
$server->update([
27+
'validation_logs' => null,
28+
]);
29+
['uptime' => $this->uptime, 'error' => $error] = $server->validateConnection();
30+
if (! $this->uptime) {
31+
$this->error = 'Server is not reachable. Please validate your configuration and connection.<br>Check this <a target="_blank" class="text-black underline dark:text-white" href="https://coolify.io/docs/knowledge-base/server/openssh">documentation</a> for further help. <br><br><div class="text-error">Error: '.$error.'</div>';
32+
$server->update([
33+
'validation_logs' => $this->error,
34+
]);
35+
throw new \Exception($this->error);
36+
}
37+
$this->supported_os_type = $server->validateOS();
38+
if (! $this->supported_os_type) {
39+
$this->error = 'Server OS type is not supported. Please install Docker manually before continuing: <a target="_blank" class="text-black underline dark:text-white" href="https://docs.docker.com/engine/install/#server">documentation</a>.';
40+
$server->update([
41+
'validation_logs' => $this->error,
42+
]);
43+
throw new \Exception($this->error);
44+
}
45+
46+
$this->docker_installed = $server->validateDockerEngine();
47+
$this->docker_compose_installed = $server->validateDockerCompose();
48+
if (! $this->docker_installed || ! $this->docker_compose_installed) {
49+
$this->error = 'Docker Engine is not installed. Please install Docker manually before continuing: <a target="_blank" class="text-black underline dark:text-white" href="https://docs.docker.com/engine/install/#server">documentation</a>.';
50+
$server->update([
51+
'validation_logs' => $this->error,
52+
]);
53+
throw new \Exception($this->error);
54+
}
55+
$this->docker_version = $server->validateDockerEngineVersion();
56+
57+
if ($this->docker_version) {
58+
return 'OK';
59+
} else {
60+
$this->error = 'Docker Engine is not installed. Please install Docker manually before continuing: <a target="_blank" class="text-black underline dark:text-white" href="https://docs.docker.com/engine/install/#server">documentation</a>.';
61+
$server->update([
62+
'validation_logs' => $this->error,
63+
]);
64+
throw new \Exception($this->error);
65+
}
66+
}
67+
}

app/Console/Commands/CleanupUnreachableServers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function handle()
1818
if ($servers->count() > 0) {
1919
foreach ($servers as $server) {
2020
echo "Cleanup unreachable server ($server->id) with name $server->name";
21-
send_internal_notification("Server $server->name is unreachable for 7 days. Cleaning up...");
21+
// send_internal_notification("Server $server->name is unreachable for 7 days. Cleaning up...");
2222
$server->update([
2323
'ip' => '1.2.3.4',
2424
]);

0 commit comments

Comments
 (0)