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
feat: add comment field to shared environment variables
Andras Bacsai4e329053ddd2
diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/Add.php b/app/Livewire/Project/Shared/EnvironmentVariable/Add.phpindex fa65e8bd29..73d5393b05 100644--- a/app/Livewire/Project/Shared/EnvironmentVariable/Add.php+++ b/app/Livewire/Project/Shared/EnvironmentVariable/Add.php@@ -31,6 +31,8 @@ class Add extends Componentpublic bool $is_buildtime = true;+ public ?string $comment = null;+public array $problematicVariables = [];protected $listeners = ['clearAddEnv' => 'clear'];@@ -42,6 +44,7 @@ class Add extends Component'is_literal' => 'required|boolean','is_runtime' => 'required|boolean','is_buildtime' => 'required|boolean',+ 'comment' => 'nullable|string|max:256',];protected $validationAttributes = [@@ -51,6 +54,7 @@ class Add extends Component'is_literal' => 'literal','is_runtime' => 'runtime','is_buildtime' => 'buildtime',+ 'comment' => 'comment',];public function mount()@@ -136,6 +140,7 @@ class Add extends Component'is_runtime' => $this->is_runtime,'is_buildtime' => $this->is_buildtime,'is_preview' => $this->is_preview,+ 'comment' => $this->comment,]);$this->clear();}@@ -148,5 +153,6 @@ class Add extends Component$this->is_literal = false;$this->is_runtime = true;$this->is_buildtime = true;+ $this->comment = null;}}diff --git a/app/Livewire/SharedVariables/Environment/Show.php b/app/Livewire/SharedVariables/Environment/Show.phpindex 0bdc1503f4..e1b2302185 100644--- a/app/Livewire/SharedVariables/Environment/Show.php+++ b/app/Livewire/SharedVariables/Environment/Show.php@@ -40,6 +40,7 @@ class Show extends Component'value' => $data['value'],'is_multiline' => $data['is_multiline'],'is_literal' => $data['is_literal'],+ 'comment' => $data['comment'] ?? null,'type' => 'environment','team_id' => currentTeam()->id,]);diff --git a/app/Livewire/SharedVariables/Project/Show.php b/app/Livewire/SharedVariables/Project/Show.phpindex b205ea1ec8..1f304b543e 100644--- a/app/Livewire/SharedVariables/Project/Show.php+++ b/app/Livewire/SharedVariables/Project/Show.php@@ -33,6 +33,7 @@ class Show extends Component'value' => $data['value'],'is_multiline' => $data['is_multiline'],'is_literal' => $data['is_literal'],+ 'comment' => $data['comment'] ?? null,'type' => 'project','team_id' => currentTeam()->id,]);diff --git a/app/Livewire/SharedVariables/Team/Index.php b/app/Livewire/SharedVariables/Team/Index.phpindex e420686f06..75fd415e19 100644--- a/app/Livewire/SharedVariables/Team/Index.php+++ b/app/Livewire/SharedVariables/Team/Index.php@@ -33,6 +33,7 @@ class Index extends Component'value' => $data['value'],'is_multiline' => $data['is_multiline'],'is_literal' => $data['is_literal'],+ 'comment' => $data['comment'] ?? null,'type' => 'team','team_id' => currentTeam()->id,]);diff --git a/app/Models/SharedEnvironmentVariable.php b/app/Models/SharedEnvironmentVariable.phpindex 7956f006a3..9bd42c3281 100644--- a/app/Models/SharedEnvironmentVariable.php+++ b/app/Models/SharedEnvironmentVariable.php@@ -6,7 +6,23 @@ use Illuminate\Database\Eloquent\Model;class SharedEnvironmentVariable extends Model{- protected $guarded = [];+ protected $fillable = [+ // Core identification+ 'key',+ 'value',+ 'comment',++ // Type and relationships+ 'type',+ 'team_id',+ 'project_id',+ 'environment_id',++ // Boolean flags+ 'is_multiline',+ 'is_literal',+ 'is_shown_once',+ ];protected $casts = ['key' => 'string',diff --git a/resources/views/livewire/project/shared/environment-variable/add.blade.php b/resources/views/livewire/project/shared/environment-variable/add.blade.phpindex 9bc4f06a33..a17984d21a 100644--- a/resources/views/livewire/project/shared/environment-variable/add.blade.php+++ b/resources/views/livewire/project/shared/environment-variable/add.blade.php@@ -16,6 +16,9 @@</div>@endif+ <x-forms.input id="comment" label="Comment (Optional)"+ helper="Add a note to document what this environment variable is used for." maxlength="256" />+@if (!$shared)<x-forms.checkbox id="is_buildtime"helper="Make this variable available during Docker build process. Useful for build secrets and dependencies."