Improve fleet control, Crucible ops, and multi-machine identity.

Use hostname-first agent names so the same forged binary on many machines stays distinct at scale. Add WebSocket RTT latency on the roster and Crucible, fleet delete and uninstall flows, live alert config reload, and non-blocking pool setup. Fix Crucible phantom agents after delete, posture scan targeting, and USB portability (config data_dir, LAUNCH sync).
This commit is contained in:
AetherForge
2026-06-02 19:19:50 -07:00
parent 5222f4ad39
commit 01d76b3730
32 changed files with 737 additions and 229 deletions

View File

@@ -106,7 +106,18 @@ if not exist "%ROOT%\data\blueprints" mkdir "%ROOT%\data\blueprints"
if not exist "%ROOT%\data\preps" mkdir "%ROOT%\data\preps"
:: ----------------------------------------------------------------
:: 5. Detect LAN IP for display
:: 5. Configure optional Cloudflare tunnel (foreground process, no service)
:: ----------------------------------------------------------------
set "CLOUDFLARED_BIN=%ROOT%\tools\cloudflared.exe"
set "CF_PID_FILE=%ROOT%\data\cloudflared.pid"
set "CF_TUNNEL_TOKEN="
if defined AF_TUNNEL_TOKEN set "CF_TUNNEL_TOKEN=%AF_TUNNEL_TOKEN%"
if not defined CF_TUNNEL_TOKEN if exist "%ROOT%\data\cloudflared-token.txt" (
set /p CF_TUNNEL_TOKEN=<"%ROOT%\data\cloudflared-token.txt"
)
:: ----------------------------------------------------------------
:: 6. Detect LAN IP for display
:: ----------------------------------------------------------------
set "SERVER_PORT=8989"
for /f "tokens=2 delims=:" %%I in ('ipconfig ^| findstr /i "IPv4" ^| findstr /v "127.0.0.1"') do (
@@ -118,9 +129,10 @@ set "LAN_IP=localhost"
set "LAN_IP=%LAN_IP: =%"
:: ----------------------------------------------------------------
:: 6. Kill any stale server process
:: 7. Kill any stale server and tunnel processes
:: ----------------------------------------------------------------
taskkill /F /IM AetherForge.exe >nul 2>nul
taskkill /F /IM cloudflared.exe >nul 2>nul
ping -n 2 127.0.0.1 >nul
echo.
@@ -136,6 +148,30 @@ echo Press Ctrl+C to stop.
echo ================================================================
echo.
:: Start optional Cloudflare tunnel for this launcher session only.
if defined CF_TUNNEL_TOKEN (
if not exist "%ROOT%\tools" mkdir "%ROOT%\tools"
if not exist "%CLOUDFLARED_BIN%" (
echo [Tunnel] Downloading cloudflared.exe...
powershell -NoProfile -ExecutionPolicy Bypass -Command "& { [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe' -OutFile $env:CLOUDFLARED_BIN }"
)
if exist "%CLOUDFLARED_BIN%" (
del "%CF_PID_FILE%" 2>nul
echo [Tunnel] Starting Cloudflare tunnel for this session ^(no service install^).
powershell -NoProfile -ExecutionPolicy Bypass -Command "$p = Start-Process -FilePath $env:CLOUDFLARED_BIN -ArgumentList @('tunnel','--no-autoupdate','run','--token',$env:CF_TUNNEL_TOKEN) -WindowStyle Hidden -PassThru; Set-Content -LiteralPath $env:CF_PID_FILE -Value $p.Id"
if errorlevel 1 (
echo [Tunnel] WARNING: cloudflared failed to start.
) else (
echo [Tunnel] Tunnel process started. It will stop when this launcher exits.
)
) else (
echo [Tunnel] WARNING: cloudflared.exe unavailable; tunnel skipped.
)
) else (
echo [Tunnel] Disabled. Add token to data\cloudflared-token.txt or set AF_TUNNEL_TOKEN.
)
echo.
:: Open browser after short delay
start "" powershell -NoProfile -WindowStyle Hidden -Command "Start-Sleep -Seconds 3; Start-Process 'http://localhost:%SERVER_PORT%/'"
@@ -143,6 +179,13 @@ start "" powershell -NoProfile -WindowStyle Hidden -Command "Start-Sleep -Second
"%ROOT%\AetherForge.exe" -port %SERVER_PORT% -data "%ROOT%\data"
set "EC=!ERRORLEVEL!"
if exist "%CF_PID_FILE%" (
for /f "usebackq" %%P in ("%CF_PID_FILE%") do (
powershell -NoProfile -ExecutionPolicy Bypass -Command "Stop-Process -Id %%P -Force -ErrorAction SilentlyContinue" >nul 2>nul
)
del "%CF_PID_FILE%" 2>nul
)
echo.
if "!EC!"=="0" (
echo [Server] Stopped normally.