Deploy ttstd relay and configure secure public WSS clients
This commit is contained in:
1 parent
82adce545d
commit
c38f067bea
16 files changed
+384
-24
No files matched your search
@@ -0,0 +1,25 @@
|
||||
param(
|
||||
[string]$Server = 'wss://ttstd.com/ads',
|
||||
[string]$ConnectAddress = '175.178.213.60:443',
|
||||
[string]$Device = 'home-phone',
|
||||
[string]$Target = '192.168.100.141:5555',
|
||||
[string]$AdbServer,
|
||||
[string]$AdbSerial
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$projectRoot = Split-Path $PSScriptRoot -Parent
|
||||
$tokenFile = Join-Path $projectRoot 'config/private/agent.env'
|
||||
if (-not $env:ADS_AGENT_TOKEN -and (Test-Path -LiteralPath $tokenFile)) {
|
||||
foreach ($line in Get-Content -LiteralPath $tokenFile) {
|
||||
if ($line.StartsWith('ADS_AGENT_TOKEN=')) { $env:ADS_AGENT_TOKEN = $line.Substring(16) }
|
||||
}
|
||||
}
|
||||
if (-not $env:ADS_AGENT_TOKEN) { throw 'Set ADS_AGENT_TOKEN or provide config/private/agent.env' }
|
||||
$arguments = @('--server', $Server, '--device', $Device)
|
||||
if ($ConnectAddress) { $arguments += @('--connect-address', $ConnectAddress) }
|
||||
if ($AdbSerial) {
|
||||
if (-not $AdbServer) { $AdbServer = '127.0.0.1:5037' }
|
||||
$arguments += @('--adb-server', $AdbServer, '--adb-serial', $AdbSerial)
|
||||
} else { $arguments += @('--target', $Target) }
|
||||
& (Join-Path $projectRoot 'bin/ads-agent.exe') @arguments
|
||||
exit $LASTEXITCODE
|
||||
@@ -0,0 +1,20 @@
|
||||
param(
|
||||
[string]$Server = 'wss://ttstd.com/ads',
|
||||
[string]$ConnectAddress = '175.178.213.60:443',
|
||||
[string]$Device = 'home-phone',
|
||||
[string]$Listen = '127.0.0.1:15555',
|
||||
[string]$Adb = 'adb'
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$projectRoot = Split-Path $PSScriptRoot -Parent
|
||||
$tokenFile = Join-Path $projectRoot 'config/private/client.env'
|
||||
if (-not $env:ADS_CLIENT_TOKEN -and (Test-Path -LiteralPath $tokenFile)) {
|
||||
foreach ($line in Get-Content -LiteralPath $tokenFile) {
|
||||
if ($line.StartsWith('ADS_CLIENT_TOKEN=')) { $env:ADS_CLIENT_TOKEN = $line.Substring(17) }
|
||||
}
|
||||
}
|
||||
if (-not $env:ADS_CLIENT_TOKEN) { throw 'Set ADS_CLIENT_TOKEN or provide config/private/client.env' }
|
||||
$arguments = @('--server', $Server, '--device', $Device, '--listen', $Listen, '--adb', $Adb)
|
||||
if ($ConnectAddress) { $arguments += @('--connect-address', $ConnectAddress) }
|
||||
& (Join-Path $projectRoot 'bin/ads-client.exe') @arguments
|
||||
exit $LASTEXITCODE
|
||||
Reference in new issue
Block a user