feat(databases): add CA SSL crt location to Postgres URLs
This commit is contained in:
parent
498bf04559
commit
9d9fbd6859
1 changed files with 6 additions and 0 deletions
|
|
@ -223,6 +223,9 @@ protected function internalDbUrl(): Attribute
|
||||||
$url = "postgres://{$this->postgres_user}:{$this->postgres_password}@{$this->uuid}:5432/{$this->postgres_db}";
|
$url = "postgres://{$this->postgres_user}:{$this->postgres_password}@{$this->uuid}:5432/{$this->postgres_db}";
|
||||||
if ($this->enable_ssl) {
|
if ($this->enable_ssl) {
|
||||||
$url .= "?sslmode={$this->ssl_mode}";
|
$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;
|
return $url;
|
||||||
|
|
@ -238,6 +241,9 @@ protected function externalDbUrl(): Attribute
|
||||||
$url = "postgres://{$this->postgres_user}:{$this->postgres_password}@{$this->destination->server->getIp}:{$this->public_port}/{$this->postgres_db}";
|
$url = "postgres://{$this->postgres_user}:{$this->postgres_password}@{$this->destination->server->getIp}:{$this->public_port}/{$this->postgres_db}";
|
||||||
if ($this->enable_ssl) {
|
if ($this->enable_ssl) {
|
||||||
$url .= "?sslmode={$this->ssl_mode}";
|
$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;
|
return $url;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue