Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat(databases): add CA SSL crt location to Postgres URLs

peaklabs-dev9d9fbd6859a1
diff --git a/app/Models/StandalonePostgresql.php b/app/Models/StandalonePostgresql.php
index 7e8a071f3e..b4b7ca59fa 100644
--- a/app/Models/StandalonePostgresql.php
+++ b/app/Models/StandalonePostgresql.php
@@ -223,6 +223,9 @@ class StandalonePostgresql extends BaseModel
$url = "postgres://{$this->postgres_user}:{$this->postgres_password}@{$this->uuid}:5432/{$this->postgres_db}";
if ($this->enable_ssl) {
$url .= "?sslmode={$this->ssl_mode}";
+ if (in_array($this->ssl_mode, ['verify-ca', 'verify-full'])) {
+ $url .= '&sslrootcert=/etc/ssl/certs/coolify-ca.crt';
+ }
}
return $url;
@@ -238,6 +241,9 @@ class StandalonePostgresql extends BaseModel
$url = "postgres://{$this->postgres_user}:{$this->postgres_password}@{$this->destination->server->getIp}:{$this->public_port}/{$this->postgres_db}";
if ($this->enable_ssl) {
$url .= "?sslmode={$this->ssl_mode}";
+ if (in_array($this->ssl_mode, ['verify-ca', 'verify-full'])) {
+ $url .= '&sslrootcert=/etc/ssl/certs/coolify-ca.crt';
+ }
}
return $url;