feat(ssl): new modes for MongoDB and get caCert and mountPath correctly
This commit is contained in:
@@ -39,7 +39,7 @@ class General extends Component
|
||||
'database.is_log_drain_enabled' => 'nullable|boolean',
|
||||
'database.custom_docker_run_options' => 'nullable',
|
||||
'database.enable_ssl' => 'boolean',
|
||||
'database.ssl_mode' => 'nullable|string|in:allowSSL,preferSSL,requireSSL,verifyCA,verifyFull',
|
||||
'database.ssl_mode' => 'nullable|string|in:allow,prefer,require,verify-ca,verify-full',
|
||||
];
|
||||
|
||||
protected $validationAttributes = [
|
||||
@@ -170,10 +170,7 @@ class General extends Component
|
||||
return;
|
||||
}
|
||||
|
||||
$caCertificate = SslCertificate::where('server_id', $this->server->id)
|
||||
->where('resource_type', null)
|
||||
->where('resource_id', null)
|
||||
->first();
|
||||
$caCert = SslCertificate::where('server_id', $existingCert->server_id)->where('is_ca_certificate', true)->first();
|
||||
|
||||
SslHelper::generateSslCertificate(
|
||||
commonName: $existingCert->common_name,
|
||||
@@ -181,10 +178,10 @@ class General extends Component
|
||||
resourceType: $existingCert->resource_type,
|
||||
resourceId: $existingCert->resource_id,
|
||||
serverId: $existingCert->server_id,
|
||||
caCert: $caCertificate->ssl_certificate,
|
||||
caKey: $caCertificate->ssl_private_key,
|
||||
caCert: $caCert->ssl_certificate,
|
||||
caKey: $caCert->ssl_private_key,
|
||||
configurationDir: $existingCert->configuration_dir,
|
||||
mountPath: '/etc/mongo/certs',
|
||||
mountPath: $existingCert->mount_path,
|
||||
);
|
||||
|
||||
$this->dispatch('success', 'SSL certificates have been regenerated. Please restart the database for changes to take effect.');
|
||||
|
||||
@@ -92,11 +92,11 @@
|
||||
<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 MongoDB connections">
|
||||
<option value="allowSSL">allowSSL</option>
|
||||
<option value="preferSSL">preferSSL</option>
|
||||
<option value="requireSSL">requireSSL</option>
|
||||
<option value="verifyCA">verifyCA</option>
|
||||
<option value="verifyFull">verifyFull</option>
|
||||
<option value="allow">allow</option>
|
||||
<option value="prefer">prefer</option>
|
||||
<option value="require">require</option>
|
||||
<option value="verify-ca">verify-ca</option>
|
||||
<option value="verify-full">verify-full</option>
|
||||
</x-forms.select>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user