Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat: able to control multiplexing

Andras Bacsai8cc5276c9deb
diff --git a/bootstrap/helpers.php b/bootstrap/helpers.php
index 64e2fa8b22..892a3cf91e 100644
--- a/bootstrap/helpers.php
+++ b/bootstrap/helpers.php
@@ -62,22 +62,26 @@ if (!function_exists('savePrivateKey')) {
}
if (!function_exists('generateSshCommand')) {
- function generateSshCommand(string $private_key_location, string $server_ip, string $user, string $port, $command)
+ function generateSshCommand(string $private_key_location, string $server_ip, string $user, string $port, string $command, bool $isMux = true)
{
$delimiter = 'EOF-COOLIFY-SSH';
Storage::disk('local')->makeDirectory('.ssh');
- $ssh_command = "ssh "
- . "-i {$private_key_location} "
+ $ssh_command = "ssh ";
+ if ($isMux) {
+ $ssh_command .= '-o ControlMaster=auto -o ControlPersist=1m -o ControlPath=/var/www/html/storage/app/.ssh/ssh_mux_%h_%p_%r ';
+ }
+ $ssh_command .= "-i {$private_key_location} "
. '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null '
. '-o PasswordAuthentication=no '
. '-o RequestTTY=no '
. '-o LogLevel=ERROR '
- . '-o ControlMaster=auto -o ControlPersist=1m -o ControlPath=/var/www/html/storage/app/.ssh/ssh_mux_%h_%p_%r '
. "-p {$port} "
. "{$user}@{$server_ip} "
. " 'bash -se' << \\$delimiter" . PHP_EOL
. $command . PHP_EOL
. $delimiter;
+
+ dd($ssh_command);
return $ssh_command;
}
}
@@ -108,7 +112,5 @@ if (!function_exists('formatDockerLabelsToJson')) {
return [$outputLine[0] => $outputLine[1]];
});
})[0];
-
}
}
-