Skip to content

Commit 4aeb8ff

Browse files
committed
Fix: SSH Multiplexing on docker desktop on Windows
1 parent 9e90daf commit 4aeb8ff

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

bootstrap/helpers/remoteProcess.php

Lines changed: 14 additions & 6 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,9 +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);
168-
// ray('SSH Multiplexing Enabled:', $muxEnabled)->blue();
164+
$muxEnabled = config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false;
169165

170166
if ($muxEnabled) {
171167
// Always use multiplexing when enabled
@@ -201,6 +197,10 @@ function generateSshCommand(Server $server, string $command)
201197

202198
function ensureMultiplexedConnection(Server $server)
203199
{
200+
if (!(config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false)) {
201+
return;
202+
}
203+
204204
static $ensuredConnections = [];
205205

206206
if (isset($ensuredConnections[$server->id])) {
@@ -260,6 +260,10 @@ function ensureMultiplexedConnection(Server $server)
260260

261261
function shouldResetMultiplexedConnection(Server $server)
262262
{
263+
if (!(config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false)) {
264+
return false;
265+
}
266+
263267
static $ensuredConnections = [];
264268

265269
if (! isset($ensuredConnections[$server->id])) {
@@ -275,6 +279,10 @@ function shouldResetMultiplexedConnection(Server $server)
275279

276280
function resetMultiplexedConnection(Server $server)
277281
{
282+
if (!(config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false)) {
283+
return;
284+
}
285+
278286
static $ensuredConnections = [];
279287

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

0 commit comments

Comments
 (0)