server = Server::find(0); if (!$this->server) { return; } CleanupDocker::dispatch($this->server, false)->onQueue('high'); $this->latestVersion = get_latest_version_of_coolify(); $this->currentVersion = config('version'); if (!$manual_update) { if (!$settings->is_auto_update_enabled) { return; } if ($this->latestVersion === $this->currentVersion) { return; } if (version_compare($this->latestVersion, $this->currentVersion, '<')) { return; } } $this->update(); } catch (\Throwable $e) { throw $e; } } private function update() { if (isDev()) { ray('Running in dev mode'); remote_process([ "sleep 10" ], $this->server); ray('Update done'); return; } else { ray('Running update on production server'); remote_process([ "curl -fsSL https://cdn.lasthourhosting.org/lasthourcloud/scripts/upgrade.sh -o /data/coolify/source/upgrade.sh", "bash /data/coolify/source/upgrade.sh $this->latestVersion" ], $this->server); return; } remote_process([ 'curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o /data/coolify/source/upgrade.sh', "bash /data/coolify/source/upgrade.sh $this->latestVersion", ], $this->server); } }