From d6fb54f3c3d38d1db05fb5e7de8226cd244ac99a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 26 Jul 2024 20:01:23 +0200 Subject: [PATCH] fix: service env variables --- bootstrap/helpers/shared.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index ff4fe6d02..77226f1c3 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -1839,16 +1839,23 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal // Get variables from the service foreach ($serviceVariables as $variableName => $variable) { if (is_numeric($variableName)) { - $variable = str($variable); - if ($variable->contains('=')) { - // - SESSION_SECRET=123 - // - SESSION_SECRET= - $key = $variable->before('='); - $value = $variable->after('='); + if (is_array($variable)) { + // - SESSION_SECRET: 123 + // - SESSION_SECRET: + $key = str(collect($variable)->keys()->first()); + $value = str(collect($variable)->values()->first()); } else { - // - SESSION_SECRET - $key = $variable; - $value = null; + $variable = str($variable); + if ($variable->contains('=')) { + // - SESSION_SECRET=123 + // - SESSION_SECRET= + $key = $variable->before('='); + $value = $variable->after('='); + } else { + // - SESSION_SECRET + $key = $variable; + $value = null; + } } } else { // SESSION_SECRET: 123