From 57a39f12bba7e25744c7cff5edaa38b7ed85a06a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 11 Dec 2023 14:56:11 +0100 Subject: [PATCH 1/4] version++ --- config/sentry.php | 2 +- config/version.php | 2 +- versions.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/sentry.php b/config/sentry.php index f86b5d19d..6ce447961 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ return [ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.155', + 'release' => '4.0.0-beta.156', // 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 aac53d846..0da84d93c 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ Date: Mon, 11 Dec 2023 15:08:40 +0100 Subject: [PATCH 2/4] fix: proxy logs --- app/Livewire/Project/Shared/GetLogs.php | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/Livewire/Project/Shared/GetLogs.php b/app/Livewire/Project/Shared/GetLogs.php index db2170b5f..220c6b9af 100644 --- a/app/Livewire/Project/Shared/GetLogs.php +++ b/app/Livewire/Project/Shared/GetLogs.php @@ -70,27 +70,27 @@ class GetLogs extends Component } public function getLogs($refresh = false) { - if (!$refresh && $this->resource->getMorphClass() === 'App\Models\Service') return; - if ($this->container) { - if ($this->showTimeStamps) { - $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} -t {$this->container}"); - } else { - $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} {$this->container}"); + if (!$refresh && $this->resource?->getMorphClass() === 'App\Models\Service') return; + if ($this->container) { + if ($this->showTimeStamps) { + $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} -t {$this->container}"); + } else { + $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} {$this->container}"); + } + if ($refresh) { + $this->outputs = ''; + } + Process::run($sshCommand, function (string $type, string $output) { + $this->doSomethingWithThisChunkOfOutput($output); + }); + if ($this->showTimeStamps) { + $this->outputs = str($this->outputs)->split('/\n/')->sort(function ($a, $b) { + $a = explode(' ', $a); + $b = explode(' ', $b); + return $a[0] <=> $b[0]; + })->join("\n"); + } } - if ($refresh) { - $this->outputs = ''; - } - Process::run($sshCommand, function (string $type, string $output) { - $this->doSomethingWithThisChunkOfOutput($output); - }); - if ($this->showTimeStamps) { - $this->outputs = str($this->outputs)->split('/\n/')->sort(function ($a, $b) { - $a = explode(' ', $a); - $b = explode(' ', $b); - return $a[0] <=> $b[0]; - })->join("\n"); - } - } } public function render() { From fe6e76ad0db2d8b8906cb345a587f3abb3374a45 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 11 Dec 2023 15:09:36 +0100 Subject: [PATCH 3/4] fix --- app/Livewire/Project/Shared/GetLogs.php | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/Livewire/Project/Shared/GetLogs.php b/app/Livewire/Project/Shared/GetLogs.php index 220c6b9af..e6f1ab009 100644 --- a/app/Livewire/Project/Shared/GetLogs.php +++ b/app/Livewire/Project/Shared/GetLogs.php @@ -70,27 +70,27 @@ class GetLogs extends Component } public function getLogs($refresh = false) { - if (!$refresh && $this->resource?->getMorphClass() === 'App\Models\Service') return; - if ($this->container) { - if ($this->showTimeStamps) { - $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} -t {$this->container}"); - } else { - $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} {$this->container}"); - } - if ($refresh) { - $this->outputs = ''; - } - Process::run($sshCommand, function (string $type, string $output) { - $this->doSomethingWithThisChunkOfOutput($output); - }); - if ($this->showTimeStamps) { - $this->outputs = str($this->outputs)->split('/\n/')->sort(function ($a, $b) { - $a = explode(' ', $a); - $b = explode(' ', $b); - return $a[0] <=> $b[0]; - })->join("\n"); - } + if (!$refresh && $this->resource?->getMorphClass() === 'App\Models\Service') return; + if ($this->container) { + if ($this->showTimeStamps) { + $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} -t {$this->container}"); + } else { + $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} {$this->container}"); } + if ($refresh) { + $this->outputs = ''; + } + Process::run($sshCommand, function (string $type, string $output) { + $this->doSomethingWithThisChunkOfOutput($output); + }); + if ($this->showTimeStamps) { + $this->outputs = str($this->outputs)->split('/\n/')->sort(function ($a, $b) { + $a = explode(' ', $a); + $b = explode(' ', $b); + return $a[0] <=> $b[0]; + })->join("\n"); + } + } } public function render() { From 47202a7951e4ad6db335f21c8cd9cd117f72e6a4 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 11 Dec 2023 15:23:41 +0100 Subject: [PATCH 4/4] fix: db status check --- app/Http/Controllers/Controller.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index ee0bc5160..08f7a7376 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -79,11 +79,11 @@ class Controller extends BaseController if (isInstanceAdmin()) { $settings = InstanceSettings::get(); $database = StandalonePostgresql::whereName('coolify-db')->first(); - if ($database->status !== 'running') { - $database->status = 'running'; - $database->save(); - } if ($database) { + if ($database->status !== 'running') { + $database->status = 'running'; + $database->save(); + } $s3s = S3Storage::whereTeamId(0)->get(); } return view('settings.configuration', [