diff --git a/go.mod b/go.mod index 993d2d4..807585a 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/docker/go-connections v0.5.0 github.com/satori/go.uuid v1.2.0 github.com/shirou/gopsutil/v3 v3.24.5 - github.com/shuffle/shuffle-shared v1.2.47 + github.com/shuffle/shuffle-shared v1.2.50 k8s.io/api v0.34.2 k8s.io/apimachinery v0.34.2 ) diff --git a/go.sum b/go.sum index 6a7d63a..fafd7b8 100644 --- a/go.sum +++ b/go.sum @@ -327,8 +327,8 @@ github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shuffle/opensearch-go/v4 v4.0.0 h1:Mh85CD1MwOgXiFFYlzS1llnvdqL3CztRdR1ZT/SLIjU= github.com/shuffle/opensearch-go/v4 v4.0.0/go.mod h1:gVLZKQE5khQWMb68XBtgKrhu78oLGL2zHwAGnFMDwC0= -github.com/shuffle/shuffle-shared v1.2.47 h1:+j7PHBYrB0KyVj6x2ptcDiNm12vQh/zc40/zlPAMmeE= -github.com/shuffle/shuffle-shared v1.2.47/go.mod h1:1DvYhS/4659FdHxzEpHTPuFUW0IfwQSuyluiGTwz9jo= +github.com/shuffle/shuffle-shared v1.2.50 h1:qQ4fDpnsF/XH7Z9Kt/HdRTlrAr/eIr3EsMub7Byes1Y= +github.com/shuffle/shuffle-shared v1.2.50/go.mod h1:1DvYhS/4659FdHxzEpHTPuFUW0IfwQSuyluiGTwz9jo= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= diff --git a/helpers/versioninfo.json b/helpers/versioninfo.json new file mode 100644 index 0000000..353ea92 --- /dev/null +++ b/helpers/versioninfo.json @@ -0,0 +1,30 @@ +{ + "FixedFileInfo": { + "FileVersion": { + "Major": 0, + "Minor": 3, + "Patch": 6, + "Build": 0 + }, + "ProductVersion": { + "Major": 0, + "Minor": 3, + "Patch": 6, + "Build": 0 + }, + "FileFlagsMask": "3f", + "FileFlags": "00", + "FileOS": "VOS_NT_WINDOWS32", + "FileType": "VFT_APP", + "FileSubType": "0" + }, + "StringFileInfo": { + "CompanyName": "Shuffle AS", + "FileDescription": "Orborus Agent", + "ProductName": "Orborus", + "ProductVersion": "{build_number}", + "FileVersion": "{build_number}", + "OriginalFilename": "orborus-agent.exe", + "LegalCopyright": "Copyright (c) 2026" + } +} diff --git a/orborus.go b/orborus.go index b7cf5a7..c7e697e 100755 --- a/orborus.go +++ b/orborus.go @@ -2874,7 +2874,20 @@ func mainLoop() { unmarshalFailed := false hostname, err := getHostname() hasStarted := false + + // Added to handle + originalSleepTime := sleepTime + previousCommandTime := int64(-1) for { + + // Increased polling just after runs happened for sensors + // This makes them more interactive + timenow := time.Now().Unix() + if originalSleepTime != sleepTime && previousCommandTime != -1 && timenow - previousCommandTime > 90 { + log.Printf("[INFO] Resetting sleep time to original value of %d seconds last command. Previous command time: %d", originalSleepTime, previousCommandTime) + sleepTime = originalSleepTime + } + if req.Method == "POST" && !sensorMode.Enabled { // Should find data to send (memory etc.) @@ -3061,6 +3074,11 @@ func mainLoop() { go shuffle.HandleSensorResponseAction(hostname, sensorMode, incRequest) } } + + // Sets polling rate to 1 second in case of jobs for this host to process them faster. Will be set back to default after 60 seconds without jobs for this host to avoid hitting rate limits. + sleepTime = 1 + previousCommandTime = time.Now().Unix() + toBeRemoved.Data = append(toBeRemoved.Data, incRequest) } else { // Just ignore as other machines will handle it.