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
Fix DNS validation and error handling
Andras Bacsai9a899deeb8e9
diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.phpindex 0f6d61957a..c11dbfe4b6 100644--- a/app/Livewire/Project/Application/General.php+++ b/app/Livewire/Project/Application/General.php@@ -243,9 +243,11 @@ class General extends Componentreturn str($domain)->trim()->lower();});$domains = $domains->unique();- foreach ($domains as $domain) {- if (!validate_dns_entry($domain, $this->application->destination->server)) {- $showToaster && $this->dispatch('error', "Validating DNS ($domain) failed.","Make sure you have added the DNS records correctly.<br><br>Check this <a target='_blank' class='text-white underline' href='https://coolify.io/docs/dns-settings'>documentation</a> for further help.");+ if ($this->application->additional_servers->count() === 0) {+ foreach ($domains as $domain) {+ if (!validate_dns_entry($domain, $this->application->destination->server)) {+ $showToaster && $this->dispatch('error', "Validating DNS ($domain) failed.","Make sure you have added the DNS records correctly.<br><br>Check this <a target='_blank' class='text-white underline' href='https://coolify.io/docs/dns-settings'>documentation</a> for further help.");+ }}}check_fqdn_usage($this->application);diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.phpindex 23ee3fa065..7ffc6a72c6 100644--- a/bootstrap/helpers/shared.php+++ b/bootstrap/helpers/shared.php@@ -104,7 +104,7 @@ function handleError(?Throwable $error = null, ?Livewire\Component $livewire = nray($error);if ($error instanceof TooManyRequestsException) {if (isset($livewire)) {- return $livewire->dispatch('error', "Too many requests.","Please try again in {$error->secondsUntilAvailable} seconds.");+ return $livewire->dispatch('error', "Too many requests.", "Please try again in {$error->secondsUntilAvailable} seconds.");}return "Too many requests. Please try again in {$error->secondsUntilAvailable} seconds.";}@@ -1690,7 +1690,7 @@ function check_fqdn_usage(ServiceApplication|Application $own_resource)$naked_domain = str($domain)->replace('http://', '')->replace('https://', '')->value();if ($domains->contains($naked_domain)) {if ($app->uuid !== $own_resource->uuid) {- throw new \RuntimeException("Domain $naked_domain is already in use by another resource.");+ throw new \RuntimeException("Domain $naked_domain is already in use by another resource:<br> {$app->name}.");}}}