feat: make service databases public
This commit is contained in:
@@ -28,6 +28,12 @@ class ServiceDatabase extends BaseModel
|
||||
}
|
||||
return "standalone-$image";
|
||||
}
|
||||
public function getServiceDatabaseUrl() {
|
||||
// $type = $this->databaseType();
|
||||
$port = $this->public_port;
|
||||
$url = "{$this->service->server->ip}:{$port}";
|
||||
return $url;
|
||||
}
|
||||
public function service()
|
||||
{
|
||||
return $this->belongsTo(Service::class);
|
||||
|
||||
@@ -58,8 +58,9 @@ class StandaloneRedis extends BaseModel
|
||||
{
|
||||
return 'standalone-redis';
|
||||
}
|
||||
public function getDbUrl(): string {
|
||||
if ($this->is_public) {
|
||||
public function getDbUrl(bool $useInternal = false): string
|
||||
{
|
||||
if ($this->is_public && !$useInternal) {
|
||||
return "redis://:{$this->redis_password}@{$this->destination->server->getIp}:{$this->public_port}/0";
|
||||
} else {
|
||||
return "redis://:{$this->redis_password}@{$this->uuid}:6379/0";
|
||||
|
||||
Reference in New Issue
Block a user