From 3f9833117e9d1925322e962831bb43a7980cb6dd Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 3 May 2024 10:32:04 +0200 Subject: [PATCH] Refactor Server.php to remove unnecessary coolify.yaml from cloud hosted servers --- app/Models/Server.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Server.php b/app/Models/Server.php index 8f66f44e7..a265af729 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -240,7 +240,7 @@ public function setupDynamicProxyConfiguration() $dynamic_config_path = $this->proxyPath() . "/dynamic"; if ($this->proxyType() === 'TRAEFIK_V2') { $file = "$dynamic_config_path/coolify.yaml"; - if (empty($settings->fqdn) || isCloud()) { + if (empty($settings->fqdn) || (isCloud() && $this->id !== 0)) { instant_remote_process([ "rm -f $file", ], $this); @@ -359,7 +359,7 @@ public function setupDynamicProxyConfiguration() } } else if ($this->proxyType() === 'CADDY') { $file = "$dynamic_config_path/coolify.caddy"; - if (empty($settings->fqdn)) { + if (empty($settings->fqdn) || (isCloud() && $this->id !== 0)) { instant_remote_process([ "rm -f $file", ], $this);