id)->where('is_ca_certificate', true)->first(); if (! $existingCert) { $serverCert = SslHelper::generateSslCertificate( commonName: 'Coolify CA Certificate', serverId: $server->id, isCaCertificate: true, validityDays: 15 * 365 ); $serverCertPath = config('constants.coolify.base_config_path').'/ssl/'; $commands = collect([ "mkdir -p $serverCertPath", "chown -R 9999:root $serverCertPath", "chmod -R 700 $serverCertPath", "echo '{$serverCert->ssl_certificate}' > $serverCertPath/coolify-ca.crt", "chmod 644 $serverCertPath/coolify-ca.crt", ]); remote_process($commands, $server); } } }); } }