Skip to content

Commit 575b076

Browse files
authored
v4.0.0-beta.470 (#9139)
2 parents ffd69c1 + bf306ff commit 575b076

File tree

67 files changed

+4701
-577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4701
-577
lines changed

.env.development.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ RAY_ENABLED=false
2424
# Enable Laravel Telescope for debugging
2525
TELESCOPE_ENABLED=false
2626

27+
# Enable Laravel Nightwatch monitoring
28+
NIGHTWATCH_ENABLED=false
29+
NIGHTWATCH_TOKEN=
30+
2731
# Selenium Driver URL for Dusk
2832
DUSK_DRIVER_URL=http://selenium:4444
2933

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Thank you so much!
7070
* [Arcjet](https://arcjet.com?ref=coolify.io) - Advanced web security and performance solutions
7171
* [BC Direct](https://bc.direct?ref=coolify.io) - Your trusted technology consulting partner
7272
* [Blacksmith](https://blacksmith.sh?ref=coolify.io) - Infrastructure automation platform
73-
* [Brand.dev](https://brand.dev?ref=coolify.io) - API to personalize your product with logos, colors, and company info from any domain
73+
* [Context.dev](https://context.dev?ref=coolify.io) - API to personalize your product with logos, colors, and company info from any domain
7474
* [ByteBase](https://www.bytebase.com?ref=coolify.io) - Database CI/CD and Security at Scale
7575
* [CodeRabbit](https://coderabbit.ai?ref=coolify.io) - Cut Code Review Time & Bugs in Half
7676
* [COMIT](https://comit.international?ref=coolify.io) - New York Times award–winning contractor
@@ -90,6 +90,7 @@ Thank you so much!
9090
* [Logto](https://logto.io?ref=coolify.io) - The better identity infrastructure for developers
9191
* [Macarne](https://macarne.com?ref=coolify.io) - Best IP Transit & Carrier Ethernet Solutions for Simplified Network Connectivity
9292
* [Mobb](https://vibe.mobb.ai/?ref=coolify.io) - Secure Your AI-Generated Code to Unlock Dev Productivity
93+
* [PetroSky Cloud](https://petrosky.io?ref=coolify.io) - Open source cloud deployment solutions
9394
* [PFGLabs](https://pfglabs.com?ref=coolify.io) - Build Real Projects with Golang
9495
* [Ramnode](https://ramnode.com/?ref=coolify.io) - High Performance Cloud VPS Hosting
9596
* [SaasyKit](https://saasykit.com?ref=coolify.io) - Complete SaaS starter kit for developers

app/Actions/Proxy/GetProxyConfiguration.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
namespace App\Actions\Proxy;
44

5+
use App\Enums\ProxyTypes;
56
use App\Models\Server;
67
use App\Services\ProxyDashboardCacheService;
78
use Illuminate\Support\Facades\Log;
89
use Lorisleiva\Actions\Concerns\AsAction;
10+
use Symfony\Component\Yaml\Yaml;
911

1012
class GetProxyConfiguration
1113
{
@@ -24,6 +26,17 @@ public function handle(Server $server, bool $forceRegenerate = false): string
2426
// Primary source: database
2527
$proxy_configuration = $server->proxy->get('last_saved_proxy_configuration');
2628

29+
// Validate stored config matches current proxy type
30+
if (! empty(trim($proxy_configuration ?? ''))) {
31+
if (! $this->configMatchesProxyType($proxyType, $proxy_configuration)) {
32+
Log::warning('Stored proxy config does not match current proxy type, will regenerate', [
33+
'server_id' => $server->id,
34+
'proxy_type' => $proxyType,
35+
]);
36+
$proxy_configuration = null;
37+
}
38+
}
39+
2740
// Backfill: existing servers may not have DB config yet — read from disk once
2841
if (empty(trim($proxy_configuration ?? ''))) {
2942
$proxy_configuration = $this->backfillFromDisk($server);
@@ -55,6 +68,29 @@ public function handle(Server $server, bool $forceRegenerate = false): string
5568
return $proxy_configuration;
5669
}
5770

71+
/**
72+
* Check that the stored docker-compose YAML contains the expected service
73+
* for the server's current proxy type. Returns false if the config belongs
74+
* to a different proxy type (e.g. Traefik config on a CADDY server).
75+
*/
76+
private function configMatchesProxyType(string $proxyType, string $configuration): bool
77+
{
78+
try {
79+
$yaml = Yaml::parse($configuration);
80+
$services = data_get($yaml, 'services', []);
81+
82+
return match ($proxyType) {
83+
ProxyTypes::TRAEFIK->value => isset($services['traefik']),
84+
ProxyTypes::CADDY->value => isset($services['caddy']),
85+
ProxyTypes::NGINX->value => isset($services['nginx']),
86+
default => true,
87+
};
88+
} catch (\Throwable $e) {
89+
// If YAML is unparseable, don't block — let the existing flow handle it
90+
return true;
91+
}
92+
}
93+
5894
/**
5995
* Backfill: read config from disk for servers that predate DB storage.
6096
* Stores the result in the database so future reads skip SSH entirely.

app/Actions/Server/InstallDocker.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ class InstallDocker
1111
{
1212
use AsAction;
1313

14-
private string $dockerVersion;
15-
1614
public function handle(Server $server)
1715
{
18-
$this->dockerVersion = config('constants.docker.minimum_required_version');
1916
$supported_os_type = $server->validateOS();
2017
if (! $supported_os_type) {
2118
throw new \Exception('Server OS type is not supported for automated installation. Please install Docker manually before continuing: <a target="_blank" class="underline" href="https://coolify.io/docs/installation#manually">documentation</a>.');
@@ -118,7 +115,7 @@ public function handle(Server $server)
118115

119116
private function getDebianDockerInstallCommand(): string
120117
{
121-
return "curl --max-time 300 --retry 3 https://releases.rancher.com/install-docker/{$this->dockerVersion}.sh | sh || curl --max-time 300 --retry 3 https://get.docker.com | sh -s -- --version {$this->dockerVersion} || (".
118+
return 'curl -fsSL https://get.docker.com | sh || ('.
122119
'. /etc/os-release && '.
123120
'install -m 0755 -d /etc/apt/keyrings && '.
124121
'curl -fsSL https://download.docker.com/linux/${ID}/gpg -o /etc/apt/keyrings/docker.asc && '.
@@ -131,7 +128,7 @@ private function getDebianDockerInstallCommand(): string
131128

132129
private function getRhelDockerInstallCommand(): string
133130
{
134-
return "curl https://releases.rancher.com/install-docker/{$this->dockerVersion}.sh | sh || curl https://get.docker.com | sh -s -- --version {$this->dockerVersion} || (".
131+
return 'curl -fsSL https://get.docker.com | sh || ('.
135132
'dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && '.
136133
'dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && '.
137134
'systemctl start docker && '.
@@ -141,7 +138,7 @@ private function getRhelDockerInstallCommand(): string
141138

142139
private function getSuseDockerInstallCommand(): string
143140
{
144-
return "curl https://releases.rancher.com/install-docker/{$this->dockerVersion}.sh | sh || curl https://get.docker.com | sh -s -- --version {$this->dockerVersion} || (".
141+
return 'curl -fsSL https://get.docker.com | sh || ('.
145142
'zypper addrepo https://download.docker.com/linux/sles/docker-ce.repo && '.
146143
'zypper refresh && '.
147144
'zypper install -y --no-confirm docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && '.
@@ -152,17 +149,13 @@ private function getSuseDockerInstallCommand(): string
152149

153150
private function getArchDockerInstallCommand(): string
154151
{
155-
// Use -Syu to perform full system upgrade before installing Docker
156-
// Partial upgrades (-Sy without -u) are discouraged on Arch Linux
157-
// as they can lead to broken dependencies and system instability
158-
// Use --needed to skip reinstalling packages that are already up-to-date (idempotent)
159152
return 'pacman -Syu --noconfirm --needed docker docker-compose && '.
160153
'systemctl enable docker.service && '.
161154
'systemctl start docker.service';
162155
}
163156

164157
private function getGenericDockerInstallCommand(): string
165158
{
166-
return "curl --max-time 300 --retry 3 https://releases.rancher.com/install-docker/{$this->dockerVersion}.sh | sh || curl --max-time 300 --retry 3 https://get.docker.com | sh -s -- --version {$this->dockerVersion}";
159+
return 'curl -fsSL https://get.docker.com | sh';
167160
}
168161
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Console\Commands;
4+
5+
use Illuminate\Console\Command;
6+
7+
class Nightwatch extends Command
8+
{
9+
protected $signature = 'start:nightwatch';
10+
11+
protected $description = 'Start Nightwatch';
12+
13+
public function handle(): void
14+
{
15+
if (config('constants.nightwatch.is_nightwatch_enabled')) {
16+
$this->info('Nightwatch is enabled on this server.');
17+
$this->call('nightwatch:agent');
18+
}
19+
20+
exit(0);
21+
}
22+
}

0 commit comments

Comments
 (0)