From 997017365243a7e14e6e60f02f9684388ca88f6b Mon Sep 17 00:00:00 2001 From: Lucien Blunk-Lallet Date: Wed, 8 Jan 2025 09:02:13 +0100 Subject: [PATCH 01/21] fix: pull latest image from registry when using build server --- app/Jobs/ApplicationDeploymentJob.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index addaf436a..ea672e1bc 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -2270,6 +2270,7 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf"); } else { if ($this->use_build_server) { $this->execute_remote_command( + ["{$this->coolify_variables} docker compose pull", 'hidden' => true], ["{$this->coolify_variables} docker compose --project-name {$this->application->uuid} --project-directory {$this->configuration_dir} -f {$this->configuration_dir}{$this->docker_compose_location} up --build -d", 'hidden' => true], ); } else { From a139cf154d2480d9c2fdb793d971ddfd283b67d6 Mon Sep 17 00:00:00 2001 From: Lucien Blunk-Lallet Date: Wed, 8 Jan 2025 09:37:25 +0100 Subject: [PATCH 02/21] refactor: use pull flag on docker compose up --- app/Jobs/ApplicationDeploymentJob.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index ea672e1bc..8644cff83 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -2270,8 +2270,7 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf"); } else { if ($this->use_build_server) { $this->execute_remote_command( - ["{$this->coolify_variables} docker compose pull", 'hidden' => true], - ["{$this->coolify_variables} docker compose --project-name {$this->application->uuid} --project-directory {$this->configuration_dir} -f {$this->configuration_dir}{$this->docker_compose_location} up --build -d", 'hidden' => true], + ["{$this->coolify_variables} docker compose --project-name {$this->application->uuid} --project-directory {$this->configuration_dir} -f {$this->configuration_dir}{$this->docker_compose_location} up --pull always --build -d", 'hidden' => true], ); } else { $this->execute_remote_command( From 5b37c76793b31bc891c0d0a24eb381d1e8096bbd Mon Sep 17 00:00:00 2001 From: Boulakhras Ahmed <109124492+troisiemeoeil@users.noreply.github.com> Date: Tue, 11 Feb 2025 23:06:48 +0200 Subject: [PATCH 03/21] Update README.md Added grammatical correction to the documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cafff116f..8670e9c76 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Special thanks to our biggest sponsors! * [Juxtdigital](https://juxtdigital.dev/?ref=coolify.io) - A digital agency offering web development, design, and digital marketing services for businesses. * [Saasykit](https://saasykit.com/?ref=coolify.io) - A Laravel-based boilerplate providing essential components and features for building SaaS applications quickly. * [Massivegrid](https://massivegrid.com/?ref=coolify.io) - A cloud hosting provider offering scalable infrastructure solutions for businesses of all sizes. -* [LiquidWeb](https://liquidweb.com/?utm_source=coolify.io) - Fast web hosting provider. +* [LiquidWeb](https://liquidweb.com/?utm_source=coolify.io) - A Fast web hosting provider. ## Github Sponsors ($40+) From a25e2072d3bf449e72b1a4fc8ebcac297715f7f1 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 12 Feb 2025 10:19:45 +0100 Subject: [PATCH 04/21] fix(deployment): improve server selection for deployment cancellation - Add fallback for build server and deployment server selection - Use `ownedByCurrentTeam()` scope when finding servers - Handle cases where server IDs might be null --- app/Livewire/Project/Application/DeploymentNavbar.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Project/Application/DeploymentNavbar.php b/app/Livewire/Project/Application/DeploymentNavbar.php index 87b40d4dc..66f387fcf 100644 --- a/app/Livewire/Project/Application/DeploymentNavbar.php +++ b/app/Livewire/Project/Application/DeploymentNavbar.php @@ -53,13 +53,13 @@ class DeploymentNavbar extends Component public function cancel() { $kill_command = "docker rm -f {$this->application_deployment_queue->deployment_uuid}"; - $build_server_id = $this->application_deployment_queue->build_server_id; + $build_server_id = $this->application_deployment_queue->build_server_id ?? $this->application->destination->server_id; $server_id = $this->application_deployment_queue->server_id ?? $this->application->destination->server_id; try { if ($this->application->settings->is_build_server_enabled) { - $server = Server::find($build_server_id); + $server = Server::ownedByCurrentTeam()->find($build_server_id); } else { - $server = Server::find($server_id); + $server = Server::ownedByCurrentTeam()->find($server_id); } if ($this->application_deployment_queue->logs) { $previous_logs = json_decode($this->application_deployment_queue->logs, associative: true, flags: JSON_THROW_ON_ERROR); From 3c538e00dd44864a5d6b5380028da360129c4b78 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 12 Feb 2025 10:30:27 +0100 Subject: [PATCH 05/21] fix(deployment): improve log line rendering and formatting --- .../livewire/project/application/deployment/show.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/livewire/project/application/deployment/show.blade.php b/resources/views/livewire/project/application/deployment/show.blade.php index 02c68317d..f765ed35f 100644 --- a/resources/views/livewire/project/application/deployment/show.blade.php +++ b/resources/views/livewire/project/application/deployment/show.blade.php @@ -108,16 +108,16 @@
@forelse ($this->logLines as $line)
$line['command'] ?? false, + 'mt-2' => isset($line['command']) && $line['command'], 'flex gap-2 dark:hover:bg-coolgray-500 hover:bg-gray-100', ])> {{ $line['timestamp'] }} $line['hidden'], 'text-red-500' => $line['stderr'], - 'font-bold' => $line['command'] ?? false, + 'font-bold' => isset($line['command']) && $line['command'], 'whitespace-pre-wrap', - ])>{!! $line['line'] !!} + ])>{!! (isset($line['command']) && $line['command'] ? '[CMD]: ' : '') . trim($line['line']) !!}
@empty No logs yet. From 25427ac41dfbfb89acb9cc972bc119d192694712 Mon Sep 17 00:00:00 2001 From: astrid Date: Thu, 13 Feb 2025 00:29:32 +0100 Subject: [PATCH 06/21] fix s3 coolify docs link --- resources/views/livewire/storage/create.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/livewire/storage/create.blade.php b/resources/views/livewire/storage/create.blade.php index 75168a12f..d4ece9a87 100644 --- a/resources/views/livewire/storage/create.blade.php +++ b/resources/views/livewire/storage/create.blade.php @@ -1,6 +1,6 @@
For more details, please visit the Coolify Docs.
+ href="https://coolify.io/docs/knowledge-base/s3/introduction" target="_blank">Coolify Docs.
From 109e845143fd362b38d59b435650aa46aab916bb Mon Sep 17 00:00:00 2001 From: astrid Date: Thu, 13 Feb 2025 00:54:02 +0100 Subject: [PATCH 07/21] fix traefix healthcheck docs url --- resources/views/components/status/running.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/status/running.blade.php b/resources/views/components/status/running.blade.php index 27a6d7181..a1a93efac 100644 --- a/resources/views/components/status/running.blade.php +++ b/resources/views/components/status/running.blade.php @@ -26,7 +26,7 @@ @endphp @if ($showUnhealthyHelper) + helper="Unhealthy state. This doesn't mean that the resource is malfunctioning.

