From 335788c2d640dc0bf1136c7f3c9aecd10cdfd715 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 1 Dec 2023 12:14:23 +0100 Subject: [PATCH] fix: default value do not overwrite existing env value --- bootstrap/helpers/shared.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 3681a6c0c..65aad2abc 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -913,13 +913,17 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal continue; } if ($value?->startsWith('$')) { - $value = Str::of(replaceVariables($value)); - $key = $value; $foundEnv = EnvironmentVariable::where([ 'key' => $key, 'service_id' => $resource->id, ])->first(); + $value = Str::of(replaceVariables($value)); + $key = $value; if ($value->startsWith('SERVICE_')) { + $foundEnv = EnvironmentVariable::where([ + 'key' => $key, + 'service_id' => $resource->id, + ])->first(); ['command' => $command, 'forService' => $forService, 'generatedValue' => $generatedValue, 'port' => $port] = parseEnvVariable($value); if ($command->value() === 'FQDN' || $command->value() === 'URL') { if (Str::lower($forService) === $serviceName) {