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: Reset default labels when docker_compose_domains is modified
Andras Bacsaic851262d811f
diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.phpindex 48be897143..91828d42c7 100644--- a/app/Livewire/Project/Application/General.php+++ b/app/Livewire/Project/Application/General.php@@ -350,7 +350,6 @@ class General extends Component$this->checkFqdns();$this->application->save();-if (! $this->customLabels && $this->application->destination->server->proxyType() !== 'NONE') {$this->customLabels = str(implode('|coolify|', generateLabelsApplication($this->application)))->replace('|coolify|', "\n");$this->application->custom_labels = base64_encode($this->customLabels);@@ -364,6 +363,7 @@ class General extends Component}}$this->validate();+if ($this->ports_exposes !== $this->application->ports_exposes || $this->is_container_label_escape_enabled !== $this->application->settings->is_container_label_escape_enabled) {$this->resetDefaultLabels();}@@ -390,6 +390,7 @@ class General extends Component}if ($this->application->build_pack === 'dockercompose') {$this->application->docker_compose_domains = json_encode($this->parsedServiceDomains);+foreach ($this->parsedServiceDomains as $serviceName => $service) {$domain = data_get($service, 'domain');if ($domain) {@@ -399,6 +400,9 @@ class General extends Componentcheck_domain_usage(resource: $this->application);}}+ if ($this->application->isDirty('docker_compose_domains')) {+ $this->resetDefaultLabels();+ }}$this->application->custom_labels = base64_encode($this->customLabels);$this->application->save();diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.phpindex 1efe994368..b500154ba0 100644--- a/bootstrap/helpers/shared.php+++ b/bootstrap/helpers/shared.php@@ -2027,14 +2027,20 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = faldomains: $fqdns,serviceLabels: $serviceLabels,generate_unique_uuid: $resource->build_pack === 'dockercompose',- image: data_get($service, 'image')+ image: data_get($service, 'image'),+ is_force_https_enabled: $resource->isForceHttpsEnabled(),+ is_gzip_enabled: $resource->isGzipEnabled(),+ is_stripprefix_enabled: $resource->isStripprefixEnabled(),));$serviceLabels = $serviceLabels->merge(fqdnLabelsForCaddy(network: $resource->destination->network,uuid: $resource->uuid,domains: $fqdns,serviceLabels: $serviceLabels,- image: data_get($service, 'image')+ image: data_get($service, 'image'),+ is_force_https_enabled: $resource->isForceHttpsEnabled(),+ is_gzip_enabled: $resource->isGzipEnabled(),+ is_stripprefix_enabled: $resource->isStripprefixEnabled(),));}}@@ -2381,7 +2387,6 @@ function check_domain_usage(ServiceApplication|Application|null $resource = nullif ($resource) {if ($resource->getMorphClass() === 'App\Models\Application' && $resource->build_pack === 'dockercompose') {$domains = data_get(json_decode($resource->docker_compose_domains, true), '*.domain');- ray($domains);$domains = collect($domains);} else {$domains = collect($resource->fqdns);