Merge pull request #3405 from peaklabs-dev/fix-ssh-multiplexing-docker-desktop-windows
Fix: SSH-Multiplexing on docker desktop for windows
This commit is contained in:
@@ -98,12 +98,10 @@ function generateScpCommand(Server $server, string $source, string $dest)
|
|||||||
$muxPersistTime = config('constants.ssh.mux_persist_time');
|
$muxPersistTime = config('constants.ssh.mux_persist_time');
|
||||||
|
|
||||||
$scp_command = "timeout $timeout scp ";
|
$scp_command = "timeout $timeout scp ";
|
||||||
// Check if multiplexing is enabled
|
$muxEnabled = config('constants.ssh.mux_enabled', true) && config('coolify.is_windows_docker_desktop') == false;
|
||||||
$muxEnabled = config('constants.ssh.mux_enabled', true);
|
|
||||||
// ray('SSH Multiplexing Enabled:', $muxEnabled)->blue();
|
// ray('SSH Multiplexing Enabled:', $muxEnabled)->blue();
|
||||||
|
|
||||||
if ($muxEnabled) {
|
if ($muxEnabled) {
|
||||||
// Always use multiplexing when enabled
|
|
||||||
$muxSocket = "/var/www/html/storage/app/ssh/mux/{$server->muxFilename()}";
|
$muxSocket = "/var/www/html/storage/app/ssh/mux/{$server->muxFilename()}";
|
||||||
$scp_command .= "-o ControlMaster=auto -o ControlPath=$muxSocket -o ControlPersist={$muxPersistTime} ";
|
$scp_command .= "-o ControlMaster=auto -o ControlPath=$muxSocket -o ControlPersist={$muxPersistTime} ";
|
||||||
ensureMultiplexedConnection($server);
|
ensureMultiplexedConnection($server);
|
||||||
@@ -163,8 +161,7 @@ function generateSshCommand(Server $server, string $command)
|
|||||||
|
|
||||||
$ssh_command = "timeout $timeout ssh ";
|
$ssh_command = "timeout $timeout ssh ";
|
||||||
|
|
||||||
// Check if multiplexing is enabled
|
$muxEnabled = config('constants.ssh.mux_enabled') && config('coolify.is_windows_docker_desktop') == false;
|
||||||
$muxEnabled = config('constants.ssh.mux_enabled', true);
|
|
||||||
// ray('SSH Multiplexing Enabled:', $muxEnabled)->blue();
|
// ray('SSH Multiplexing Enabled:', $muxEnabled)->blue();
|
||||||
if ($muxEnabled) {
|
if ($muxEnabled) {
|
||||||
// Always use multiplexing when enabled
|
// Always use multiplexing when enabled
|
||||||
@@ -200,6 +197,10 @@ function generateSshCommand(Server $server, string $command)
|
|||||||
|
|
||||||
function ensureMultiplexedConnection(Server $server)
|
function ensureMultiplexedConnection(Server $server)
|
||||||
{
|
{
|
||||||
|
if (!(config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static $ensuredConnections = [];
|
static $ensuredConnections = [];
|
||||||
|
|
||||||
if (isset($ensuredConnections[$server->id])) {
|
if (isset($ensuredConnections[$server->id])) {
|
||||||
@@ -267,6 +268,10 @@ function ensureMultiplexedConnection(Server $server)
|
|||||||
|
|
||||||
function shouldResetMultiplexedConnection(Server $server)
|
function shouldResetMultiplexedConnection(Server $server)
|
||||||
{
|
{
|
||||||
|
if (!(config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static $ensuredConnections = [];
|
static $ensuredConnections = [];
|
||||||
|
|
||||||
if (! isset($ensuredConnections[$server->id])) {
|
if (! isset($ensuredConnections[$server->id])) {
|
||||||
@@ -282,6 +287,10 @@ function shouldResetMultiplexedConnection(Server $server)
|
|||||||
|
|
||||||
function resetMultiplexedConnection(Server $server)
|
function resetMultiplexedConnection(Server $server)
|
||||||
{
|
{
|
||||||
|
if (!(config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static $ensuredConnections = [];
|
static $ensuredConnections = [];
|
||||||
|
|
||||||
if (isset($ensuredConnections[$server->id])) {
|
if (isset($ensuredConnections[$server->id])) {
|
||||||
|
Reference in New Issue
Block a user