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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
refactor(environment): remove 'is_build_time' attribute from environment variable handling across the application to simplify configuration
Andras Bacsai5b3b4bbc4369
diff --git a/app/Http/Controllers/Api/ApplicationsController.php b/app/Http/Controllers/Api/ApplicationsController.phpindex 7ef1c35063..9b9de640c8 100644--- a/app/Http/Controllers/Api/ApplicationsController.php+++ b/app/Http/Controllers/Api/ApplicationsController.php@@ -2429,7 +2429,6 @@ class ApplicationsController extends Controller'key' => ['type' => 'string', 'description' => 'The key of the environment variable.'],'value' => ['type' => 'string', 'description' => 'The value of the environment variable.'],'is_preview' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in preview deployments.'],- 'is_build_time' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in build time.'],'is_literal' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is a literal, nothing espaced.'],'is_multiline' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is multiline.'],'is_shown_once' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable\'s value is shown on the UI.'],@@ -2470,7 +2469,7 @@ class ApplicationsController extends Controller)]public function update_env_by_uuid(Request $request){- $allowedFields = ['key', 'value', 'is_preview', 'is_build_time', 'is_literal'];+ $allowedFields = ['key', 'value', 'is_preview', 'is_literal'];$teamId = getTeamIdFromToken();if (is_null($teamId)) {@@ -2495,7 +2494,6 @@ class ApplicationsController extends Controller'key' => 'string|required','value' => 'string|nullable','is_preview' => 'boolean',- 'is_build_time' => 'boolean','is_literal' => 'boolean','is_multiline' => 'boolean','is_shown_once' => 'boolean',@@ -2516,16 +2514,12 @@ class ApplicationsController extends Controller], 422);}$is_preview = $request->is_preview ?? false;- $is_build_time = $request->is_build_time ?? false;$is_literal = $request->is_literal ?? false;$key = str($request->key)->trim()->replace(' ', '_')->value;if ($is_preview) {$env = $application->environment_variables_preview->where('key', $key)->first();if ($env) {$env->value = $request->value;- if ($env->is_build_time != $is_build_time) {- $env->is_build_time = $is_build_time;- }if ($env->is_literal != $is_literal) {$env->is_literal = $is_literal;}@@ -2550,9 +2544,6 @@ class ApplicationsController extends Controller$env = $application->environment_variables->where('key', $key)->first();if ($env) {$env->value = $request->value;- if ($env->is_build_time != $is_build_time) {- $env->is_build_time = $is_build_time;- }if ($env->is_literal != $is_literal) {$env->is_literal = $is_literal;}@@ -2619,7 +2610,6 @@ class ApplicationsController extends Controller'key' => ['type' => 'string', 'description' => 'The key of the environment variable.'],'value' => ['type' => 'string', 'description' => 'The value of the environment variable.'],'is_preview' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in preview deployments.'],- 'is_build_time' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in build time.'],'is_literal' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is a literal, nothing espaced.'],'is_multiline' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is multiline.'],'is_shown_once' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable\'s value is shown on the UI.'],@@ -2690,7 +2680,7 @@ class ApplicationsController extends Controller], 400);}$bulk_data = collect($bulk_data)->map(function ($item) {- return collect($item)->only(['key', 'value', 'is_preview', 'is_build_time', 'is_literal']);+ return collect($item)->only(['key', 'value', 'is_preview', 'is_literal']);});$returnedEnvs = collect();foreach ($bulk_data as $item) {@@ -2698,7 +2688,6 @@ class ApplicationsController extends Controller'key' => 'string|required','value' => 'string|nullable','is_preview' => 'boolean',- 'is_build_time' => 'boolean','is_literal' => 'boolean','is_multiline' => 'boolean','is_shown_once' => 'boolean',@@ -2710,7 +2699,6 @@ class ApplicationsController extends Controller], 422);}$is_preview = $item->get('is_preview') ?? false;- $is_build_time = $item->get('is_build_time') ?? false;$is_literal = $item->get('is_literal') ?? false;$is_multi_line = $item->get('is_multiline') ?? false;$is_shown_once = $item->get('is_shown_once') ?? false;@@ -2719,9 +2707,7 @@ class ApplicationsController extends Controller$env = $application->environment_variables_preview->where('key', $key)->first();if ($env) {$env->value = $item->get('value');- if ($env->is_build_time != $is_build_time) {- $env->is_build_time = $is_build_time;- }+if ($env->is_literal != $is_literal) {$env->is_literal = $is_literal;}@@ -2737,7 +2723,6 @@ class ApplicationsController extends Controller'key' => $item->get('key'),'value' => $item->get('value'),'is_preview' => $is_preview,- 'is_build_time' => $is_build_time,'is_literal' => $is_literal,'is_multiline' => $is_multi_line,'is_shown_once' => $is_shown_once,@@ -2749,9 +2734,6 @@ class ApplicationsController extends Controller$env = $application->environment_variables->where('key', $key)->first();if ($env) {$env->value = $item->get('value');- if ($env->is_build_time != $is_build_time) {- $env->is_build_time = $is_build_time;- }if ($env->is_literal != $is_literal) {$env->is_literal = $is_literal;}@@ -2767,7 +2749,6 @@ class ApplicationsController extends Controller'key' => $item->get('key'),'value' => $item->get('value'),'is_preview' => $is_preview,- 'is_build_time' => $is_build_time,'is_literal' => $is_literal,'is_multiline' => $is_multi_line,'is_shown_once' => $is_shown_once,@@ -2814,7 +2795,6 @@ class ApplicationsController extends Controller'key' => ['type' => 'string', 'description' => 'The key of the environment variable.'],'value' => ['type' => 'string', 'description' => 'The value of the environment variable.'],'is_preview' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in preview deployments.'],- 'is_build_time' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in build time.'],'is_literal' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is a literal, nothing espaced.'],'is_multiline' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is multiline.'],'is_shown_once' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable\'s value is shown on the UI.'],@@ -2854,7 +2834,7 @@ class ApplicationsController extends Controller)]public function create_env(Request $request){- $allowedFields = ['key', 'value', 'is_preview', 'is_build_time', 'is_literal'];+ $allowedFields = ['key', 'value', 'is_preview', 'is_literal'];$teamId = getTeamIdFromToken();if (is_null($teamId)) {@@ -2874,7 +2854,6 @@ class ApplicationsController extends Controller'key' => 'string|required','value' => 'string|nullable','is_preview' => 'boolean',- 'is_build_time' => 'boolean','is_literal' => 'boolean','is_multiline' => 'boolean','is_shown_once' => 'boolean',@@ -2908,7 +2887,6 @@ class ApplicationsController extends Controller'key' => $request->key,'value' => $request->value,'is_preview' => $request->is_preview ?? false,- 'is_build_time' => $request->is_build_time ?? false,'is_literal' => $request->is_literal ?? false,'is_multiline' => $request->is_multiline ?? false,'is_shown_once' => $request->is_shown_once ?? false,@@ -2931,7 +2909,6 @@ class ApplicationsController extends Controller'key' => $request->key,'value' => $request->value,'is_preview' => $request->is_preview ?? false,- 'is_build_time' => $request->is_build_time ?? false,'is_literal' => $request->is_literal ?? false,'is_multiline' => $request->is_multiline ?? false,'is_shown_once' => $request->is_shown_once ?? false,diff --git a/app/Http/Controllers/Api/ServicesController.php b/app/Http/Controllers/Api/ServicesController.phpindex 162f637c59..e240e326e8 100644--- a/app/Http/Controllers/Api/ServicesController.php+++ b/app/Http/Controllers/Api/ServicesController.php@@ -353,7 +353,6 @@ class ServicesController extends Controller'value' => $generatedValue,'resourceable_id' => $service->id,'resourceable_type' => $service->getMorphClass(),- 'is_build_time' => false,'is_preview' => false,]);});@@ -919,7 +918,6 @@ class ServicesController extends Controller'key' => ['type' => 'string', 'description' => 'The key of the environment variable.'],'value' => ['type' => 'string', 'description' => 'The value of the environment variable.'],'is_preview' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in preview deployments.'],- 'is_build_time' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in build time.'],'is_literal' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is a literal, nothing espaced.'],'is_multiline' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is multiline.'],'is_shown_once' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable\'s value is shown on the UI.'],@@ -975,7 +973,6 @@ class ServicesController extends Controller$validator = customApiValidator($request->all(), ['key' => 'string|required','value' => 'string|nullable',- 'is_build_time' => 'boolean','is_literal' => 'boolean','is_multiline' => 'boolean','is_shown_once' => 'boolean',@@ -1039,7 +1036,6 @@ class ServicesController extends Controller'key' => ['type' => 'string', 'description' => 'The key of the environment variable.'],'value' => ['type' => 'string', 'description' => 'The value of the environment variable.'],'is_preview' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in preview deployments.'],- 'is_build_time' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in build time.'],'is_literal' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is a literal, nothing espaced.'],'is_multiline' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is multiline.'],'is_shown_once' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable\'s value is shown on the UI.'],@@ -1105,7 +1101,6 @@ class ServicesController extends Controller$validator = customApiValidator($item, ['key' => 'string|required','value' => 'string|nullable',- 'is_build_time' => 'boolean','is_literal' => 'boolean','is_multiline' => 'boolean','is_shown_once' => 'boolean',@@ -1161,7 +1156,6 @@ class ServicesController extends Controller'key' => ['type' => 'string', 'description' => 'The key of the environment variable.'],'value' => ['type' => 'string', 'description' => 'The value of the environment variable.'],'is_preview' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in preview deployments.'],- 'is_build_time' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is used in build time.'],'is_literal' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is a literal, nothing espaced.'],'is_multiline' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable is multiline.'],'is_shown_once' => ['type' => 'boolean', 'description' => 'The flag to indicate if the environment variable\'s value is shown on the UI.'],@@ -1216,7 +1210,6 @@ class ServicesController extends Controller$validator = customApiValidator($request->all(), ['key' => 'string|required','value' => 'string|nullable',- 'is_build_time' => 'boolean','is_literal' => 'boolean','is_multiline' => 'boolean','is_shown_once' => 'boolean',diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.phpindex a3a7f00a60..8807f0f97a 100644--- a/app/Jobs/ApplicationDeploymentJob.php+++ b/app/Jobs/ApplicationDeploymentJob.php@@ -1049,32 +1049,17 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue$envType = 'environment_variables_preview';}$mix_env = $this->application->{$envType}->where('key', 'MIX_ENV')->first();- if ($mix_env) {- if ($mix_env->is_build_time === false) {- $this->application_deployment_queue->addLogEntry('MIX_ENV environment variable is not set as build time.', type: 'error');- $this->application_deployment_queue->addLogEntry('Please set MIX_ENV environment variable to be build time variable if you facing any issues with the deployment.', type: 'error');- }- } else {+ if (! $mix_env) {$this->application_deployment_queue->addLogEntry('MIX_ENV environment variable not found.', type: 'error');$this->application_deployment_queue->addLogEntry('Please add MIX_ENV environment variable and set it to be build time variable if you facing any issues with the deployment.', type: 'error');}$secret_key_base = $this->application->{$envType}->where('key', 'SECRET_KEY_BASE')->first();- if ($secret_key_base) {- if ($secret_key_base->is_build_time === false) {- $this->application_deployment_queue->addLogEntry('SECRET_KEY_BASE environment variable is not set as build time.', type: 'error');- $this->application_deployment_queue->addLogEntry('Please set SECRET_KEY_BASE environment variable to be build time variable if you facing any issues with the deployment.', type: 'error');- }- } else {+ if (! $secret_key_base) {$this->application_deployment_queue->addLogEntry('SECRET_KEY_BASE environment variable not found.', type: 'error');$this->application_deployment_queue->addLogEntry('Please add SECRET_KEY_BASE environment variable and set it to be build time variable if you facing any issues with the deployment.', type: 'error');}$database_url = $this->application->{$envType}->where('key', 'DATABASE_URL')->first();- if ($database_url) {- if ($database_url->is_build_time === false) {- $this->application_deployment_queue->addLogEntry('DATABASE_URL environment variable is not set as build time.', type: 'error');- $this->application_deployment_queue->addLogEntry('Please set DATABASE_URL environment variable to be build time variable if you facing any issues with the deployment.', type: 'error');- }- } else {+ if (! $database_url) {$this->application_deployment_queue->addLogEntry('DATABASE_URL environment variable not found.', type: 'error');$this->application_deployment_queue->addLogEntry('Please add DATABASE_URL environment variable and set it to be build time variable if you facing any issues with the deployment.', type: 'error');}@@ -1094,7 +1079,6 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue$nixpacks_php_fallback_path = new EnvironmentVariable;$nixpacks_php_fallback_path->key = 'NIXPACKS_PHP_FALLBACK_PATH';$nixpacks_php_fallback_path->value = '/index.php';- $nixpacks_php_fallback_path->is_build_time = false;$nixpacks_php_fallback_path->resourceable_id = $this->application->id;$nixpacks_php_fallback_path->resourceable_type = 'App\Models\Application';$nixpacks_php_fallback_path->save();@@ -1103,7 +1087,6 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue$nixpacks_php_root_dir = new EnvironmentVariable;$nixpacks_php_root_dir->key = 'NIXPACKS_PHP_ROOT_DIR';$nixpacks_php_root_dir->value = '/app/public';- $nixpacks_php_root_dir->is_build_time = false;$nixpacks_php_root_dir->resourceable_id = $this->application->id;$nixpacks_php_root_dir->resourceable_type = 'App\Models\Application';$nixpacks_php_root_dir->save();diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.phpindex 9f15011c2a..c77d050cb0 100644--- a/app/Livewire/Project/Application/General.php+++ b/app/Livewire/Project/Application/General.php@@ -703,7 +703,6 @@ class General extends Component'key' => "SERVICE_FQDN_{$serviceNameFormatted}",], ['value' => $fqdnValue,- 'is_build_time' => false,'is_preview' => false,]);@@ -712,7 +711,6 @@ class General extends Component'key' => "SERVICE_URL_{$serviceNameFormatted}",], ['value' => $urlValue,- 'is_build_time' => false,'is_preview' => false,]);// Create/update port-specific variables if port exists@@ -721,7 +719,6 @@ class General extends Component'key' => "SERVICE_FQDN_{$serviceNameFormatted}_{$port}",], ['value' => $fqdnValue,- 'is_build_time' => false,'is_preview' => false,]);@@ -729,7 +726,6 @@ class General extends Component'key' => "SERVICE_URL_{$serviceNameFormatted}_{$port}",], ['value' => $urlValue,- 'is_build_time' => false,'is_preview' => false,]);}diff --git a/app/Livewire/Project/New/DockerCompose.php b/app/Livewire/Project/New/DockerCompose.phpindex 7c81e810ce..5cda1deddd 100644--- a/app/Livewire/Project/New/DockerCompose.php+++ b/app/Livewire/Project/New/DockerCompose.php@@ -63,7 +63,6 @@ class DockerCompose extends ComponentEnvironmentVariable::create(['key' => $key,'value' => $variable,- 'is_build_time' => false,'is_preview' => false,'resourceable_id' => $service->id,'resourceable_type' => $service->getMorphClass(),diff --git a/app/Livewire/Project/Resource/Create.php b/app/Livewire/Project/Resource/Create.phpindex 3dbe4230c7..73960d288e 100644--- a/app/Livewire/Project/Resource/Create.php+++ b/app/Livewire/Project/Resource/Create.php@@ -97,7 +97,6 @@ class Create extends Component'value' => $value,'resourceable_id' => $service->id,'resourceable_type' => $service->getMorphClass(),- 'is_build_time' => false,'is_preview' => false,]);}diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/Add.php b/app/Livewire/Project/Shared/EnvironmentVariable/Add.phpindex cf7843f84d..a2d783232f 100644--- a/app/Livewire/Project/Shared/EnvironmentVariable/Add.php+++ b/app/Livewire/Project/Shared/EnvironmentVariable/Add.php@@ -19,8 +19,6 @@ class Add extends Componentpublic ?string $value = null;- public bool $is_build_time = false;-public bool $is_multiline = false;public bool $is_literal = false;@@ -30,7 +28,6 @@ class Add extends Componentprotected $rules = ['key' => 'required|string','value' => 'nullable',- 'is_build_time' => 'required|boolean','is_multiline' => 'required|boolean','is_literal' => 'required|boolean',];@@ -38,7 +35,6 @@ class Add extends Componentprotected $validationAttributes = ['key' => 'key','value' => 'value',- 'is_build_time' => 'build','is_multiline' => 'multiline','is_literal' => 'literal',];@@ -54,7 +50,6 @@ class Add extends Component$this->dispatch('saveKey', ['key' => $this->key,'value' => $this->value,- 'is_build_time' => $this->is_build_time,'is_multiline' => $this->is_multiline,'is_literal' => $this->is_literal,'is_preview' => $this->is_preview,@@ -66,7 +61,6 @@ class Add extends Component{$this->key = '';$this->value = '';- $this->is_build_time = false;$this->is_multiline = false;$this->is_literal = false;}diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/All.php b/app/Livewire/Project/Shared/EnvironmentVariable/All.phpindex 141263ba2b..884441ec20 100644--- a/app/Livewire/Project/Shared/EnvironmentVariable/All.php+++ b/app/Livewire/Project/Shared/EnvironmentVariable/All.php@@ -212,7 +212,6 @@ class All extends Component$environment = new EnvironmentVariable;$environment->key = $data['key'];$environment->value = $data['value'];- $environment->is_build_time = $data['is_build_time'] ?? false;$environment->is_multiline = $data['is_multiline'] ?? false;$environment->is_literal = $data['is_literal'] ?? false;$environment->is_preview = $data['is_preview'] ?? false;@@ -276,7 +275,6 @@ class All extends Component$environment = new EnvironmentVariable;$environment->key = $key;$environment->value = $value;- $environment->is_build_time = false;$environment->is_multiline = false;$environment->is_preview = $isPreview;$environment->resourceable_id = $this->resource->id;diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php b/app/Livewire/Project/Shared/EnvironmentVariable/Show.phpindex f8b06bff88..14b532bf83 100644--- a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php+++ b/app/Livewire/Project/Shared/EnvironmentVariable/Show.php@@ -32,8 +32,6 @@ class Show extends Componentpublic bool $is_shared = false;- public bool $is_build_time = false;-public bool $is_multiline = false;public bool $is_literal = false;@@ -55,7 +53,6 @@ class Show extends Componentprotected $rules = ['key' => 'required|string','value' => 'nullable',- 'is_build_time' => 'required|boolean','is_multiline' => 'required|boolean','is_literal' => 'required|boolean','is_shown_once' => 'required|boolean',@@ -101,7 +98,6 @@ class Show extends Component]);} else {$this->validate();- $this->env->is_build_time = $this->is_build_time;$this->env->is_required = $this->is_required;$this->env->is_shared = $this->is_shared;}@@ -114,7 +110,6 @@ class Show extends Component} else {$this->key = $this->env->key;$this->value = $this->env->value;- $this->is_build_time = $this->env->is_build_time ?? false;$this->is_multiline = $this->env->is_multiline;$this->is_literal = $this->env->is_literal;$this->is_shown_once = $this->env->is_shown_once;@@ -139,9 +134,6 @@ class Show extends Componentpublic function serialize(){data_forget($this->env, 'real_value');- if ($this->env->getMorphClass() === \App\Models\SharedEnvironmentVariable::class) {- data_forget($this->env, 'is_build_time');- }}public function lock()diff --git a/app/Models/Application.php b/app/Models/Application.phpindex 4a22a1953b..30be565239 100644--- a/app/Models/Application.php+++ b/app/Models/Application.php@@ -738,14 +738,6 @@ class Application extends BaseModel->where('key', 'not like', 'NIXPACKS_%');}- public function build_environment_variables()- {- return $this->morphMany(EnvironmentVariable::class, 'resourceable')- ->where('is_preview', false)- ->where('is_build_time', true)- ->where('key', 'not like', 'NIXPACKS_%');- }-public function nixpacks_environment_variables(){return $this->morphMany(EnvironmentVariable::class, 'resourceable')@@ -767,14 +759,6 @@ class Application extends BaseModel->where('key', 'not like', 'NIXPACKS_%');}- public function build_environment_variables_preview()- {- return $this->morphMany(EnvironmentVariable::class, 'resourceable')- ->where('is_preview', true)- ->where('is_build_time', true)- ->where('key', 'not like', 'NIXPACKS_%');- }-public function nixpacks_environment_variables_preview(){return $this->morphMany(EnvironmentVariable::class, 'resourceable')@@ -936,9 +920,9 @@ class Application extends BaseModel{$newConfigHash = base64_encode($this->fqdn.$this->git_repository.$this->git_branch.$this->git_commit_sha.$this->build_pack.$this->static_image.$this->install_command.$this->build_command.$this->start_command.$this->ports_exposes.$this->ports_mappings.$this->base_directory.$this->publish_directory.$this->dockerfile.$this->dockerfile_location.$this->custom_labels.$this->custom_docker_run_options.$this->dockerfile_target_build.$this->redirect.$this->custom_nginx_configuration.$this->custom_labels);if ($this->pull_request_id === 0 || $this->pull_request_id === null) {- $newConfigHash .= json_encode($this->environment_variables()->get(['value', 'is_build_time', 'is_multiline', 'is_literal'])->sort());+ $newConfigHash .= json_encode($this->environment_variables()->get(['value', 'is_multiline', 'is_literal'])->sort());} else {- $newConfigHash .= json_encode($this->environment_variables_preview->get(['value', 'is_build_time', 'is_multiline', 'is_literal'])->sort());+ $newConfigHash .= json_encode($this->environment_variables_preview->get(['value', 'is_multiline', 'is_literal'])->sort());}$newConfigHash = md5($newConfigHash);$oldConfigHash = data_get($this, 'config_hash');diff --git a/app/Models/EnvironmentVariable.php b/app/Models/EnvironmentVariable.phpindex f999305436..0afa703c2e 100644--- a/app/Models/EnvironmentVariable.php+++ b/app/Models/EnvironmentVariable.php@@ -14,7 +14,6 @@ use OpenApi\Attributes as OA;'uuid' => ['type' => 'string'],'resourceable_type' => ['type' => 'string'],'resourceable_id' => ['type' => 'integer'],- 'is_build_time' => ['type' => 'boolean'],'is_literal' => ['type' => 'boolean'],'is_multiline' => ['type' => 'boolean'],'is_preview' => ['type' => 'boolean'],@@ -35,7 +34,6 @@ class EnvironmentVariable extends BaseModelprotected $casts = ['key' => 'string','value' => 'encrypted',- 'is_build_time' => 'boolean','is_multiline' => 'boolean','is_preview' => 'boolean','version' => 'string',@@ -61,7 +59,6 @@ class EnvironmentVariable extends BaseModelModelsEnvironmentVariable::create(['key' => $environment_variable->key,'value' => $environment_variable->value,- 'is_build_time' => $environment_variable->is_build_time,'is_multiline' => $environment_variable->is_multiline ?? false,'is_literal' => $environment_variable->is_literal ?? false,'resourceable_type' => Application::class,diff --git a/app/Models/Service.php b/app/Models/Service.phpindex bd185b3552..108575d562 100644--- a/app/Models/Service.php+++ b/app/Models/Service.php@@ -1113,7 +1113,6 @@ class Service extends BaseModel$this->environment_variables()->create(['key' => $key,'value' => $value,- 'is_build_time' => false,'resourceable_id' => $this->id,'resourceable_type' => $this->getMorphClass(),'is_preview' => false,diff --git a/app/Services/ConfigurationGenerator.php b/app/Services/ConfigurationGenerator.phpindex a7e4b31be7..320e3f32a4 100644--- a/app/Services/ConfigurationGenerator.php+++ b/app/Services/ConfigurationGenerator.php@@ -129,7 +129,6 @@ class ConfigurationGenerator$variables->push(['key' => $env->key,'value' => $env->value,- 'is_build_time' => $env->is_build_time,'is_preview' => $env->is_preview,'is_multiline' => $env->is_multiline,]);@@ -145,7 +144,6 @@ class ConfigurationGenerator$variables->push(['key' => $env->key,'value' => $env->value,- 'is_build_time' => $env->is_build_time,'is_preview' => $env->is_preview,'is_multiline' => $env->is_multiline,]);diff --git a/bootstrap/helpers/parsers.php b/bootstrap/helpers/parsers.phpindex 3dbfb6b33a..d4701d2512 100644--- a/bootstrap/helpers/parsers.php+++ b/bootstrap/helpers/parsers.php@@ -342,7 +342,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'resourceable_id' => $resource->id,], ['value' => $fqdn,- 'is_build_time' => false,'is_preview' => false,]);}@@ -355,7 +354,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'resourceable_id' => $resource->id,], ['value' => $fqdn,- 'is_build_time' => false,'is_preview' => false,]);}@@ -384,7 +382,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'resourceable_id' => $resource->id,], ['value' => $fqdn,- 'is_build_time' => false,'is_preview' => false,]);if ($resource->build_pack === 'dockercompose') {@@ -418,7 +415,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'resourceable_id' => $resource->id,], ['value' => $url,- 'is_build_time' => false,'is_preview' => false,]);if ($resource->build_pack === 'dockercompose') {@@ -446,7 +442,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'resourceable_id' => $resource->id,], ['value' => $value,- 'is_build_time' => false,'is_preview' => false,]);}@@ -760,7 +755,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'resourceable_id' => $resource->id,], ['value' => $value,- 'is_build_time' => false,'is_preview' => false,]);@@ -777,7 +771,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'resourceable_id' => $resource->id,], ['value' => $value,- 'is_build_time' => false,'is_preview' => false,]);} else {@@ -813,7 +806,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'resourceable_type' => get_class($resource),'resourceable_id' => $resource->id,], [- 'is_build_time' => false,'is_preview' => false,'is_required' => $isRequired,]);@@ -828,7 +820,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'resourceable_id' => $resource->id,], ['value' => $value,- 'is_build_time' => false,'is_preview' => false,'is_required' => $isRequired,]);@@ -886,7 +877,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'key' => 'SERVICE_URL_'.str($forServiceName)->upper()->replace('-', '_')->replace('.', '_'),], ['value' => $coolifyUrl->__toString(),- 'is_build_time' => false,'is_preview' => false,]);$resource->environment_variables()->updateOrCreate([@@ -895,7 +885,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int'key' => 'SERVICE_FQDN_'.str($forServiceName)->upper()->replace('-', '_')->replace('.', '_'),], ['value' => $coolifyFqdn,- 'is_build_time' => false,'is_preview' => false,]);} else {@@ -1343,7 +1332,6 @@ function serviceParser(Service $resource): Collection'resourceable_id' => $resource->id,], ['value' => $fqdn,- 'is_build_time' => false,'is_preview' => false,]);$resource->environment_variables()->updateOrCreate([@@ -1352,7 +1340,6 @@ function serviceParser(Service $resource): Collection'resourceable_id' => $resource->id,], ['value' => $url,- 'is_build_time' => false,'is_preview' => false,]);}@@ -1364,7 +1351,6 @@ function serviceParser(Service $resource): Collection'resourceable_id' => $resource->id,], ['value' => $fqdn,- 'is_build_time' => false,'is_preview' => false,]);$resource->environment_variables()->updateOrCreate([@@ -1373,7 +1359,6 @@ function serviceParser(Service $resource): Collection'resourceable_id' => $resource->id,], ['value' => $url,- 'is_build_time' => false,'is_preview' => false,]);}@@ -1403,7 +1388,6 @@ function serviceParser(Service $resource): Collection'resourceable_id' => $resource->id,], ['value' => $fqdn,- 'is_build_time' => false,'is_preview' => false,]);@@ -1423,7 +1407,6 @@ function serviceParser(Service $resource): Collection'resourceable_id' => $resource->id,], ['value' => $url,- 'is_build_time' => false,'is_preview' => false,]);@@ -1435,7 +1418,6 @@ function serviceParser(Service $resource): Collection'resourceable_id' => $resource->id,], ['value' => $value,- 'is_build_time' => false,'is_preview' => false,]);}@@ -1754,7 +1736,6 @@ function serviceParser(Service $resource): Collection'resourceable_id' => $resource->id,], ['value' => $value,- 'is_build_time' => false,'is_preview' => false,]);@@ -1771,7 +1752,6 @@ function serviceParser(Service $resource): Collection'resourceable_id' => $resource->id,], ['value' => $value,- 'is_build_time' => false,'is_preview' => false,]);} else {@@ -1807,7 +1787,6 @@ function serviceParser(Service $resource): Collection'resourceable_type' => get_class($resource),'resourceable_id' => $resource->id,], [- 'is_build_time' => false,'is_preview' => false,'is_required' => $isRequired,]);@@ -1822,7 +1801,6 @@ function serviceParser(Service $resource): Collection'resourceable_id' => $resource->id,], ['value' => $value,- 'is_build_time' => false,'is_preview' => false,'is_required' => $isRequired,]);diff --git a/bootstrap/helpers/services.php b/bootstrap/helpers/services.phpindex 7d3cb71ff0..41b8857ee4 100644--- a/bootstrap/helpers/services.php+++ b/bootstrap/helpers/services.php@@ -133,7 +133,6 @@ function updateCompose(ServiceApplication|ServiceDatabase $resource)'key' => $variableName,], ['value' => $urlValue,- 'is_build_time' => false,'is_preview' => false,]);if ($port) {@@ -144,7 +143,6 @@ function updateCompose(ServiceApplication|ServiceDatabase $resource)'key' => $variableName,], ['value' => $urlValue,- 'is_build_time' => false,'is_preview' => false,]);}@@ -163,7 +161,6 @@ function updateCompose(ServiceApplication|ServiceDatabase $resource)'key' => $variableName,], ['value' => $fqdnValue,- 'is_build_time' => false,'is_preview' => false,]);if ($port) {@@ -174,7 +171,6 @@ function updateCompose(ServiceApplication|ServiceDatabase $resource)'key' => $variableName,], ['value' => $fqdnValue,- 'is_build_time' => false,'is_preview' => false,]);}diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.phpindex 6778a0ed11..28f5a083dc 100644--- a/bootstrap/helpers/shared.php+++ b/bootstrap/helpers/shared.php@@ -1564,7 +1564,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = falEnvironmentVariable::create(['key' => $key,'value' => $fqdn,- 'is_build_time' => false,'resourceable_type' => get_class($resource),'resourceable_id' => $resource->id,'is_preview' => false,@@ -1644,7 +1643,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = falEnvironmentVariable::create(['key' => $key,'value' => $fqdn,- 'is_build_time' => false,'resourceable_type' => get_class($resource),'resourceable_id' => $resource->id,'is_preview' => false,@@ -1683,7 +1681,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = falEnvironmentVariable::create(['key' => $key,'value' => $generatedValue,- 'is_build_time' => false,'resourceable_type' => get_class($resource),'resourceable_id' => $resource->id,'is_preview' => false,@@ -1722,7 +1719,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal'resourceable_id' => $resource->id,], ['value' => $defaultValue,- 'is_build_time' => false,'resourceable_type' => get_class($resource),'resourceable_id' => $resource->id,'is_preview' => false,@@ -2413,7 +2409,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = falEnvironmentVariable::create(['key' => $key,'value' => $fqdn,- 'is_build_time' => false,'resourceable_type' => get_class($resource),'resourceable_id' => $resource->id,'is_preview' => false,@@ -2425,7 +2420,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = falEnvironmentVariable::create(['key' => $key,'value' => $generatedValue,- 'is_build_time' => false,'resourceable_type' => get_class($resource),'resourceable_id' => $resource->id,'is_preview' => false,@@ -2459,20 +2453,17 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = falif ($foundEnv) {$defaultValue = data_get($foundEnv, 'value');}- $isBuildTime = data_get($foundEnv, 'is_build_time', false);if ($foundEnv) {$foundEnv->update(['key' => $key,'resourceable_type' => get_class($resource),'resourceable_id' => $resource->id,- 'is_build_time' => $isBuildTime,'value' => $defaultValue,]);} else {EnvironmentVariable::create(['key' => $key,'value' => $defaultValue,- 'is_build_time' => $isBuildTime,'resourceable_type' => get_class($resource),'resourceable_id' => $resource->id,'is_preview' => false,diff --git a/database/migrations/2025_09_11_143432_remove_is_build_time_from_environment_variables_table.php b/database/migrations/2025_09_11_143432_remove_is_build_time_from_environment_variables_table.phpnew file mode 100644index 0000000000..076ee8e096--- /dev/null+++ b/database/migrations/2025_09_11_143432_remove_is_build_time_from_environment_variables_table.php@@ -0,0 +1,38 @@+<?php++use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;+use Illuminate\Support\Facades\Schema;++return new class extends Migration+{+ /**+ * Run the migrations.+ */+ public function up(): void+ {+ Schema::table('environment_variables', function (Blueprint $table) {+ // Check if the column exists before trying to drop it+ if (Schema::hasColumn('environment_variables', 'is_build_time')) {+ // Drop the is_build_time column+ // Note: The unique constraints that included is_build_time were tied to old foreign key columns+ // (application_id, service_id, database_id) which were removed in migration 2024_12_16_134437.+ // Those constraints should no longer exist in the database.+ $table->dropColumn('is_build_time');+ }+ });+ }++ /**+ * Reverse the migrations.+ */+ public function down(): void+ {+ Schema::table('environment_variables', function (Blueprint $table) {+ // Re-add the is_build_time column+ if (! Schema::hasColumn('environment_variables', 'is_build_time')) {+ $table->boolean('is_build_time')->default(false)->after('value');+ }+ });+ }+};diff --git a/resources/views/livewire/project/shared/environment-variable/add.blade.php b/resources/views/livewire/project/shared/environment-variable/add.blade.phpindex 6dd75aa9aa..8e0993d435 100644--- a/resources/views/livewire/project/shared/environment-variable/add.blade.php+++ b/resources/views/livewire/project/shared/environment-variable/add.blade.php@@ -3,11 +3,6 @@<x-forms.textarea x-show="$wire.is_multiline === true" x-cloak id="value" label="Value" required /><x-forms.input x-show="$wire.is_multiline === false" x-cloak placeholder="production" id="value"x-bind:label="$wire.is_multiline === false && 'Value'" required />- @if (data_get($parameters, 'application_uuid'))- <x-forms.checkbox id="is_build_time"- helper="If you are using Docker, remember to modify the file to be ready to receive the build time args. Ex.: for docker file, add `ARG name_of_the_variable`, or dockercompose add `- 'name_of_the_variable=${name_of_the_variable}'`"- label="Is Build Variable?" />- @endif<x-forms.checkbox id="is_multiline" label="Is Multiline?" />@if (!$shared)<x-forms.checkbox id="is_literal"diff --git a/resources/views/livewire/project/shared/environment-variable/show.blade.php b/resources/views/livewire/project/shared/environment-variable/show.blade.phpindex 258c65219b..19afe85223 100644--- a/resources/views/livewire/project/shared/environment-variable/show.blade.php+++ b/resources/views/livewire/project/shared/environment-variable/show.blade.php@@ -58,18 +58,12 @@<div class="flex flex-col w-full gap-2 lg:flex-row">@if (!$is_redis_credential)@if ($type === 'service')- <x-forms.checkbox instantSave id="is_build_time"- helper="If you are using Docker, remember to modify the file to be ready to receive the build time args. Ex.: for docker file, add `ARG name_of_the_variable`, or dockercompose add `- 'name_of_the_variable=${name_of_the_variable}'`"- label="Is Build Variable?" /><x-forms.checkbox instantSave id="is_multiline" label="Is Multiline?" /><x-forms.checkbox instantSave id="is_literal"helper="This means that when you use $VARIABLES in a value, it should be interpreted as the actual characters '$VARIABLES' and not as the value of a variable named VARIABLE.<br><br>Useful if you have $ sign in your value and there are some characters after it, but you would not like to interpolate it from another value. In this case, you should set this to true."label="Is Literal?" />@else@if ($is_shared)- <x-forms.checkbox instantSave id="is_build_time"- helper="If you are using Docker, remember to modify the file to be ready to receive the build time args. Ex.: for docker file, add `ARG name_of_the_variable`, or dockercompose add `- 'name_of_the_variable=${name_of_the_variable}'`"- label="Is Build Variable?" /><x-forms.checkbox instantSave id="is_literal"helper="This means that when you use $VARIABLES in a value, it should be interpreted as the actual characters '$VARIABLES' and not as the value of a variable named VARIABLE.<br><br>Useful if you have $ sign in your value and there are some characters after it, but you would not like to interpolate it from another value. In this case, you should set this to true."label="Is Literal?" />@@ -77,9 +71,6 @@@if ($isSharedVariable)<x-forms.checkbox instantSave id="is_multiline" label="Is Multiline?" />@else- <x-forms.checkbox instantSave id="is_build_time"- helper="If you are using Docker, remember to modify the file to be ready to receive the build time args. Ex.: for dockerfile, add `ARG name_of_the_variable`, or dockercompose add `- 'name_of_the_variable=${name_of_the_variable}'`"- label="Is Build Variable?" /><x-forms.checkbox instantSave id="is_multiline" label="Is Multiline?" />@if ($is_multiline === false)<x-forms.checkbox instantSave id="is_literal"@@ -123,18 +114,12 @@<div class="flex flex-col w-full gap-2 flex-wrap lg:flex-row">@if (!$is_redis_credential)@if ($type === 'service')- <x-forms.checkbox disabled id="is_build_time"- helper="If you are using Docker, remember to modify the file to be ready to receive the build time args. Ex.: for docker file, add `ARG name_of_the_variable`, or dockercompose add `- 'name_of_the_variable=${name_of_the_variable}'`"- label="Is Build Variable?" /><x-forms.checkbox disabled id="is_multiline" label="Is Multiline?" /><x-forms.checkbox disabled id="is_literal"helper="This means that when you use $VARIABLES in a value, it should be interpreted as the actual characters '$VARIABLES' and not as the value of a variable named VARIABLE.<br><br>Useful if you have $ sign in your value and there are some characters after it, but you would not like to interpolate it from another value. In this case, you should set this to true."label="Is Literal?" />@else@if ($is_shared)- <x-forms.checkbox disabled id="is_build_time"- helper="If you are using Docker, remember to modify the file to be ready to receive the build time args. Ex.: for docker file, add `ARG name_of_the_variable`, or dockercompose add `- 'name_of_the_variable=${name_of_the_variable}'`"- label="Is Build Variable?" /><x-forms.checkbox disabled id="is_literal"helper="This means that when you use $VARIABLES in a value, it should be interpreted as the actual characters '$VARIABLES' and not as the value of a variable named VARIABLE.<br><br>Useful if you have $ sign in your value and there are some characters after it, but you would not like to interpolate it from another value. In this case, you should set this to true."label="Is Literal?" />@@ -142,9 +127,6 @@@if ($isSharedVariable)<x-forms.checkbox disabled id="is_multiline" label="Is Multiline?" />@else- <x-forms.checkbox disabled id="is_build_time"- helper="If you are using Docker, remember to modify the file to be ready to receive the build time args. Ex.: for dockerfile, add `ARG name_of_the_variable`, or dockercompose add `- 'name_of_the_variable=${name_of_the_variable}'`"- label="Is Build Variable?" /><x-forms.checkbox disabled id="is_multiline" label="Is Multiline?" />@if ($is_multiline === false)<x-forms.checkbox disabled id="is_literal"