fix(ssl): server id
This commit is contained in:
@@ -59,7 +59,7 @@ class StartMariadb
|
|||||||
$this->commands[] = "mkdir -p $this->configuration_dir/ssl";
|
$this->commands[] = "mkdir -p $this->configuration_dir/ssl";
|
||||||
|
|
||||||
$server = $this->database->destination->server;
|
$server = $this->database->destination->server;
|
||||||
$caCert = SslCertificate::where('server_id', $server->server_id)->where('is_ca_certificate', true)->first();
|
$caCert = SslCertificate::where('server_id', $server->id)->where('is_ca_certificate', true)->first();
|
||||||
|
|
||||||
$this->ssl_certificate = SslCertificate::where('resource_type', $this->database->getMorphClass())->where('resource_id', $this->database->id)->first();
|
$this->ssl_certificate = SslCertificate::where('resource_type', $this->database->getMorphClass())->where('resource_id', $this->database->id)->first();
|
||||||
|
|
||||||
|
@@ -59,7 +59,7 @@ class StartMysql
|
|||||||
$this->commands[] = "mkdir -p $this->configuration_dir/ssl";
|
$this->commands[] = "mkdir -p $this->configuration_dir/ssl";
|
||||||
|
|
||||||
$server = $this->database->destination->server;
|
$server = $this->database->destination->server;
|
||||||
$caCert = SslCertificate::where('server_id', $server->server_id)->where('is_ca_certificate', true)->first();
|
$caCert = SslCertificate::where('server_id', $server->id)->where('is_ca_certificate', true)->first();
|
||||||
|
|
||||||
$this->ssl_certificate = SslCertificate::where('resource_type', $this->database->getMorphClass())->where('resource_id', $this->database->id)->first();
|
$this->ssl_certificate = SslCertificate::where('resource_type', $this->database->getMorphClass())->where('resource_id', $this->database->id)->first();
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ class StartPostgresql
|
|||||||
$this->commands[] = "mkdir -p $this->configuration_dir/ssl";
|
$this->commands[] = "mkdir -p $this->configuration_dir/ssl";
|
||||||
|
|
||||||
$server = $this->database->destination->server;
|
$server = $this->database->destination->server;
|
||||||
$caCert = SslCertificate::where('server_id', $server->server_id)->where('is_ca_certificate', true)->first();
|
$caCert = SslCertificate::where('server_id', $server->id)->where('is_ca_certificate', true)->first();
|
||||||
|
|
||||||
$this->ssl_certificate = SslCertificate::where('resource_type', $this->database->getMorphClass())->where('resource_id', $this->database->id)->first();
|
$this->ssl_certificate = SslCertificate::where('resource_type', $this->database->getMorphClass())->where('resource_id', $this->database->id)->first();
|
||||||
|
|
||||||
|
@@ -20,10 +20,10 @@ class InstallDocker
|
|||||||
throw new \Exception('Server OS type is not supported for automated installation. Please install Docker manually before continuing: <a target="_blank" class="underline" href="https://coolify.io/docs/installation#manually">documentation</a>.');
|
throw new \Exception('Server OS type is not supported for automated installation. Please install Docker manually before continuing: <a target="_blank" class="underline" href="https://coolify.io/docs/installation#manually">documentation</a>.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! SslCertificate::where('server_id', $server->server_id)->where('is_ca_certificate', true)->exists()) {
|
if (! SslCertificate::where('server_id', $server->id)->where('is_ca_certificate', true)->exists()) {
|
||||||
$serverCert = SslHelper::generateSslCertificate(
|
$serverCert = SslHelper::generateSslCertificate(
|
||||||
commonName: 'Coolify CA Certificate',
|
commonName: 'Coolify CA Certificate',
|
||||||
serverId: $server->server_id,
|
serverId: $server->id,
|
||||||
isCaCertificate: true,
|
isCaCertificate: true,
|
||||||
validityDays: 15 * 365
|
validityDays: 15 * 365
|
||||||
);
|
);
|
||||||
|
@@ -49,7 +49,7 @@ class Advanced extends Component
|
|||||||
|
|
||||||
public function loadCaCertificate()
|
public function loadCaCertificate()
|
||||||
{
|
{
|
||||||
$this->caCertificate = SslCertificate::where('server_id', $this->server->server_id)->where('is_ca_certificate', true)->first();
|
$this->caCertificate = SslCertificate::where('server_id', $this->server->id)->where('is_ca_certificate', true)->first();
|
||||||
|
|
||||||
if ($this->caCertificate) {
|
if ($this->caCertificate) {
|
||||||
$this->certificateContent = $this->caCertificate->ssl_certificate;
|
$this->certificateContent = $this->caCertificate->ssl_certificate;
|
||||||
|
@@ -13,7 +13,7 @@ class CaSslCertSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
Server::chunk(200, function ($servers) {
|
Server::chunk(200, function ($servers) {
|
||||||
foreach ($servers as $server) {
|
foreach ($servers as $server) {
|
||||||
$existingCaCert = SslCertificate::where('server_id', $server->server_id)->where('is_ca_certificate', true)->first();
|
$existingCaCert = SslCertificate::where('server_id', $server->id)->where('is_ca_certificate', true)->first();
|
||||||
|
|
||||||
if (! $existingCaCert) {
|
if (! $existingCaCert) {
|
||||||
$caCert = SslHelper::generateSslCertificate(
|
$caCert = SslHelper::generateSslCertificate(
|
||||||
|
Reference in New Issue
Block a user