Skip to content

Commit 7dd0588

Browse files
authored
Merge pull request coollabsio#3405 from peaklabs-dev/fix-ssh-multiplexing-docker-desktop-windows
Fix: SSH-Multiplexing on docker desktop for windows
2 parents 75f266f + a95ebb4 commit 7dd0588

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

bootstrap/helpers/remoteProcess.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,10 @@ function generateScpCommand(Server $server, string $source, string $dest)
9898
$muxPersistTime = config('constants.ssh.mux_persist_time');
9999

100100
$scp_command = "timeout $timeout scp ";
101-
// Check if multiplexing is enabled
102-
$muxEnabled = config('constants.ssh.mux_enabled', true);
101+
$muxEnabled = config('constants.ssh.mux_enabled', true) && config('coolify.is_windows_docker_desktop') == false;
103102
// ray('SSH Multiplexing Enabled:', $muxEnabled)->blue();
104103

105104
if ($muxEnabled) {
106-
// Always use multiplexing when enabled
107105
$muxSocket = "/var/www/html/storage/app/ssh/mux/{$server->muxFilename()}";
108106
$scp_command .= "-o ControlMaster=auto -o ControlPath=$muxSocket -o ControlPersist={$muxPersistTime} ";
109107
ensureMultiplexedConnection($server);
@@ -163,8 +161,7 @@ function generateSshCommand(Server $server, string $command)
163161

164162
$ssh_command = "timeout $timeout ssh ";
165163

166-
// Check if multiplexing is enabled
167-
$muxEnabled = config('constants.ssh.mux_enabled', true);
164+
$muxEnabled = config('constants.ssh.mux_enabled') && config('coolify.is_windows_docker_desktop') == false;
168165
// ray('SSH Multiplexing Enabled:', $muxEnabled)->blue();
169166
if ($muxEnabled) {
170167
// Always use multiplexing when enabled
@@ -200,6 +197,10 @@ function generateSshCommand(Server $server, string $command)
200197

201198
function ensureMultiplexedConnection(Server $server)
202199
{
200+
if (!(config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false)) {
201+
return;
202+
}
203+
203204
static $ensuredConnections = [];
204205

205206
if (isset($ensuredConnections[$server->id])) {
@@ -267,6 +268,10 @@ function ensureMultiplexedConnection(Server $server)
267268

268269
function shouldResetMultiplexedConnection(Server $server)
269270
{
271+
if (!(config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false)) {
272+
return false;
273+
}
274+
270275
static $ensuredConnections = [];
271276

272277
if (! isset($ensuredConnections[$server->id])) {
@@ -282,6 +287,10 @@ function shouldResetMultiplexedConnection(Server $server)
282287

283288
function resetMultiplexedConnection(Server $server)
284289
{
290+
if (!(config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false)) {
291+
return;
292+
}
293+
285294
static $ensuredConnections = [];
286295

287296
if (isset($ensuredConnections[$server->id])) {

0 commit comments

Comments
 (0)