fix: prevent instance fqdn persisting to other servers dynamic proxy configs

fixes: 2650
This commit is contained in:
Koby Wood 2024-07-06 19:33:11 -04:00
parent 9c821e2480
commit 52d7841334

View File

@ -238,7 +238,7 @@ public function setupDynamicProxyConfiguration()
$dynamic_config_path = $this->proxyPath().'/dynamic'; $dynamic_config_path = $this->proxyPath().'/dynamic';
if ($this->proxyType() === 'TRAEFIK_V2') { if ($this->proxyType() === 'TRAEFIK_V2') {
$file = "$dynamic_config_path/coolify.yaml"; $file = "$dynamic_config_path/coolify.yaml";
if (empty($settings->fqdn) || (isCloud() && $this->id !== 0)) { if (empty($settings->fqdn) || (isCloud() && $this->id !== 0) || !$this->isLocalhost()) {
instant_remote_process([ instant_remote_process([
"rm -f $file", "rm -f $file",
], $this); ], $this);
@ -344,7 +344,7 @@ public function setupDynamicProxyConfiguration()
} }
} elseif ($this->proxyType() === 'CADDY') { } elseif ($this->proxyType() === 'CADDY') {
$file = "$dynamic_config_path/coolify.caddy"; $file = "$dynamic_config_path/coolify.caddy";
if (empty($settings->fqdn) || (isCloud() && $this->id !== 0)) { if (empty($settings->fqdn) || (isCloud() && $this->id !== 0) || !$this->isLocalhost()) {
instant_remote_process([ instant_remote_process([
"rm -f $file", "rm -f $file",
], $this); ], $this);