20 lines
878 B
PowerShell
20 lines
878 B
PowerShell
param(
|
|
[string]$PagerHost = "172.16.52.1",
|
|
[int]$Port = 8000,
|
|
[switch]$Tunnel
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$Root = Split-Path -Parent $PSScriptRoot
|
|
$Python = "$env:LOCALAPPDATA\Programs\Python\Python311\python.exe"
|
|
if (-not (Test-Path $Python)) { throw "Python 3.11 not found. Install with: winget install Python.Python.3.11" }
|
|
|
|
if ($Tunnel) {
|
|
Write-Host "Opening SSH tunnel 1471 -> 127.0.0.1:1471 (for direct terminal WS). Close the ssh window to stop it."
|
|
Start-Process ssh -ArgumentList "-N","-L","1471:127.0.0.1:1471","root@$PagerHost" -WindowStyle Minimized
|
|
}
|
|
|
|
Write-Host "Dev server: http://127.0.0.1:$Port (API proxied to http://$PagerHost:8080)"
|
|
Write-Host "Requires the backend deployed: scripts\deploy.ps1"
|
|
& $Python "$PSScriptRoot\dev_proxy.py" --pager-host $PagerHost --port $Port --www "$Root\payload\user\remote_access\pager-webui\www"
|