- If the resource is accessible, it indicates that no health check is configured - it is not mandatory.
- If the resource is not accessible (returning 404 or 503), it may indicate that a health check is needed and has not passed. Your action is required.

More details in the documentation.">
+
Date: Thu, 13 Feb 2025 13:27:21 +0100 Subject: [PATCH 11/21] version++ feat(service): add convex --- config/constants.php | 2 +- public/svgs/convex.svg | 1 + templates/compose/convex.yaml | 40 ++++++++++++++++++++++++++++++++ templates/service-templates.json | 20 ++++++++++++++++ versions.json | 4 ++-- 5 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 public/svgs/convex.svg create mode 100644 templates/compose/convex.yaml diff --git a/config/constants.php b/config/constants.php index 2cf0123c0..65272720a 100644 --- a/config/constants.php +++ b/config/constants.php @@ -2,7 +2,7 @@ return [ 'coolify' => [ - 'version' => '4.0.0-beta.392', + 'version' => '4.0.0-beta.393', 'helper_version' => '1.0.6', 'realtime_version' => '1.0.5', 'self_hosted' => env('SELF_HOSTED', true), diff --git a/public/svgs/convex.svg b/public/svgs/convex.svg new file mode 100644 index 000000000..e8c83b560 --- /dev/null +++ b/public/svgs/convex.svg @@ -0,0 +1 @@ + diff --git a/templates/compose/convex.yaml b/templates/compose/convex.yaml new file mode 100644 index 000000000..74d2db5bf --- /dev/null +++ b/templates/compose/convex.yaml @@ -0,0 +1,40 @@ +# documentation: https://docs.convex.dev/ +# slogan: Convex is the open-source reactive database for app developers. +# tags: database, reactive, database, ai, agents, chatbot, api, team, bot, flows +# logo: svgs/convex.svg +# port: 6791 + +services: + backend: + image: ghcr.io/get-convex/convex-backend:4499dd4fd7f2148687a7774599c613d052950f46 + volumes: + - data:/convex/data + environment: + - SERVICE_FQDN_BACKEND_3210 + - INSTANCE_NAME=${INSTANCE_NAME:-self-hosted-convex} + - INSTANCE_SECRET=${SERVICE_HEX_32_SECRET} + - CONVEX_RELEASE_VERSION_DEV=${CONVEX_RELEASE_VERSION_DEV:-} + - ACTIONS_USER_TIMEOUT_SECS=${ACTIONS_USER_TIMEOUT_SECS:-} + - CONVEX_CLOUD_ORIGIN=${SERVICE_FQDN_CONVEX_6791} + - CONVEX_SITE_ORIGIN=${SERVICE_FQDN_CONVEX_6791}/http + - DATABASE_URL=${DATABASE_URL:-} + - DISABLE_BEACON=${DISABLE_BEACON:-} + - REDACT_LOGS_TO_CLIENT=${REDACT_LOGS_TO_CLIENT:-} + - CONVEX_SELF_HOSTED_URL=${SERVICE_FQDN_CONVEX_6791} + healthcheck: + test: curl -f http://127.0.0.1:3210/version + interval: 5s + start_period: 5s + + dashboard: + image: ghcr.io/get-convex/convex-dashboard:4499dd4fd7f2148687a7774599c613d052950f46 + environment: + - SERVICE_FQDN_CONVEX_6791 + - NEXT_PUBLIC_DEPLOYMENT_URL=$SERVICE_FQDN_BACKEND_3210 + depends_on: + backend: + condition: service_healthy + healthcheck: + test: wget -qO- http://127.0.0.1:6791/ + interval: 5s + start_period: 5s diff --git a/templates/service-templates.json b/templates/service-templates.json index 270d3cfd7..df57f65ee 100644 --- a/templates/service-templates.json +++ b/templates/service-templates.json @@ -497,6 +497,26 @@ "minversion": "0.0.0", "port": "8443" }, + "convex": { + "documentation": "https://docs.convex.dev/?utm_source=coolify.io", + "slogan": "Convex is the open-source reactive database for app developers.", + "compose": "c2VydmljZXM6CiAgYmFja2VuZDoKICAgIGltYWdlOiAnZ2hjci5pby9nZXQtY29udmV4L2NvbnZleC1iYWNrZW5kOjQ0OTlkZDRmZDdmMjE0ODY4N2E3Nzc0NTk5YzYxM2QwNTI5NTBmNDYnCiAgICB2b2x1bWVzOgogICAgICAtICdkYXRhOi9jb252ZXgvZGF0YScKICAgIGVudmlyb25tZW50OgogICAgICAtIFNFUlZJQ0VfRlFETl9CQUNLRU5EXzMyMTAKICAgICAgLSAnSU5TVEFOQ0VfTkFNRT0ke0lOU1RBTkNFX05BTUU6LXNlbGYtaG9zdGVkLWNvbnZleH0nCiAgICAgIC0gJ0lOU1RBTkNFX1NFQ1JFVD0ke1NFUlZJQ0VfSEVYXzMyX1NFQ1JFVH0nCiAgICAgIC0gJ0NPTlZFWF9SRUxFQVNFX1ZFUlNJT05fREVWPSR7Q09OVkVYX1JFTEVBU0VfVkVSU0lPTl9ERVY6LX0nCiAgICAgIC0gJ0FDVElPTlNfVVNFUl9USU1FT1VUX1NFQ1M9JHtBQ1RJT05TX1VTRVJfVElNRU9VVF9TRUNTOi19JwogICAgICAtICdDT05WRVhfQ0xPVURfT1JJR0lOPSR7U0VSVklDRV9GUUROX0NPTlZFWF82NzkxfScKICAgICAgLSAnQ09OVkVYX1NJVEVfT1JJR0lOPSR7U0VSVklDRV9GUUROX0NPTlZFWF82NzkxfS9odHRwJwogICAgICAtICdEQVRBQkFTRV9VUkw9JHtEQVRBQkFTRV9VUkw6LX0nCiAgICAgIC0gJ0RJU0FCTEVfQkVBQ09OPSR7RElTQUJMRV9CRUFDT046LX0nCiAgICAgIC0gJ1JFREFDVF9MT0dTX1RPX0NMSUVOVD0ke1JFREFDVF9MT0dTX1RPX0NMSUVOVDotfScKICAgICAgLSAnQ09OVkVYX1NFTEZfSE9TVEVEX1VSTD0ke1NFUlZJQ0VfRlFETl9DT05WRVhfNjc5MX0nCiAgICBoZWFsdGhjaGVjazoKICAgICAgdGVzdDogJ2N1cmwgLWYgaHR0cDovLzEyNy4wLjAuMTozMjEwL3ZlcnNpb24nCiAgICAgIGludGVydmFsOiA1cwogICAgICBzdGFydF9wZXJpb2Q6IDVzCiAgZGFzaGJvYXJkOgogICAgaW1hZ2U6ICdnaGNyLmlvL2dldC1jb252ZXgvY29udmV4LWRhc2hib2FyZDo0NDk5ZGQ0ZmQ3ZjIxNDg2ODdhNzc3NDU5OWM2MTNkMDUyOTUwZjQ2JwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gU0VSVklDRV9GUUROX0NPTlZFWF82NzkxCiAgICAgIC0gTkVYVF9QVUJMSUNfREVQTE9ZTUVOVF9VUkw9JFNFUlZJQ0VfRlFETl9CQUNLRU5EXzMyMTAKICAgIGRlcGVuZHNfb246CiAgICAgIGJhY2tlbmQ6CiAgICAgICAgY29uZGl0aW9uOiBzZXJ2aWNlX2hlYWx0aHkKICAgIGhlYWx0aGNoZWNrOgogICAgICB0ZXN0OiAnd2dldCAtcU8tIGh0dHA6Ly8xMjcuMC4wLjE6Njc5MS8nCiAgICAgIGludGVydmFsOiA1cwogICAgICBzdGFydF9wZXJpb2Q6IDVzCg==", + "tags": [ + "database", + "reactive", + "database", + "ai", + "agents", + "chatbot", + "api", + "team", + "bot", + "flows" + ], + "logo": "svgs/convex.svg", + "minversion": "0.0.0", + "port": "6791" + }, "cryptgeon": { "documentation": "https://github.com/cupcakearmy/cryptgeon?utm_source=coolify.io", "slogan": "Secure note / file sharing service inspired by PrivNote.", diff --git a/versions.json b/versions.json index e43c4736c..a4676829d 100644 --- a/versions.json +++ b/versions.json @@ -1,10 +1,10 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.392" + "version": "4.0.0-beta.393" }, "nightly": { - "version": "4.0.0-beta.393" + "version": "4.0.0-beta.394" }, "helper": { "version": "1.0.6" From 48c142a5a7704c6a4b5a4bdb19f8cc148653e965 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 13 Feb 2025 13:31:07 +0100 Subject: [PATCH 12/21] Update Convex logo SVG with new design and dimensions --- public/svgs/convex.svg | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/public/svgs/convex.svg b/public/svgs/convex.svg index e8c83b560..7fd02e9d6 100644 --- a/public/svgs/convex.svg +++ b/public/svgs/convex.svg @@ -1 +1,12 @@ - + + + + + + + + + + + + From 570b46d50ef54f5fbaaf2cb4c9f3da33cc592ed7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 13 Feb 2025 13:32:36 +0100 Subject: [PATCH 13/21] chore: rollback Coolify version to 4.0.0-beta.392 --- config/constants.php | 2 +- versions.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/constants.php b/config/constants.php index 65272720a..2cf0123c0 100644 --- a/config/constants.php +++ b/config/constants.php @@ -2,7 +2,7 @@ return [ 'coolify' => [ - 'version' => '4.0.0-beta.393', + 'version' => '4.0.0-beta.392', 'helper_version' => '1.0.6', 'realtime_version' => '1.0.5', 'self_hosted' => env('SELF_HOSTED', true), diff --git a/versions.json b/versions.json index a4676829d..e43c4736c 100644 --- a/versions.json +++ b/versions.json @@ -1,10 +1,10 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.393" + "version": "4.0.0-beta.392" }, "nightly": { - "version": "4.0.0-beta.394" + "version": "4.0.0-beta.393" }, "helper": { "version": "1.0.6" From 694b0ac249f6349e07d5126740d09ee82e5b8da8 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sat, 15 Feb 2025 13:21:23 +0100 Subject: [PATCH 14/21] feat(core): add error logging and cron parsing to docker/server schedules --- app/Console/Kernel.php | 134 ++++++++++++++++++++++++----------------- 1 file changed, 79 insertions(+), 55 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 8b4240412..122d72c39 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -6,13 +6,11 @@ use App\Jobs\CheckAndStartSentinelJob; use App\Jobs\CheckForUpdatesJob; use App\Jobs\CheckHelperImageJob; use App\Jobs\CleanupInstanceStuffsJob; -use App\Jobs\CleanupStaleMultiplexedConnections; use App\Jobs\DatabaseBackupJob; use App\Jobs\DockerCleanupJob; use App\Jobs\PullTemplatesFromCDN; use App\Jobs\ScheduledTaskJob; use App\Jobs\ServerCheckJob; -use App\Jobs\ServerCleanupMux; use App\Jobs\ServerStorageCheckJob; use App\Jobs\UpdateCoolifyJob; use App\Models\InstanceSettings; @@ -23,6 +21,7 @@ use App\Models\Team; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Log; class Kernel extends ConsoleKernel { @@ -99,10 +98,14 @@ class Kernel extends ConsoleKernel $servers = $this->allServers->whereRelation('settings', 'is_usable', true)->whereRelation('settings', 'is_reachable', true)->get(); } foreach ($servers as $server) { - if ($server->isSentinelEnabled()) { - $this->scheduleInstance->job(function () use ($server) { - CheckAndStartSentinelJob::dispatch($server); - })->cron($this->updateCheckFrequency)->timezone($this->instanceTimezone)->onOneServer(); + try { + if ($server->isSentinelEnabled()) { + $this->scheduleInstance->job(function () use ($server) { + CheckAndStartSentinelJob::dispatch($server); + })->cron($this->updateCheckFrequency)->timezone($this->instanceTimezone)->onOneServer(); + } + } catch (\Exception $e) { + Log::error('Error pulling images: '.$e->getMessage()); } } $this->scheduleInstance->job(new CheckHelperImageJob) @@ -138,35 +141,47 @@ class Kernel extends ConsoleKernel } foreach ($servers as $server) { - $serverTimezone = data_get($server->settings, 'server_timezone', $this->instanceTimezone); - if (validate_timezone($serverTimezone) === false) { - $serverTimezone = config('app.timezone'); - } - - // Sentinel check - $lastSentinelUpdate = $server->sentinel_updated_at; - if (Carbon::parse($lastSentinelUpdate)->isBefore(now()->subSeconds($server->waitBeforeDoingSshCheck()))) { - // Check container status every minute if Sentinel does not activated - if (isCloud()) { - $this->scheduleInstance->job(new ServerCheckJob($server))->timezone($serverTimezone)->everyFiveMinutes()->onOneServer(); - } else { - $this->scheduleInstance->job(new ServerCheckJob($server))->timezone($serverTimezone)->everyMinute()->onOneServer(); + try { + $serverTimezone = data_get($server->settings, 'server_timezone', $this->instanceTimezone); + if (validate_timezone($serverTimezone) === false) { + $serverTimezone = config('app.timezone'); } - // $this->scheduleInstance->job(new \App\Jobs\ServerCheckNewJob($server))->everyFiveMinutes()->onOneServer(); - $this->scheduleInstance->job(new ServerStorageCheckJob($server))->cron($server->settings->server_disk_usage_check_frequency)->timezone($serverTimezone)->onOneServer(); - } + // Sentinel check + $lastSentinelUpdate = $server->sentinel_updated_at; + if (Carbon::parse($lastSentinelUpdate)->isBefore(now()->subSeconds($server->waitBeforeDoingSshCheck()))) { + // Check container status every minute if Sentinel does not activated + if (isCloud()) { + $this->scheduleInstance->job(new ServerCheckJob($server))->timezone($serverTimezone)->everyFiveMinutes()->onOneServer(); + } else { + $this->scheduleInstance->job(new ServerCheckJob($server))->timezone($serverTimezone)->everyMinute()->onOneServer(); + } + // $this->scheduleInstance->job(new \App\Jobs\ServerCheckNewJob($server))->everyFiveMinutes()->onOneServer(); - $this->scheduleInstance->job(new DockerCleanupJob($server))->cron($server->settings->docker_cleanup_frequency)->timezone($serverTimezone)->onOneServer(); + $serverDiskUsageCheckFrequency = data_get($server->settings, 'server_disk_usage_check_frequency', '0 * * * *'); + if (isset(VALID_CRON_STRINGS[$serverDiskUsageCheckFrequency])) { + $serverDiskUsageCheckFrequency = VALID_CRON_STRINGS[$serverDiskUsageCheckFrequency]; + } + $this->scheduleInstance->job(new ServerStorageCheckJob($server))->cron($serverDiskUsageCheckFrequency)->timezone($serverTimezone)->onOneServer(); + } - // Cleanup multiplexed connections every hour - // $this->scheduleInstance->job(new ServerCleanupMux($server))->hourly()->onOneServer(); + $dockerCleanupFrequency = data_get($server->settings, 'docker_cleanup_frequency', '0 * * * *'); + if (isset(VALID_CRON_STRINGS[$dockerCleanupFrequency])) { + $dockerCleanupFrequency = VALID_CRON_STRINGS[$dockerCleanupFrequency]; + } + $this->scheduleInstance->job(new DockerCleanupJob($server))->cron($dockerCleanupFrequency)->timezone($serverTimezone)->onOneServer(); - // Temporary solution until we have better memory management for Sentinel - if ($server->isSentinelEnabled()) { - $this->scheduleInstance->job(function () use ($server) { - $server->restartContainer('coolify-sentinel'); - })->daily()->onOneServer(); + // Cleanup multiplexed connections every hour + // $this->scheduleInstance->job(new ServerCleanupMux($server))->hourly()->onOneServer(); + + // Temporary solution until we have better memory management for Sentinel + if ($server->isSentinelEnabled()) { + $this->scheduleInstance->job(function () use ($server) { + $server->restartContainer('coolify-sentinel'); + })->daily()->onOneServer(); + } + } catch (\Exception $e) { + Log::error('Error checking resources: '.$e->getMessage()); } } } @@ -200,24 +215,28 @@ class Kernel extends ConsoleKernel } foreach ($finalScheduledBackups as $scheduled_backup) { - if (isset(VALID_CRON_STRINGS[$scheduled_backup->frequency])) { - $scheduled_backup->frequency = VALID_CRON_STRINGS[$scheduled_backup->frequency]; - } + try { + if (isset(VALID_CRON_STRINGS[$scheduled_backup->frequency])) { + $scheduled_backup->frequency = VALID_CRON_STRINGS[$scheduled_backup->frequency]; + } + $server = $scheduled_backup->server(); + $serverTimezone = data_get($server->settings, 'server_timezone', $this->instanceTimezone); - $server = $scheduled_backup->server(); - $serverTimezone = data_get($server->settings, 'server_timezone', $this->instanceTimezone); + if (validate_timezone($serverTimezone) === false) { + $serverTimezone = config('app.timezone'); + } - if (validate_timezone($serverTimezone) === false) { - $serverTimezone = config('app.timezone'); + if (isset(VALID_CRON_STRINGS[$scheduled_backup->frequency])) { + $scheduled_backup->frequency = VALID_CRON_STRINGS[$scheduled_backup->frequency]; + } + $serverTimezone = data_get($server->settings, 'server_timezone', $this->instanceTimezone); + $this->scheduleInstance->job(new DatabaseBackupJob( + backup: $scheduled_backup + ))->cron($scheduled_backup->frequency)->timezone($serverTimezone)->onOneServer(); + } catch (\Exception $e) { + Log::error('Error scheduling backup: '.$e->getMessage()); + Log::error($e->getTraceAsString()); } - - if (isset(VALID_CRON_STRINGS[$scheduled_backup->frequency])) { - $scheduled_backup->frequency = VALID_CRON_STRINGS[$scheduled_backup->frequency]; - } - $serverTimezone = data_get($server->settings, 'server_timezone', $this->instanceTimezone); - $this->scheduleInstance->job(new DatabaseBackupJob( - backup: $scheduled_backup - ))->cron($scheduled_backup->frequency)->timezone($serverTimezone)->onOneServer(); } } @@ -264,18 +283,23 @@ class Kernel extends ConsoleKernel } foreach ($finalScheduledTasks as $scheduled_task) { - $server = $scheduled_task->server(); - if (isset(VALID_CRON_STRINGS[$scheduled_task->frequency])) { - $scheduled_task->frequency = VALID_CRON_STRINGS[$scheduled_task->frequency]; - } - $serverTimezone = data_get($server->settings, 'server_timezone', $this->instanceTimezone); + try { + $server = $scheduled_task->server(); + if (isset(VALID_CRON_STRINGS[$scheduled_task->frequency])) { + $scheduled_task->frequency = VALID_CRON_STRINGS[$scheduled_task->frequency]; + } + $serverTimezone = data_get($server->settings, 'server_timezone', $this->instanceTimezone); - if (validate_timezone($serverTimezone) === false) { - $serverTimezone = config('app.timezone'); + if (validate_timezone($serverTimezone) === false) { + $serverTimezone = config('app.timezone'); + } + $this->scheduleInstance->job(new ScheduledTaskJob( + task: $scheduled_task + ))->cron($scheduled_task->frequency)->timezone($serverTimezone)->onOneServer(); + } catch (\Exception $e) { + Log::error('Error scheduling task: '.$e->getMessage()); + Log::error($e->getTraceAsString()); } - $this->scheduleInstance->job(new ScheduledTaskJob( - task: $scheduled_task - ))->cron($scheduled_task->frequency)->timezone($serverTimezone)->onOneServer(); } } From 457ab24155babef2cdd8d546afdc234a71e9ae66 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sat, 15 Feb 2025 13:22:58 +0100 Subject: [PATCH 15/21] chore: bump Coolify version to 4.0.0-beta.393 --- config/constants.php | 2 +- versions.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/constants.php b/config/constants.php index 2cf0123c0..65272720a 100644 --- a/config/constants.php +++ b/config/constants.php @@ -2,7 +2,7 @@ return [ 'coolify' => [ - 'version' => '4.0.0-beta.392', + 'version' => '4.0.0-beta.393', 'helper_version' => '1.0.6', 'realtime_version' => '1.0.5', 'self_hosted' => env('SELF_HOSTED', true), diff --git a/versions.json b/versions.json index e43c4736c..a4676829d 100644 --- a/versions.json +++ b/versions.json @@ -1,10 +1,10 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.392" + "version": "4.0.0-beta.393" }, "nightly": { - "version": "4.0.0-beta.393" + "version": "4.0.0-beta.394" }, "helper": { "version": "1.0.6" From ac62d94b994ae90b5f5513580eaf06b598c0206e Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 17 Feb 2025 09:52:03 +0100 Subject: [PATCH 16/21] chore: bump Coolify version to 4.0.0-beta.394 --- config/constants.php | 2 +- versions.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/constants.php b/config/constants.php index 65272720a..4a10d22ef 100644 --- a/config/constants.php +++ b/config/constants.php @@ -2,7 +2,7 @@ return [ 'coolify' => [ - 'version' => '4.0.0-beta.393', + 'version' => '4.0.0-beta.394', 'helper_version' => '1.0.6', 'realtime_version' => '1.0.5', 'self_hosted' => env('SELF_HOSTED', true), diff --git a/versions.json b/versions.json index a4676829d..9d3522fbe 100644 --- a/versions.json +++ b/versions.json @@ -1,10 +1,10 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.393" + "version": "4.0.0-beta.394" }, "nightly": { - "version": "4.0.0-beta.394" + "version": "4.0.0-beta.395" }, "helper": { "version": "1.0.6" From 6e802f43ba459678836f1e026d9bff820c89af2d Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 17 Feb 2025 09:52:18 +0100 Subject: [PATCH 17/21] fix(core): update service status refresh event handling --- app/Livewire/Project/Service/Configuration.php | 4 ++-- app/Livewire/Project/Service/Navbar.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Livewire/Project/Service/Configuration.php b/app/Livewire/Project/Service/Configuration.php index d1744b178..b36a860ce 100644 --- a/app/Livewire/Project/Service/Configuration.php +++ b/app/Livewire/Project/Service/Configuration.php @@ -32,7 +32,7 @@ class Configuration extends Component return [ "echo-private:user.{$userId},ServiceStatusChanged" => 'check_status', 'check_status', - 'refresh' => '$refresh', + 'refreshStatus' => '$refresh', ]; } @@ -99,7 +99,7 @@ class Configuration extends Component $this->service->databases->each(function ($database) { $database->refresh(); }); - $this->dispatch('refresh'); + $this->dispatch('refreshStatus'); } catch (\Exception $e) { return handleError($e, $this); } diff --git a/app/Livewire/Project/Service/Navbar.php b/app/Livewire/Project/Service/Navbar.php index e6a1271e1..5da425cbd 100644 --- a/app/Livewire/Project/Service/Navbar.php +++ b/app/Livewire/Project/Service/Navbar.php @@ -40,6 +40,7 @@ class Navbar extends Component return [ "echo-private:user.{$userId},ServiceStatusChanged" => 'serviceStarted', 'envsUpdated' => '$refresh', + 'refreshStatus' => '$refresh', ]; } From f02db2a3c5d8d725f50b75a17284ca2e3f1043eb Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 17 Feb 2025 09:52:27 +0100 Subject: [PATCH 18/21] fix(ui): adjust polling intervals for database and service status checks --- resources/views/livewire/project/database/heading.blade.php | 2 +- .../views/livewire/project/service/configuration.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/livewire/project/database/heading.blade.php b/resources/views/livewire/project/database/heading.blade.php index 9d34f7dcf..81346ca69 100644 --- a/resources/views/livewire/project/database/heading.blade.php +++ b/resources/views/livewire/project/database/heading.blade.php @@ -1,4 +1,4 @@ -