Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: env variable in value parsed

Andras Bacsaibfeaae9caaa0
diff --git a/app/Livewire/Project/Service/EditCompose.php b/app/Livewire/Project/Service/EditCompose.php
index 3d0ad4e0b2..dc043e65ad 100644
--- a/app/Livewire/Project/Service/EditCompose.php
+++ b/app/Livewire/Project/Service/EditCompose.php
@@ -43,6 +43,7 @@ class EditCompose extends Component
{
$this->dispatch('info', 'Saving new docker compose...');
$this->dispatch('saveCompose', $this->service->docker_compose_raw);
+ $this->dispatch('refreshStorages');
}
public function instantSave()
diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/All.php b/app/Livewire/Project/Shared/EnvironmentVariable/All.php
index 4c79eb3a2f..055788b576 100644
--- a/app/Livewire/Project/Shared/EnvironmentVariable/All.php
+++ b/app/Livewire/Project/Shared/EnvironmentVariable/All.php
@@ -24,6 +24,7 @@ class All extends Component
protected $listeners = [
'saveKey' => 'submit',
+ 'refreshEnvs',
'environmentVariableDeleted' => 'refreshEnvs',
];
@@ -61,7 +62,7 @@ class All extends Component
$sortBy = data_get($this->resource, 'settings.is_env_sorting_enabled') ? 'key' : 'order';
$sortFunction = function ($variables) use ($sortBy) {
- if (!$variables) {
+ if (! $variables) {
return $variables;
}
if ($sortBy === 'key') {
diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php b/app/Livewire/Project/Shared/EnvironmentVariable/Show.php
index cbc4314f0e..463ceecad1 100644
--- a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php
+++ b/app/Livewire/Project/Shared/EnvironmentVariable/Show.php
@@ -136,4 +136,4 @@ class Show extends Component
return handleError($e);
}
}
-}
\ No newline at end of file
+}
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index b34d9f174b..cc5c134070 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -3331,7 +3331,10 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
foreach ($normalEnvironments as $key => $value) {
$key = str($key);
$value = str($value);
- if ($value->startsWith('$')) {
+ if ($value->startsWith('$') || $value->contains('${')) {
+ if ($value->contains('${')) {
+ $value = $value->after('${')->before('}');
+ }
$value = str(replaceVariables(str($value)));
if ($value->contains(':-')) {
$key = $value->before(':');