feat(ssl): improve Redis and remove modes
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user