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 custom labels handling in General.php and update Docker Compose Content label in general.blade.php
Andras Bacsai83d96c8d114c
diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.phpindex 58dbed11ec..798794e49d 100644--- a/app/Livewire/Project/Application/General.php+++ b/app/Livewire/Project/Application/General.php@@ -117,7 +117,9 @@ class General extends Component$this->isConfigurationChanged = $this->application->isConfigurationChanged();$this->customLabels = $this->application->parseContainerLabels();if (!$this->customLabels) {- $this->resetDefaultLabels(false);+ $this->customLabels = str(implode(",", generateLabelsApplication($this->application)))->replace(',', "\n");+ $this->application->custom_labels = base64_encode($this->customLabels);+ $this->application->save();}$this->initialDockerComposeLocation = $this->application->docker_compose_location;$this->checkLabelUpdates();@@ -204,7 +206,12 @@ class General extends Componentpublic function submit($showToaster = true){try {- ray($this->initialDockerComposeLocation, $this->application->docker_compose_location);+ if (!$this->customLabels) {+ $this->customLabels = str(implode(",", generateLabelsApplication($this->application)))->replace(',', "\n");+ $this->application->custom_labels = base64_encode($this->customLabels);+ $this->application->save();+ }+if ($this->application->build_pack === 'dockercompose' && $this->initialDockerComposeLocation !== $this->application->docker_compose_location) {$this->loadComposeFile();}@@ -212,9 +219,7 @@ class General extends Componentif ($this->ports_exposes !== $this->application->ports_exposes) {$this->resetDefaultLabels(false);}- if (!$this->customLabels) {- $this->resetDefaultLabels(false);- }+if (data_get($this->application, 'build_pack') === 'dockerimage') {$this->validate(['application.docker_registry_image_name' => 'required',diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.phpindex 8d38aa1899..3f6d3984f6 100644--- a/resources/views/livewire/project/application/general.blade.php+++ b/resources/views/livewire/project/application/general.blade.php@@ -189,7 +189,7 @@<x-forms.button wire:click="loadComposeFile">Reload Compose File</x-forms.button>@if ($application->settings->is_raw_compose_deployment_enabled)<x-forms.textarea rows="10" readonly id="application.docker_compose_raw"- label="Docker Compose Content" helper="You need to modify the docker compose file." />+ label="Docker Compose Content (applicationId: {{$application->id}})" helper="You need to modify the docker compose file." />@else<x-forms.textarea rows="10" readonly id="application.docker_compose"label="Docker Compose Content" helper="You need to modify the docker compose file." />