From 3ba4a5cfb52e592b5808c542ce05aa88a1cb99d9 Mon Sep 17 00:00:00 2001 From: Joao Patricio Date: Fri, 12 May 2023 19:51:07 +0100 Subject: [PATCH] wip --- app/Actions/Proxy/CheckProxySettingsInSync.php | 11 ++++++++++- app/Http/Livewire/Server/Proxy.php | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/Actions/Proxy/CheckProxySettingsInSync.php b/app/Actions/Proxy/CheckProxySettingsInSync.php index 98225d414..0a63a0735 100644 --- a/app/Actions/Proxy/CheckProxySettingsInSync.php +++ b/app/Actions/Proxy/CheckProxySettingsInSync.php @@ -17,8 +17,17 @@ class CheckProxySettingsInSync ProxyTypes::TRAEFIK_V2->value => 'proxy', }; - return instantRemoteProcess([ + $container_name = 'coolify-proxy'; + + $output = instantRemoteProcess([ 'if [ -d "projects/'.$folder_name.'" ]; then echo "true"; else echo "false"; fi', + <</dev/null)" == "true" ]] && echo "true" || echo "false" + EOT, ], $server); + + return collect( + explode(PHP_EOL, $output) + )->every(fn($output) => $output === 'true'); } } diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php index 40fe2e4cc..16e92cf48 100644 --- a/app/Http/Livewire/Server/Proxy.php +++ b/app/Http/Livewire/Server/Proxy.php @@ -33,9 +33,9 @@ class Proxy extends Component public function checkProxySettingsInSync() { - $status = resolve(CheckProxySettingsInSync::class)($this->server); + $this->is_proxy_settings_in_sync = resolve(CheckProxySettingsInSync::class)($this->server); + $this->is_check_proxy_complete = true; - $this->is_proxy_settings_in_sync = $status === 'true'; } public function render()