20 lines
845 B
PowerShell
20 lines
845 B
PowerShell
$ErrorActionPreference = "Stop"
|
|
|
|
$serverHost = if ($env:STORYFORGE_CLOUD_HOST) { $env:STORYFORGE_CLOUD_HOST } else { "111.231.132.51" }
|
|
$serverUser = if ($env:STORYFORGE_CLOUD_USER) { $env:STORYFORGE_CLOUD_USER } else { "ubuntu" }
|
|
$localPort = if ($env:STORYFORGE_ASR_LOCAL_PORT) { $env:STORYFORGE_ASR_LOCAL_PORT } else { "8088" }
|
|
$remotePort = if ($env:STORYFORGE_ASR_REMOTE_PORT) { $env:STORYFORGE_ASR_REMOTE_PORT } else { "28088" }
|
|
$identity = if ($env:STORYFORGE_CLOUD_IDENTITY) { $env:STORYFORGE_CLOUD_IDENTITY } else { (Join-Path $env:USERPROFILE ".ssh\storyforge_cloud_bridge_ed25519") }
|
|
|
|
$sshArgs = @(
|
|
"-N",
|
|
"-i", $identity,
|
|
"-o", "StrictHostKeyChecking=no",
|
|
"-o", "ServerAliveInterval=30",
|
|
"-o", "ServerAliveCountMax=3",
|
|
"-R", "127.0.0.1:$remotePort`:127.0.0.1:$localPort",
|
|
"$serverUser@$serverHost"
|
|
)
|
|
|
|
& ssh.exe @sshArgs
|