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(database): guard proxy listeners without a team
Andras Bacsaic35d28f99b61
diff --git a/app/Livewire/Project/Database/Clickhouse/General.php b/app/Livewire/Project/Database/Clickhouse/General.phpindex 8573009266..6946743266 100644--- a/app/Livewire/Project/Database/Clickhouse/General.php+++ b/app/Livewire/Project/Database/Clickhouse/General.php@@ -42,12 +42,19 @@ class General extends Componentpublic bool $isLogDrainEnabled = false;- public function getListeners()+ public function getListeners(): array{- $teamId = Auth::user()->currentTeam()->id;+ $user = Auth::user();+ if (! $user) {+ return [];+ }+ $team = $user->currentTeam();+ if (! $team) {+ return [];+ }return [- "echo-private:team.{$teamId},DatabaseProxyStopped" => 'databaseProxyStopped',+ "echo-private:team.{$team->id},DatabaseProxyStopped" => 'databaseProxyStopped',];}diff --git a/app/Livewire/Project/Database/Dragonfly/General.php b/app/Livewire/Project/Database/Dragonfly/General.phpindex 01a474761e..f196b9dfb1 100644--- a/app/Livewire/Project/Database/Dragonfly/General.php+++ b/app/Livewire/Project/Database/Dragonfly/General.php@@ -40,12 +40,19 @@ class General extends Componentpublic bool $isLogDrainEnabled = false;- public function getListeners()+ public function getListeners(): array{- $teamId = Auth::user()->currentTeam()->id;+ $user = Auth::user();+ if (! $user) {+ return [];+ }+ $team = $user->currentTeam();+ if (! $team) {+ return [];+ }return [- "echo-private:team.{$teamId},DatabaseProxyStopped" => 'databaseProxyStopped',+ "echo-private:team.{$team->id},DatabaseProxyStopped" => 'databaseProxyStopped',];}diff --git a/app/Livewire/Project/Database/Keydb/General.php b/app/Livewire/Project/Database/Keydb/General.phpindex 6031cb7ac1..974803e8d3 100644--- a/app/Livewire/Project/Database/Keydb/General.php+++ b/app/Livewire/Project/Database/Keydb/General.php@@ -42,12 +42,19 @@ class General extends Componentpublic bool $isLogDrainEnabled = false;- public function getListeners()+ public function getListeners(): array{- $teamId = Auth::user()->currentTeam()->id;+ $user = Auth::user();+ if (! $user) {+ return [];+ }+ $team = $user->currentTeam();+ if (! $team) {+ return [];+ }return [- "echo-private:team.{$teamId},DatabaseProxyStopped" => 'databaseProxyStopped',+ "echo-private:team.{$team->id},DatabaseProxyStopped" => 'databaseProxyStopped',];}diff --git a/resources/views/components/database-status-info.blade.php b/resources/views/components/database-status-info.blade.phpindex a7c8dade1d..4a9de3ca57 100644--- a/resources/views/components/database-status-info.blade.php+++ b/resources/views/components/database-status-info.blade.php@@ -63,7 +63,7 @@@else<x-forms.checkbox id="enableSsl" label="Enable SSL" wire:model.live="enableSsl"instantSave="instantSaveSSL" disabled- helper="Database should be stopped to change this settings." canGate="update"+ helper="Database should be stopped to change this setting." canGate="update":canResource="$database" />@endif</div>@@ -79,7 +79,7 @@</x-forms.select>@else<x-forms.select id="sslMode" label="SSL Mode" instantSave="instantSaveSSL" disabled- helper="Database should be stopped to change this settings." canGate="update"+ helper="Database should be stopped to change this setting." canGate="update":canResource="$database">@foreach ($sslModeOptions as $value => $option)<option value="{{ $value }}" title="{{ $option['title'] ?? '' }}">{{ $option['label'] }}</option>