diff --git a/app/Actions/Server/UpdateCoolify.php b/app/Actions/Server/UpdateCoolify.php index 72ce80b6b..8910d6e97 100644 --- a/app/Actions/Server/UpdateCoolify.php +++ b/app/Actions/Server/UpdateCoolify.php @@ -4,6 +4,8 @@ namespace App\Actions\Server; use App\Models\InstanceSettings; use App\Models\Server; +use Illuminate\Support\Facades\File; +use Illuminate\Support\Facades\Http; use Lorisleiva\Actions\Concerns\AsAction; class UpdateCoolify @@ -25,6 +27,11 @@ class UpdateCoolify return; } CleanupDocker::dispatch($this->server, false)->onQueue('high'); + $response = Http::retry(3, 1000)->get('https://cdn.coollabs.io/coolify/versions.json'); + if ($response->successful()) { + $versions = $response->json(); + File::put(base_path('versions.json'), json_encode($versions, JSON_PRETTY_PRINT)); + } $this->latestVersion = get_latest_version_of_coolify(); $this->currentVersion = config('version'); if (! $manual_update) { @@ -39,6 +46,8 @@ class UpdateCoolify } } $this->update(); + $settings->new_version_available = false; + $settings->save(); } catch (\Throwable $e) { throw $e; } diff --git a/app/Jobs/ServerCheckJob.php b/app/Jobs/ServerCheckJob.php index 3976477e7..1db15cfd4 100644 --- a/app/Jobs/ServerCheckJob.php +++ b/app/Jobs/ServerCheckJob.php @@ -43,15 +43,15 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue public function __construct(public Server $server) {} - public function middleware(): array - { - return [(new WithoutOverlapping($this->server->uuid))]; - } + // public function middleware(): array + // { + // return [(new WithoutOverlapping($this->server->uuid))]; + // } - public function uniqueId(): int - { - return $this->server->uuid; - } + // public function uniqueId(): int + // { + // return $this->server->uuid; + // } public function handle() { diff --git a/app/Livewire/SettingsBackup.php b/app/Livewire/SettingsBackup.php index da3aee491..99b8f8d49 100644 --- a/app/Livewire/SettingsBackup.php +++ b/app/Livewire/SettingsBackup.php @@ -16,7 +16,7 @@ class SettingsBackup extends Component public $s3s; - public StandalonePostgresql|null|array $database = []; + public ?StandalonePostgresql $database = null; public ScheduledDatabaseBackup|null|array $backup = []; @@ -43,19 +43,19 @@ class SettingsBackup extends Component { if (isInstanceAdmin()) { $settings = InstanceSettings::get(); - $database = StandalonePostgresql::whereName('coolify-db')->first(); + $this->database = StandalonePostgresql::whereName('coolify-db')->first(); $s3s = S3Storage::whereTeamId(0)->get() ?? []; - if ($database) { - if ($database->status !== 'running') { - $database->status = 'running'; - $database->save(); + if ($this->database) { + if ($this->database->status !== 'running') { + $this->database->status = 'running'; + $this->database->save(); } - $this->database = $database; + $this->backup = $this->database->scheduledBackups->first(); + $this->executions = $this->backup->executions; } $this->settings = $settings; $this->s3s = $s3s; - $this->backup = $this->database?->scheduledBackups?->first() ?? null; - $this->executions = $this->backup?->executions ?? []; + } else { return redirect()->route('dashboard'); } diff --git a/app/Models/Server.php b/app/Models/Server.php index 99dca3ecf..8a7325beb 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -715,8 +715,8 @@ $schema://$host { } return [ - 'containers' => $containers ?? collect([]), - 'containerReplicates' => $containerReplicates ?? collect([]), + 'containers' => collect($containers) ?? collect([]), + 'containerReplicates' => collect($containerReplicates) ?? collect([]), ]; } diff --git a/bootstrap/helpers/constants.php b/bootstrap/helpers/constants.php index 24e596a0f..f94c9bc20 100644 --- a/bootstrap/helpers/constants.php +++ b/bootstrap/helpers/constants.php @@ -9,6 +9,11 @@ const VALID_CRON_STRINGS = [ 'weekly' => '0 0 * * 0', 'monthly' => '0 0 1 * *', 'yearly' => '0 0 1 1 *', + '@hourly' => '0 * * * *', + '@daily' => '0 0 * * *', + '@weekly' => '0 0 * * 0', + '@monthly' => '0 0 1 * *', + '@yearly' => '0 0 1 1 *', ]; const RESTART_MODE = 'unless-stopped'; diff --git a/bootstrap/helpers/proxy.php b/bootstrap/helpers/proxy.php index f18b09f56..e50983535 100644 --- a/bootstrap/helpers/proxy.php +++ b/bootstrap/helpers/proxy.php @@ -1,6 +1,7 @@ '4.0.0-beta.320', + 'release' => '4.0.0-beta.323', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index 05acb11ca..73f3e1263 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ - + @if ($s3s->count() === 0) diff --git a/resources/views/livewire/project/shared/scheduled-task/add.blade.php b/resources/views/livewire/project/shared/scheduled-task/add.blade.php index 9e9af07bf..24b89c519 100644 --- a/resources/views/livewire/project/shared/scheduled-task/add.blade.php +++ b/resources/views/livewire/project/shared/scheduled-task/add.blade.php @@ -1,7 +1,9 @@
- + @if ($type === 'application') @if ($containerNames->count() > 1) diff --git a/resources/views/livewire/settings-backup.blade.php b/resources/views/livewire/settings-backup.blade.php index bf29481cc..9eb34e8b7 100644 --- a/resources/views/livewire/settings-backup.blade.php +++ b/resources/views/livewire/settings-backup.blade.php @@ -14,7 +14,7 @@
Backup configuration for Coolify instance.
- @if (isset($database)) + @if (isset($database) && isset($backup))
@@ -27,14 +27,15 @@
+
+ +
@else To configure automatic backup for your Coolify instance, you first need to add a database resource into Coolify. Add Database @endif
-
- -
+ diff --git a/resources/views/livewire/settings/index.blade.php b/resources/views/livewire/settings/index.blade.php index 906ac1aad..d53db6a98 100644 --- a/resources/views/livewire/settings/index.blade.php +++ b/resources/views/livewire/settings/index.blade.php @@ -60,13 +60,13 @@
+ helper="Cron expression for update check frequency (check for new Coolify versions and pull new Service Templates from CDN).
You can use every_minute, hourly, daily, weekly, monthly, yearly.

Default is every hour." /> Check Manually
@if (is_null(env('AUTOUPDATE', null)) && $is_auto_update_enabled) + helper="Cron expression for auto update frequency (automatically update coolify).
You can use every_minute, hourly, daily, weekly, monthly, yearly.

Default is every day at 00:00" /> @endif diff --git a/versions.json b/versions.json index b86aa7790..eceb95203 100644 --- a/versions.json +++ b/versions.json @@ -1,7 +1,7 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.320" + "version": "4.0.0-beta.323" } } -} \ No newline at end of file +}