feat: New mode implementation for MongoDB
This commit is contained in:
@@ -246,13 +246,11 @@ class StandaloneMongodb extends BaseModel
|
||||
get: function () {
|
||||
$url = "mongodb://{$this->mongo_initdb_root_username}:{$this->mongo_initdb_root_password}@{$this->uuid}:27017/?directConnection=true";
|
||||
if ($this->enable_ssl) {
|
||||
$url .= '&ssl=true';
|
||||
if (in_array($this->ssl_mode, ['verifyCA', 'verifyFull'])) {
|
||||
$url .= '&tlsAllowInvalidCertificates=false';
|
||||
}
|
||||
if ($this->ssl_mode === 'verifyFull') {
|
||||
$url .= '&tlsAllowInvalidHostnames=false';
|
||||
$url .= '&tls=true';
|
||||
if (in_array($this->ssl_mode, ['verify-full'])) {
|
||||
$url .= '&tlsCAFile=/etc/ssl/certs/coolify-ca.crt';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $url;
|
||||
@@ -267,12 +265,9 @@ class StandaloneMongodb extends BaseModel
|
||||
if ($this->is_public && $this->public_port) {
|
||||
$url = "mongodb://{$this->mongo_initdb_root_username}:{$this->mongo_initdb_root_password}@{$this->destination->server->getIp}:{$this->public_port}/?directConnection=true";
|
||||
if ($this->enable_ssl) {
|
||||
$url .= '&ssl=true';
|
||||
if (in_array($this->ssl_mode, ['verifyCA', 'verifyFull'])) {
|
||||
$url .= '&tlsAllowInvalidCertificates=false';
|
||||
}
|
||||
if ($this->ssl_mode === 'verifyFull') {
|
||||
$url .= '&tlsAllowInvalidHostnames=false';
|
||||
$url .= '&tls=true';
|
||||
if (in_array($this->ssl_mode, ['verify-full'])) {
|
||||
$url .= '&tlsCAFile=/etc/ssl/certs/coolify-ca.crt';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user