From 301469de6bf2067e086f86c53010cec66800911b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 21 Sep 2023 11:03:52 +0200 Subject: [PATCH] fix: save proxy configuration --- app/Actions/Proxy/SaveConfiguration.php | 6 ++++-- app/Http/Livewire/Server/Proxy.php | 2 +- app/Http/Livewire/Server/Proxy/Deploy.php | 7 ------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/Actions/Proxy/SaveConfiguration.php b/app/Actions/Proxy/SaveConfiguration.php index 85aebf619..edf4f3434 100644 --- a/app/Actions/Proxy/SaveConfiguration.php +++ b/app/Actions/Proxy/SaveConfiguration.php @@ -10,9 +10,11 @@ class SaveConfiguration { use AsAction; - public function handle(Server $server) + public function handle(Server $server, ?string $proxy_settings = null) { - $proxy_settings = CheckConfiguration::run($server, true); + if (is_null($proxy_settings)) { + $proxy_settings = CheckConfiguration::run($server, true); + } $proxy_path = get_proxy_path(); $docker_compose_yml_base64 = base64_encode($proxy_settings); diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php index 560bdd784..e4dd310eb 100644 --- a/app/Http/Livewire/Server/Proxy.php +++ b/app/Http/Livewire/Server/Proxy.php @@ -47,7 +47,7 @@ class Proxy extends Component public function submit() { try { - SaveConfiguration::run($this->server); + SaveConfiguration::run($this->server, $this->proxy_settings); $this->server->proxy->redirect_url = $this->redirect_url; $this->server->save(); diff --git a/app/Http/Livewire/Server/Proxy/Deploy.php b/app/Http/Livewire/Server/Proxy/Deploy.php index 506fd3b81..790d9a251 100644 --- a/app/Http/Livewire/Server/Proxy/Deploy.php +++ b/app/Http/Livewire/Server/Proxy/Deploy.php @@ -20,13 +20,6 @@ class Deploy extends Component public function startProxy() { try { - if ( - $this->server->proxy->last_applied_settings && - $this->server->proxy->last_saved_settings !== $this->server->proxy->last_applied_settings - ) { - SaveConfiguration::run($this->server); - } - $activity = StartProxy::run($this->server); $this->emit('newMonitorActivity', $activity->id); } catch (\Throwable $e) {