diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 330f2627a..791e2eb09 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -2645,7 +2645,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal if ($value?->startsWith('$')) { $foundEnv = EnvironmentVariable::where([ 'key' => $key, - 'application_id' => $resource->id, + 'resourceable_type' => get_class($resource), + 'resourceable_id' => $resource->id, 'is_preview' => false, ])->first(); $value = replaceVariables($value); @@ -2653,7 +2654,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal if ($value->startsWith('SERVICE_')) { $foundEnv = EnvironmentVariable::where([ 'key' => $key, - 'application_id' => $resource->id, + 'resourceable_type' => get_class($resource), + 'resourceable_id' => $resource->id, ])->first(); ['command' => $command, 'forService' => $forService, 'generatedValue' => $generatedValue, 'port' => $port] = parseEnvVariable($value); if (! is_null($command)) { @@ -2676,7 +2678,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal 'key' => $key, 'value' => $fqdn, 'is_build_time' => false, - 'application_id' => $resource->id, + 'resourceable_type' => get_class($resource), + 'resourceable_id' => $resource->id, 'is_preview' => false, ]); } @@ -2687,7 +2690,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal 'key' => $key, 'value' => $generatedValue, 'is_build_time' => false, - 'application_id' => $resource->id, + 'resourceable_type' => get_class($resource), + 'resourceable_id' => $resource->id, 'is_preview' => false, ]); } @@ -2712,7 +2716,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal } $foundEnv = EnvironmentVariable::where([ 'key' => $key, - 'application_id' => $resource->id, + 'resourceable_type' => get_class($resource), + 'resourceable_id' => $resource->id, 'is_preview' => false, ])->first(); if ($foundEnv) { @@ -2722,7 +2727,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal if ($foundEnv) { $foundEnv->update([ 'key' => $key, - 'application_id' => $resource->id, + 'resourceable_type' => get_class($resource), + 'resourceable_id' => $resource->id, 'is_build_time' => $isBuildTime, 'value' => $defaultValue, ]); @@ -2731,7 +2737,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal 'key' => $key, 'value' => $defaultValue, 'is_build_time' => $isBuildTime, - 'application_id' => $resource->id, + 'resourceable_type' => get_class($resource), + 'resourceable_id' => $resource->id, 'is_preview' => false, ]); } diff --git a/config/constants.php b/config/constants.php index dddaebbb5..6ca262fa6 100644 --- a/config/constants.php +++ b/config/constants.php @@ -2,7 +2,7 @@ return [ 'coolify' => [ - 'version' => '4.0.0-beta.385', + 'version' => '4.0.0-beta.386', 'self_hosted' => env('SELF_HOSTED', true), 'autoupdate' => env('AUTOUPDATE'), 'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'), diff --git a/database/migrations/2025_01_22_101105_remove_wrongly_created_envs.php b/database/migrations/2025_01_22_101105_remove_wrongly_created_envs.php new file mode 100644 index 000000000..cb1b3cbe6 --- /dev/null +++ b/database/migrations/2025_01_22_101105_remove_wrongly_created_envs.php @@ -0,0 +1,19 @@ +each(function (EnvironmentVariable $environmentVariable) { + $environmentVariable->delete(); + }); + } catch (\Exception $e) { + Log::error('Failed to delete wrongly created environment variables: '.$e->getMessage()); + } + } +}; diff --git a/docker/coolify-helper/Dockerfile b/docker/coolify-helper/Dockerfile index acc44d02a..91954b4a7 100644 --- a/docker/coolify-helper/Dockerfile +++ b/docker/coolify-helper/Dockerfile @@ -11,7 +11,7 @@ ARG DOCKER_BUILDX_VERSION=0.19.3 # https://github.com/buildpacks/pack/releases ARG PACK_VERSION=0.36.2 # https://github.com/railwayapp/nixpacks/releases -ARG NIXPACKS_VERSION=1.30.0 +ARG NIXPACKS_VERSION=1.32.0 # https://github.com/minio/mc/releases ARG MINIO_VERSION=RELEASE.2024-11-21T17-21-54Z diff --git a/versions.json b/versions.json index dd64cc010..8321fad00 100644 --- a/versions.json +++ b/versions.json @@ -1,10 +1,10 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.385" + "version": "4.0.0-beta.386" }, "nightly": { - "version": "4.0.0-beta.386" + "version": "4.0.0-beta.387" }, "helper": { "version": "1.0.4"