From 7c580f898c386ee095a5dcfe8e1f278cfb747989 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 25 Mar 2024 12:13:43 +0100 Subject: [PATCH] fix: public service database --- app/Actions/Database/StartDatabaseProxy.php | 3 ++- app/Livewire/Project/Service/Database.php | 1 - app/Models/ServiceDatabase.php | 3 +-- bootstrap/helpers/constants.php | 3 ++- .../livewire/project/application/general.blade.php | 4 ++-- .../views/livewire/project/service/database.blade.php | 11 ++++++----- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/Actions/Database/StartDatabaseProxy.php b/app/Actions/Database/StartDatabaseProxy.php index 500798d30..ebbf3f8cc 100644 --- a/app/Actions/Database/StartDatabaseProxy.php +++ b/app/Actions/Database/StartDatabaseProxy.php @@ -25,7 +25,8 @@ public function handle(StandaloneRedis|StandalonePostgresql|StandaloneMongodb|St $proxyContainerName = "{$database->uuid}-proxy"; if ($database->getMorphClass() === 'App\Models\ServiceDatabase') { $databaseType = $database->databaseType(); - $network = data_get($database, 'service.destination.network'); + // $connectPredefined = data_get($database, 'service.connect_to_docker_network'); + $network = $database->service->uuid; $server = data_get($database, 'service.destination.server'); $proxyContainerName = "{$database->service->uuid}-proxy"; switch ($databaseType) { diff --git a/app/Livewire/Project/Service/Database.php b/app/Livewire/Project/Service/Database.php index a2d8f29a6..ba24d82f7 100644 --- a/app/Livewire/Project/Service/Database.php +++ b/app/Livewire/Project/Service/Database.php @@ -79,7 +79,6 @@ public function refreshFileStorages() public function submit() { try { - ray('asdf'); $this->validate(); $this->database->save(); updateCompose($this->database); diff --git a/app/Models/ServiceDatabase.php b/app/Models/ServiceDatabase.php index 9e9e9d202..76c174d08 100644 --- a/app/Models/ServiceDatabase.php +++ b/app/Models/ServiceDatabase.php @@ -57,8 +57,7 @@ public function getServiceDatabaseUrl() if ($this->service->server->isLocalhost() || isDev()) { $realIp = base_ip(); } - $url = "{$realIp}:{$port}"; - return $url; + return "{$realIp}:{$port}"; } public function service() { diff --git a/bootstrap/helpers/constants.php b/bootstrap/helpers/constants.php index 134cc6aad..84997d134 100644 --- a/bootstrap/helpers/constants.php +++ b/bootstrap/helpers/constants.php @@ -27,7 +27,8 @@ 'couchdb', 'neo4j', 'influxdb', - 'clickhouse/clickhouse-server' + 'clickhouse/clickhouse-server', + 'supabase/postgres' ]; const SPECIFIC_SERVICES = [ 'quay.io/minio/minio', diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php index 76e6cb501..4a2fe7ec8 100644 --- a/resources/views/livewire/project/application/general.blade.php +++ b/resources/views/livewire/project/application/general.blade.php @@ -206,13 +206,13 @@ class="underline" href="https://coolify.io/docs/docker/registry" know what are you doing. @endif @else @endif diff --git a/resources/views/livewire/project/service/database.blade.php b/resources/views/livewire/project/service/database.blade.php index 6d4cfc72b..86ebb9b40 100644 --- a/resources/views/livewire/project/service/database.blade.php +++ b/resources/views/livewire/project/service/database.blade.php @@ -17,15 +17,16 @@ label="Image Tag" id="database.image">
- @if ($db_url_public) - - @endif +
+ @if ($db_url_public) + + @endif

Advanced