From c835c02bf2a82d054e1fbd90f382e0ac46298de5 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 12 Mar 2024 19:09:08 +0100 Subject: [PATCH] Update port numbers for services --- bootstrap/helpers/shared.php | 29 +++++++++---------- .../livewire/project/new/select.blade.php | 4 +-- templates/compose/metabase.yaml | 3 +- templates/compose/metube.yaml | 3 +- templates/compose/moodle.yaml | 3 +- templates/compose/n8n.yaml | 3 +- templates/service-templates.json | 20 ++++++++----- 7 files changed, 35 insertions(+), 30 deletions(-) diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 28d7fc164..1a99ff414 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -637,7 +637,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal } else { $tempServiceName = $serviceName; } - if (str(data_get($service,'image'))->contains('glitchtip')) { + if (str(data_get($service, 'image'))->contains('glitchtip')) { $tempServiceName = 'glitchtip'; } $serviceDefinition = data_get($allServices, $tempServiceName); @@ -1023,21 +1023,18 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal $savedService->save(); } // Caddy needs exact port in some cases. - ray($predefinedPort, $key, $fqdn); - if ($predefinedPort && !$key->endsWith("_{$predefinedPort}")) { - if ($resource->server->proxyType() === 'CADDY') { - $env = EnvironmentVariable::where([ - 'key' => $key, - 'service_id' => $resource->id, - ])->first(); - if ($env) { - $env_url = Url::fromString($env->value); - $env_port = $env_url->getPort(); - if ($env_port !== $predefinedPort) { - $env_url = $env_url->withPort($predefinedPort); - $savedService->fqdn = $env_url->__toString(); - $savedService->save(); - } + if ($predefinedPort && !$key->endsWith("_{$predefinedPort}") && $command?->value() === 'FQDN' && $resource->server->proxyType() === 'CADDY') { + $env = EnvironmentVariable::where([ + 'key' => $key, + 'service_id' => $resource->id, + ])->first(); + if ($env) { + $env_url = Url::fromString($env->value); + $env_port = $env_url->getPort(); + if ($env_port !== $predefinedPort) { + $env_url = $env_url->withPort($predefinedPort); + $savedService->fqdn = $env_url->__toString(); + $savedService->save(); } } } diff --git a/resources/views/livewire/project/new/select.blade.php b/resources/views/livewire/project/new/select.blade.php index 97bcd179f..d0a86a245 100644 --- a/resources/views/livewire/project/new/select.blade.php +++ b/resources/views/livewire/project/new/select.blade.php @@ -289,10 +289,10 @@ class="w-full text-white rounded input input-sm bg-coolgray-200 disabled:bg-cool @endforelse - @if ($isDatabase) + {{-- @if ($isDatabase)
Swarm clusters are excluded from this type of resource at the moment. It will be activated soon. Stay tuned.
- @endif + @endif --}} @endif @if ($current_step === 'destinations')