Skip to content

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.

feat(ssl): improve Redis and remove modes

peaklabs-dev4547647e983e
diff --git a/app/Actions/Database/StartRedis.php b/app/Actions/Database/StartRedis.php
index fee80be2be..edc7e0ccef 100644
--- a/app/Actions/Database/StartRedis.php
+++ b/app/Actions/Database/StartRedis.php
@@ -98,22 +98,11 @@ class StartRedis
],
'labels' => defaultDatabaseLabels($this->database)->toArray(),
'healthcheck' => [
- 'test' => $this->database->enable_ssl
- ? [
- 'CMD-SHELL',
- 'redis-cli',
- '--tls',
- '--cacert /etc/redis/certs/coolify-ca.crt',
- '--cert /etc/redis/certs/server.crt',
- '--key /etc/redis/certs/server.key',
- '-p 6380',
- 'ping',
- ]
- : [
- 'CMD-SHELL',
- 'redis-cli',
- 'ping',
- ],
+ 'test' => [
+ 'CMD-SHELL',
+ 'redis-cli',
+ 'ping',
+ ],
'interval' => '5s',
'timeout' => '5s',
'retries' => 10,
@@ -294,23 +283,13 @@ class StartRedis
}
if ($this->database->enable_ssl) {
- $sslArgs = match ($this->database->ssl_mode) {
- 'require' => [
- '--tls-port 6380',
- '--tls-cert-file /etc/redis/certs/server.crt',
- '--tls-key-file /etc/redis/certs/server.key',
- '--tls-ca-cert-file /etc/redis/certs/coolify-ca.crt',
- '--tls-auth-clients no',
- ],
- 'verify-ca' => [
- '--tls-port 6380',
- '--tls-cert-file /etc/redis/certs/server.crt',
- '--tls-key-file /etc/redis/certs/server.key',
- '--tls-ca-cert-file /etc/redis/certs/coolify-ca.crt',
- '--tls-auth-clients yes',
- ],
- default => []
- };
+ $sslArgs = [
+ '--tls-port 6380',
+ '--tls-cert-file /etc/redis/certs/server.crt',
+ '--tls-key-file /etc/redis/certs/server.key',
+ '--tls-ca-cert-file /etc/redis/certs/coolify-ca.crt',
+ '--tls-auth-clients optional',
+ ];
}
if (! empty($sslArgs)) {
diff --git a/app/Livewire/Project/Database/Redis/General.php b/app/Livewire/Project/Database/Redis/General.php
index 71fbd5887f..ea896e2943 100644
--- a/app/Livewire/Project/Database/Redis/General.php
+++ b/app/Livewire/Project/Database/Redis/General.php
@@ -47,7 +47,6 @@ class General extends Component
'redis_username' => 'required',
'redis_password' => 'required',
'database.enable_ssl' => 'boolean',
- 'database.ssl_mode' => 'nullable|string|in:require,verify-ca',
];
protected $validationAttributes = [
@@ -62,7 +61,6 @@ class General extends Component
'redis_username' => 'Redis Username',
'redis_password' => 'Redis Password',
'database.enable_ssl' => 'Enable SSL',
- 'database.ssl_mode' => 'SSL Mode',
];
public function mount()
@@ -155,7 +153,6 @@ class General extends Component
{
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) {
diff --git a/resources/views/livewire/project/database/redis/general.blade.php b/resources/views/livewire/project/database/redis/general.blade.php
index 28aa8dbba3..a6cae8e38d 100644
--- a/resources/views/livewire/project/database/redis/general.blade.php
+++ b/resources/views/livewire/project/database/redis/general.blade.php
@@ -81,13 +81,6 @@
@endif
<div class="flex flex-col gap-2">
<x-forms.checkbox id="database.enable_ssl" label="Enable SSL" wire:model.live="database.enable_ssl" instantSave="instantSaveSSL" />
- @if($database->enable_ssl)
- <x-forms.select id="database.ssl_mode" label="SSL Mode" wire:model.live="database.ssl_mode" instantSave="instantSaveSSL"
- helper="Choose the SSL verification mode for Redis connections">
- <option value="require">require</option>
- <option value="verify-ca">verify-ca</option>
- </x-forms.select>
- @endif
</div>
</div>
<div>