From 41d366d27e3a60bb497550abee31daa95d89336e Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 25 May 2023 12:04:43 +0200 Subject: [PATCH] remove dynamic config --- app/Http/Livewire/Settings/Form.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/app/Http/Livewire/Settings/Form.php b/app/Http/Livewire/Settings/Form.php index 15169096f..4279a7a29 100644 --- a/app/Http/Livewire/Settings/Form.php +++ b/app/Http/Livewire/Settings/Form.php @@ -48,14 +48,20 @@ class Form extends Component } $this->validate(); $this->settings->save(); - if (isset($this->settings->fqdn)) { - if (config('app.env') == 'local') { - $server = Server::findOrFail(1); - $dynamic_config_path = '/data/coolify/proxy/dynamic'; - } else { - $server = Server::findOrFail(0); - $dynamic_config_path = '/traefik/dynamic'; - } + + if (config('app.env') == 'local') { + $server = Server::findOrFail(1); + $dynamic_config_path = '/data/coolify/proxy/dynamic'; + } else { + $server = Server::findOrFail(0); + $dynamic_config_path = '/traefik/dynamic'; + } + + if (empty($this->settings->fqdn)) { + remote_process([ + "rm -f $dynamic_config_path/coolify.yaml", + ], $server, ActivityTypes::INLINE->value); + } else { $url = Url::fromString($this->settings->fqdn); $host = $url->getHost(); $schema = $url->getScheme();