mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-22 16:14:22 +02:00
fix: encrypt mongodb password
This commit is contained in:
parent
72421d692b
commit
6e73f7f2e4
@ -42,6 +42,20 @@ protected static function booted()
|
||||
});
|
||||
}
|
||||
|
||||
public function mongoInitdbRootPassword(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
try {
|
||||
return decrypt($value);
|
||||
} catch (\Throwable $th) {
|
||||
$this->mongo_initdb_root_password = encrypt($value);
|
||||
$this->save();
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
public function portsMappings(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
@ -63,7 +77,8 @@ public function type(): string
|
||||
{
|
||||
return 'standalone-mongodb';
|
||||
}
|
||||
public function getDbUrl(bool $useInternal = false) {
|
||||
public function getDbUrl(bool $useInternal = false)
|
||||
{
|
||||
if ($this->is_public && !$useInternal) {
|
||||
return "mongodb://{$this->mongo_initdb_root_username}:{$this->mongo_initdb_root_password}@{$this->destination->server->getIp}:{$this->public_port}/?directConnection=true";
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user