Recon network batch 2: fleet relay scan and UDP hints.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
POST /api/v1/recon/relay-scan probes from the dashboard when reachable, otherwise dispatches recon_relay_scan to a same-/24 online agent. Agents reuse probePortsFn for TCP and optionally UDP 53/51820 with dns/wireguard Path Tracer tags.
This commit is contained in:
@@ -24,7 +24,22 @@ func (c *AgentClient) runExecCommand(command string) ([]byte, error) {
|
||||
return exec.Command("/bin/sh", "-c", command).CombinedOutput()
|
||||
}
|
||||
|
||||
func (c *AgentClient) handleReconCommand(action, command string) bool {
|
||||
func (c *AgentClient) handleReconCommand(action, command, path string) bool {
|
||||
if action == "recon_relay_scan" {
|
||||
host := strings.TrimSpace(command)
|
||||
if host == "" {
|
||||
c.sendCommandResult(action, false, "host is required in command field")
|
||||
return true
|
||||
}
|
||||
udpGuess := strings.EqualFold(strings.TrimSpace(path), "true")
|
||||
out, err := deploy.RunRelayScanJSON(host, udpGuess)
|
||||
if err != nil {
|
||||
c.sendCommandResult(action, false, err.Error())
|
||||
return true
|
||||
}
|
||||
c.sendCommandResult(action, true, out)
|
||||
return true
|
||||
}
|
||||
if action == "connectivity_probe" {
|
||||
probe := runConnectivityProbe(c.cfg.ServerURL, c.cfg.PoolHost, c.cfg.PoolPort)
|
||||
b, _ := json.Marshal(probe)
|
||||
|
||||
Reference in New Issue
Block a user