Fix SSH command generation and disable mux in validateConnection()

This commit is contained in:
Andras Bacsai 2024-01-26 08:54:56 +01:00
parent f8c19e1fb3
commit 7e9a54ce67
2 changed files with 4 additions and 2 deletions

View File

@ -398,6 +398,8 @@ public function isSwarmWorker()
}
public function validateConnection()
{
config()->set('coolify.mux_enabled', false);
$server = Server::find($this->id);
if (!$server) {
return false;

View File

@ -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')) {