diff --git a/app/Actions/Database/StartMariadb.php b/app/Actions/Database/StartMariadb.php index 50fd1ab00..b10ae3fde 100644 --- a/app/Actions/Database/StartMariadb.php +++ b/app/Actions/Database/StartMariadb.php @@ -59,7 +59,7 @@ class StartMariadb $this->commands[] = "mkdir -p $this->configuration_dir/ssl"; $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(); diff --git a/app/Actions/Database/StartMysql.php b/app/Actions/Database/StartMysql.php index bec1c7fb1..bda01dc1d 100644 --- a/app/Actions/Database/StartMysql.php +++ b/app/Actions/Database/StartMysql.php @@ -59,7 +59,7 @@ class StartMysql $this->commands[] = "mkdir -p $this->configuration_dir/ssl"; $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(); diff --git a/app/Actions/Database/StartPostgresql.php b/app/Actions/Database/StartPostgresql.php index 75f43a5ee..8f4bcb0d9 100644 --- a/app/Actions/Database/StartPostgresql.php +++ b/app/Actions/Database/StartPostgresql.php @@ -64,7 +64,7 @@ class StartPostgresql $this->commands[] = "mkdir -p $this->configuration_dir/ssl"; $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(); diff --git a/app/Actions/Server/InstallDocker.php b/app/Actions/Server/InstallDocker.php index 122371cf6..bbb3ea066 100644 --- a/app/Actions/Server/InstallDocker.php +++ b/app/Actions/Server/InstallDocker.php @@ -20,10 +20,10 @@ class InstallDocker throw new \Exception('Server OS type is not supported for automated installation. Please install Docker manually before continuing: documentation.'); } - 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( commonName: 'Coolify CA Certificate', - serverId: $server->server_id, + serverId: $server->id, isCaCertificate: true, validityDays: 15 * 365 ); diff --git a/app/Livewire/Server/Advanced.php b/app/Livewire/Server/Advanced.php index 73a4391e6..497ec697e 100644 --- a/app/Livewire/Server/Advanced.php +++ b/app/Livewire/Server/Advanced.php @@ -49,7 +49,7 @@ class Advanced extends Component 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) { $this->certificateContent = $this->caCertificate->ssl_certificate; diff --git a/database/seeders/CaSslCertSeeder.php b/database/seeders/CaSslCertSeeder.php index 4a9d59eb2..b869ff96a 100644 --- a/database/seeders/CaSslCertSeeder.php +++ b/database/seeders/CaSslCertSeeder.php @@ -13,7 +13,7 @@ class CaSslCertSeeder extends Seeder { Server::chunk(200, function ($servers) { 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) { $caCert = SslHelper::generateSslCertificate(