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 EditDomain.php and shared.php to improve DockerCompose parsing logic
Andras Bacsai816461010598
diff --git a/app/Livewire/Project/Service/EditDomain.php b/app/Livewire/Project/Service/EditDomain.phpindex 87a4a05460..a09d6aa38c 100644--- a/app/Livewire/Project/Service/EditDomain.php+++ b/app/Livewire/Project/Service/EditDomain.php@@ -41,7 +41,7 @@ class EditDomain extends Component} catch (\Throwable $e) {return handleError($e, $this);} finally {- $this->dispatch('generateDockerCompose');+ $this->application->service->parse();$this->dispatch('refresh');$this->dispatch('configurationChanged');}diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.phpindex afb7982a76..d26cd91905 100644--- a/bootstrap/helpers/shared.php+++ b/bootstrap/helpers/shared.php@@ -980,15 +980,18 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal]);}// Caddy needs exact port in some cases.- ray($predefinedPort);if ($predefinedPort && !$key->endsWith("_{$predefinedPort}")) {+ $fqdns_exploded = str($savedService->fqdn)->explode(',');+ if ($fqdns_exploded->count() > 1) {+ continue;+ }if ($resource->server->proxyType() === 'CADDY') {$env = EnvironmentVariable::where(['key' => $key,'service_id' => $resource->id,])->first();- ray($env);if ($env) {+$env_url = Url::fromString($savedService->fqdn);$env_port = $env_url->getPort();if ($env_port !== $predefinedPort) {@@ -1050,6 +1053,10 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal}// Caddy needs exact port in some cases.if ($predefinedPort && !$key->endsWith("_{$predefinedPort}") && $command?->value() === 'FQDN' && $resource->server->proxyType() === 'CADDY') {+ $fqdns_exploded = str($savedService->fqdn)->explode(',');+ if ($fqdns_exploded->count() > 1) {+ continue;+ }$env = EnvironmentVariable::where(['key' => $key,'service_id' => $resource->id,