diff --git a/scripts/deploy-from-workstation.ps1 b/scripts/deploy-from-workstation.ps1 index 00e343e1..cb2695e6 100644 --- a/scripts/deploy-from-workstation.ps1 +++ b/scripts/deploy-from-workstation.ps1 @@ -30,6 +30,7 @@ $repoRoot = (Resolve-Path (Join-Path $scriptRoot '..')).Path . (Join-Path $scriptRoot 'deploy-auth.ps1') $authSession = $null $sshOptions = @() +$tunnelSshOptions = @() $scpOptions = @() if ($IsMacOS) { $scpOptions += '-O' } $sshControlPath = if ($IsMacOS) { "/tmp/caiwu-ssh-$PID-$([Guid]::NewGuid().ToString('N')).sock" } else { $null } @@ -280,7 +281,7 @@ function Start-RegistryTunnel { $startInfo.FileName = $sshPath $startInfo.UseShellExecute = $false $startInfo.CreateNoWindow = $true - foreach ($argument in ($sshOptions + @( + foreach ($argument in ($tunnelSshOptions + @( '-N', '-o', 'ConnectTimeout=10', '-o', 'ExitOnForwardFailure=yes', @@ -347,6 +348,7 @@ try { $authSession = Start-CaiwuDeploymentAuth -Server $Server -SshUser $SshUser -KeyPath $KeyPath -Password $Password -UpdatePassword:$UpdatePassword $sshOptions = $authSession.Options + $tunnelSshOptions = @($sshOptions) if ($sshControlPath) { $sshOptions += @('-o', 'ControlMaster=auto', '-o', 'ControlPersist=600', '-o', "ControlPath=$sshControlPath") }