fix(ssl): ger caCert and mountPath correctly
This commit is contained in:
@@ -169,10 +169,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,
|
||||
@@ -180,10 +177,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: '/var/lib/mysql/certs',
|
||||
mountPath: $existingCert->mount_path,
|
||||
);
|
||||
|
||||
$this->dispatch('success', 'SSL certificates have been regenerated. Please restart the database for changes to take effect.');
|
||||
|
||||
@@ -169,10 +169,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,
|
||||
@@ -180,10 +177,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: '/var/lib/mysql/certs',
|
||||
mountPath: $existingCert->mount_path,
|
||||
);
|
||||
|
||||
$this->dispatch('success', 'SSL certificates have been regenerated. Please restart the database for changes to take effect.');
|
||||
|
||||
@@ -133,10 +133,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,
|
||||
@@ -144,10 +141,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: '/var/lib/postgresql/certs',
|
||||
mountPath: $existingCert->mount_path,
|
||||
);
|
||||
|
||||
$this->dispatch('success', 'SSL certificates have been regenerated. Please restart the database for changes to take effect.');
|
||||
|
||||
Reference in New Issue
Block a user