diff --git a/app/Livewire/Project/Database/Postgresql/General.php b/app/Livewire/Project/Database/Postgresql/General.php index 88dd5c1a8..25f3f4f30 100644 --- a/app/Livewire/Project/Database/Postgresql/General.php +++ b/app/Livewire/Project/Database/Postgresql/General.php @@ -48,6 +48,8 @@ class General extends Component 'database.public_port' => 'nullable|integer', 'database.is_log_drain_enabled' => 'nullable|boolean', 'database.custom_docker_run_options' => 'nullable', + 'database.enable_ssl' => 'boolean', + 'database.ssl_mode' => 'nullable|string|in:allow,prefer,require,verify-ca,verify-full', ]; protected $validationAttributes = [ @@ -65,6 +67,8 @@ class General extends Component 'database.is_public' => 'Is Public', 'database.public_port' => 'Public Port', 'database.custom_docker_run_options' => 'Custom Docker Run Options', + 'database.enable_ssl' => 'Enable SSL', + 'database.ssl_mode' => 'SSL Mode', ]; public function mount() @@ -91,6 +95,18 @@ class General extends Component } } + public function instantSaveSSL() + { + try { + $this->database->enable_ssl = $this->database->enable_ssl; + $this->database->ssl_mode = $this->database->ssl_mode; + $this->database->save(); + $this->dispatch('success', 'SSL configuration updated.'); + } catch (Exception $e) { + return handleError($e, $this); + } + } + public function instantSave() { try { diff --git a/resources/views/livewire/project/database/postgresql/general.blade.php b/resources/views/livewire/project/database/postgresql/general.blade.php index 5abde2b01..ec29584fe 100644 --- a/resources/views/livewire/project/database/postgresql/general.blade.php +++ b/resources/views/livewire/project/database/postgresql/general.blade.php @@ -73,58 +73,81 @@ type="password" readonly wire:model="db_url_public" /> @endif -
-
-
-
-

Proxy

- -
- @if (data_get($database, 'is_public')) - - Proxy Logs - - - - Logs - - @endif -
- -
- -
- - -

Advanced

-
- -
-
-
-

Initialization scripts

- -
- - - - Save - - -
-
- @forelse(data_get($database,'init_scripts', []) as $script) - - @empty -
No initialization scripts found.
- @endforelse +

SSL Configuration

+
+ + @if($database->enable_ssl) + + + + + + + + @endif +
+
+ +
+
+
+

Proxy

+ +
+ @if (data_get($database, 'is_public')) + + Proxy Logs + + + + Logs + + @endif +
+
+ + +
+
+ +
+ +
+ + +
+

Advanced

+
+ +
+ +
+
+

Initialization scripts

+ +
+ + + + Save + + +
+
+
+ @forelse(data_get($database,'init_scripts', []) as $script) + + @empty +
No initialization scripts found.
+ @endforelse +
-