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)); } $latest_version = get_latest_version_of_coolify(); instant_remote_process(["docker pull -q ghcr.io/coollabsio/coolify:{$latest_version}"], $server, false); $settings = \App\Models\InstanceSettings::get(); $current_version = config('version'); if (! $settings->is_auto_update_enabled) { return; } if ($latest_version === $current_version) { return; } if (version_compare($latest_version, $current_version, '<')) { return; } instant_remote_process([ 'curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o /data/coolify/source/upgrade.sh', "bash /data/coolify/source/upgrade.sh $latest_version", ], $server); } catch (\Throwable $e) { throw $e; } } }