An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix
Andras Bacsaib7dffc8594a1
diff --git a/app/Http/Livewire/ForceUpgrade.php b/app/Http/Livewire/ForceUpgrade.phpindex 80dc03fb94..be4a99bfdd 100644--- a/app/Http/Livewire/ForceUpgrade.php+++ b/app/Http/Livewire/ForceUpgrade.php@@ -3,13 +3,23 @@namespace App\Http\Livewire;use App\Jobs\InstanceAutoUpdateJob;+use App\Models\Server;use Livewire\Component;class ForceUpgrade extends Component{public function upgrade(){- $this->emit('updateInitiated');- dispatch(new InstanceAutoUpdateJob(force: true));+ try {+ $server_name = 'localhost';+ if (config('app.env') === 'local') {+ $server_name = 'testing-local-docker-container';+ }+ $server = Server::where('name', $server_name)->firstOrFail();+ $this->emit('updateInitiated');+ dispatch(new InstanceAutoUpdateJob(force: true, server: $server));+ } catch (\Exception $e) {+ return general_error_handler($e, $this);+ }}}diff --git a/app/Jobs/InstanceAutoUpdateJob.php b/app/Jobs/InstanceAutoUpdateJob.phpindex 8d5840dd43..cbe5096936 100644--- a/app/Jobs/InstanceAutoUpdateJob.php+++ b/app/Jobs/InstanceAutoUpdateJob.php@@ -2,7 +2,6 @@namespace App\Jobs;-use App\Enums\ActivityTypes;use App\Models\InstanceSettings;use App\Models\Server;use Illuminate\Bus\Queueable;@@ -19,29 +18,27 @@ class InstanceAutoUpdateJob implements ShouldQueueprivate string $latest_version;private string $current_version;private Server $server;- private string $server_name = 'localhost';- public function __construct(private bool $force = false)+ public function __construct(private bool $force = false, Server|null $server = null){- if (config('app.env') === 'local') {- $this->server_name = 'coolify-testing-host';+ if (is_null($server)) {+ if (config('app.env') === 'local') {+ $server_name = 'testing-local-docker-container';+ } else {+ $server_name = 'localhost';+ }+ $this->server = Server::where('name', $server_name)->first();+ } else {+ $this->server = $server;}-$instance_settings = InstanceSettings::get();- $this->server = Server::where('name', $this->server_name)->firstOrFail();- Log::info('Force: ' . $this->force);$this->latest_version = get_latest_version_of_coolify();- Log::info('Latest version: ' . $this->latest_version);$this->current_version = config('version');- Log::info('Current version: ' . $this->current_version);-if (!$this->force) {- Log::info("Checking if auto update enabled");- if (!$instance_settings->is_auto_update_enabled || !$this->server) {+ if (!$instance_settings->is_auto_update_enabled) {return $this->delete();}- Log::info('Checking if update available');try {$this->check_if_update_available();} catch (\Exception $e) {@@ -70,11 +67,9 @@ class InstanceAutoUpdateJob implements ShouldQueue"sleep 10"], $this->server);} else {- Log::info('Downloading upgrade script');instant_remote_process(["curl -fsSL https://coolify-cdn.b-cdn.net/files/upgrade.sh -o /data/coolify/source/upgrade.sh",], $this->server);- Log::info('Running upgrade script');remote_process(["bash /data/coolify/source/upgrade.sh $this->latest_version"], $this->server);