From 7e9a54ce67ff0770a0271b802c51ca50aa1f3220 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 26 Jan 2024 08:54:56 +0100 Subject: [PATCH] Fix SSH command generation and disable mux in validateConnection() --- app/Models/Server.php | 2 ++ bootstrap/helpers/remoteProcess.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Models/Server.php b/app/Models/Server.php index dcbb0dde3..432a296e9 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -398,6 +398,8 @@ class Server extends BaseModel } public function validateConnection() { + config()->set('coolify.mux_enabled', false); + $server = Server::find($this->id); if (!$server) { return false; diff --git a/bootstrap/helpers/remoteProcess.php b/bootstrap/helpers/remoteProcess.php index a6838f7f3..d57579b5b 100644 --- a/bootstrap/helpers/remoteProcess.php +++ b/bootstrap/helpers/remoteProcess.php @@ -108,7 +108,7 @@ function instant_scp(string $source, string $dest, Server $server, $throwError = } return $output; } -function generateSshCommand(Server $server, string $command, bool $isMux = true) +function generateSshCommand(Server $server, string $command) { $user = $server->user; $port = $server->port; @@ -120,7 +120,7 @@ function generateSshCommand(Server $server, string $command, bool $isMux = true) $delimiter = 'EOF-COOLIFY-SSH'; $ssh_command = "timeout $timeout ssh "; - if ($isMux && config('coolify.mux_enabled') === true && config('coolify.is_windows_docker_desktop') === false) { + if (config('coolify.mux_enabled') === true && config('coolify.is_windows_docker_desktop') === false) { $ssh_command .= '-o ControlMaster=auto -o ControlPersist=1m -o ControlPath=/var/www/html/storage/app/ssh/mux/%h_%p_%r '; } if (data_get($server, 'settings.is_cloudflare_tunnel')) {