From eddafb873b21781828fa0b404b3b6cebd2b28776 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 29 Oct 2022 16:02:08 -0700 Subject: [PATCH 01/14] remove stale inno temp files --- agent/process.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/agent/process.go b/agent/process.go index ae7c392..6409bc3 100644 --- a/agent/process.go +++ b/agent/process.go @@ -13,6 +13,8 @@ package agent import ( "fmt" + "os" + "path/filepath" "strings" rmm "github.com/amidaware/rmmagent/shared" @@ -76,4 +78,15 @@ func (a *Agent) KillHungUpdates() { KillProc(int32(p.PID)) } } + + err = os.Chdir(a.ProgramDir) + if err == nil { + files, err := filepath.Glob("is-*.tmp") + if err == nil { + for _, f := range files { + a.Logger.Debugln("KillHungUpdates() Removing file:", f) + os.Remove(f) + } + } + } } From e11c38dd49256584900be3ebaacdcb228a14f87b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 6 Nov 2022 21:49:26 -0800 Subject: [PATCH 02/14] fix race condition in windows agent update amidaware/tacticalrmm#1250 --- agent/agent.go | 2 +- agent/rpc.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/agent.go b/agent/agent.go index d6d7a91..16d1c1c 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -154,7 +154,7 @@ func New(logger *logrus.Logger, version string) *Agent { Option: service.KeyValue{ "StartType": "automatic", "OnFailure": "restart", - "OnFailureDelayDuration": "5s", + "OnFailureDelayDuration": "12s", "OnFailureResetPeriod": 10, }, } diff --git a/agent/rpc.go b/agent/rpc.go index ce2a89c..b141be0 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -479,6 +479,7 @@ func (a *Agent) RunRPC() { atomic.StoreUint32(&agentUpdateLocker, 0) nc.Flush() nc.Close() + a.ControlService(winSvcName, "stop") os.Exit(0) } }(payload) From a057c65a02c96b6f36b756359be02d6e9059263d Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 6 Nov 2022 22:18:56 -0800 Subject: [PATCH 03/14] moving this somewhere else --- agent/process.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/agent/process.go b/agent/process.go index 6409bc3..ae7c392 100644 --- a/agent/process.go +++ b/agent/process.go @@ -13,8 +13,6 @@ package agent import ( "fmt" - "os" - "path/filepath" "strings" rmm "github.com/amidaware/rmmagent/shared" @@ -78,15 +76,4 @@ func (a *Agent) KillHungUpdates() { KillProc(int32(p.PID)) } } - - err = os.Chdir(a.ProgramDir) - if err == nil { - files, err := filepath.Glob("is-*.tmp") - if err == nil { - for _, f := range files { - a.Logger.Debugln("KillHungUpdates() Removing file:", f) - os.Remove(f) - } - } - } } From 473cfd3ced4c6a1d03a41fc33974dc46ccb7b827 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 6 Nov 2022 22:20:49 -0800 Subject: [PATCH 04/14] add more cleanup #25 --- agent/agent.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 16d1c1c..c9b9b04 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -426,7 +426,7 @@ func (a *Agent) GetUninstallExe() string { func (a *Agent) CleanupAgentUpdates() { // TODO remove a.ProgramDir, updates are now in winTempDir - dirs := [2]string{winTempDir, a.ProgramDir} + dirs := [3]string{winTempDir, os.Getenv("TMP"), a.ProgramDir} for _, dir := range dirs { err := os.Chdir(dir) if err != nil { @@ -435,7 +435,7 @@ func (a *Agent) CleanupAgentUpdates() { } // TODO winagent-v* is deprecated - globs := [2]string{"tacticalagent-v*", "winagent-v*"} + globs := [3]string{"tacticalagent-v*", "is-*.tmp", "winagent-v*"} for _, glob := range globs { files, err := filepath.Glob(glob) if err == nil { From 337c519b99fd4b3e294cf84b56f76de0fc48b93b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 7 Nov 2022 10:18:12 -0800 Subject: [PATCH 05/14] update deps --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index cf912c8..0d2d785 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/amidaware/rmmagent -go 1.18 +go 1.19 require ( github.com/StackExchange/wmi v1.2.1 @@ -10,8 +10,8 @@ require ( github.com/go-resty/resty/v2 v2.7.0 github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d - github.com/nats-io/nats-server/v2 v2.9.3 // indirect - github.com/nats-io/nats.go v1.18.0 + github.com/nats-io/nats-server/v2 v2.9.6 // indirect + github.com/nats-io/nats.go v1.19.1 github.com/rickb777/date v1.19.1 github.com/shirou/gopsutil/v3 v3.22.9 github.com/sirupsen/logrus v1.9.0 diff --git a/go.sum b/go.sum index 6723895..b66a4de 100644 --- a/go.sum +++ b/go.sum @@ -212,10 +212,10 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/nats-server/v2 v2.9.3 h1:HrfzA7G9LNetKkm1z+jU/e9kuAe+E6uaBuuq9EB5sQQ= -github.com/nats-io/nats-server/v2 v2.9.3/go.mod h1:4sq8wvrpbvSzL1n3ZfEYnH4qeUuIl5W990j3kw13rRk= -github.com/nats-io/nats.go v1.18.0 h1:o480Ao6kuSSFyJO75rGTXCEPj7LGkY84C1Ye+Uhm4c0= -github.com/nats-io/nats.go v1.18.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats-server/v2 v2.9.6 h1:RTtK+rv/4CcliOuqGsy58g7MuWkBaWmF5TUNwuUo9Uw= +github.com/nats-io/nats-server/v2 v2.9.6/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats.go v1.19.1 h1:pDQZthDfxRMSJ0ereExAM9ODf3JyS42Exk7iCMdbpec= +github.com/nats-io/nats.go v1.19.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From 93f4de35fe23700279eae7573e4d5613d7e693c0 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 8 Nov 2022 21:37:54 -0800 Subject: [PATCH 06/14] update psutil --- go.mod | 2 +- go.sum | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 0d2d785..cf40ceb 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/nats-io/nats-server/v2 v2.9.6 // indirect github.com/nats-io/nats.go v1.19.1 github.com/rickb777/date v1.19.1 - github.com/shirou/gopsutil/v3 v3.22.9 + github.com/shirou/gopsutil/v3 v3.22.10 github.com/sirupsen/logrus v1.9.0 github.com/ugorji/go/codec v1.2.7 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 diff --git a/go.sum b/go.sum index b66a4de..35ebe70 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,8 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e h1:+/AzLkOdIXEPrAQtwAeWOBnPQ0BnYlBW0aCZmSb47u4= github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e/go.mod h1:9Tc1SKnfACJb9N7cw2eyuI6xzy845G7uZONBsi5uPEA= -github.com/shirou/gopsutil/v3 v3.22.9 h1:yibtJhIVEMcdw+tCTbOPiF1VcsuDeTE4utJ8Dm4c5eA= -github.com/shirou/gopsutil/v3 v3.22.9/go.mod h1:bBYl1kjgEJpWpxeHmLI+dVHWtyAwfcmSBLDsp2TNT8A= +github.com/shirou/gopsutil/v3 v3.22.10 h1:4KMHdfBRYXGF9skjDWiL4RA2N+E8dRdodU/bOZpPoVg= +github.com/shirou/gopsutil/v3 v3.22.10/go.mod h1:QNza6r4YQoydyCfo6rH0blGfKahgibh4dQmV5xdFkQk= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= @@ -275,14 +275,16 @@ github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= From bf5258eb78c1f209b70c6bf1547b2f1233c00294 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 8 Nov 2022 23:02:17 -0800 Subject: [PATCH 07/14] bump version --- build/rmm.exe.manifest | 2 +- build/setup.iss | 2 +- main.go | 2 +- versioninfo.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/rmm.exe.manifest b/build/rmm.exe.manifest index 7b92d4e..c18eeec 100644 --- a/build/rmm.exe.manifest +++ b/build/rmm.exe.manifest @@ -3,7 +3,7 @@ diff --git a/build/setup.iss b/build/setup.iss index d8e8b58..9f61bec 100644 --- a/build/setup.iss +++ b/build/setup.iss @@ -1,5 +1,5 @@ #define MyAppName "Tactical RMM Agent" -#define MyAppVersion "2.4.1" +#define MyAppVersion "2.4.2" #define MyAppPublisher "AmidaWare LLC" #define MyAppURL "https://github.com/amidaware" #define MyAppExeName "tacticalrmm.exe" diff --git a/main.go b/main.go index 766fe2b..549be41 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.1" + version = "2.4.2" log = logrus.New() logFile *os.File ) diff --git a/versioninfo.json b/versioninfo.json index b85f0d2..6cb8e61 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 2, "Minor": 4, - "Patch": 1, + "Patch": 2, "Build": 0 }, "ProductVersion": { "Major": 2, "Minor": 4, - "Patch": 1, + "Patch": 2, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "AmidaWare LLC", "FileDescription": "Tactical RMM Agent", - "FileVersion": "v2.4.1.0", + "FileVersion": "v2.4.2.0", "InternalName": "tacticalrmm.exe", "LegalCopyright": "Copyright (c) 2022 AmidaWare LLC", "LegalTrademarks": "", "OriginalFilename": "tacticalrmm.exe", "PrivateBuild": "", "ProductName": "Tactical RMM Agent", - "ProductVersion": "v2.4.1.0", + "ProductVersion": "v2.4.2.0", "SpecialBuild": "" }, "VarFileInfo": { From 44c63d00b65ad1605e3f832637a37add22588b67 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 9 Nov 2022 23:47:00 -0800 Subject: [PATCH 08/14] update ci --- .github/workflows/ci.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c4f05a..477fa07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: '1.18.3' + go-version: '1.19.3' - name: Ensure linux agent compiles run: | @@ -40,10 +40,3 @@ jobs: for i in ${ARCHS}; do env CGO_ENABLED=0 GOOS=darwin GOARCH=${i} go build -ldflags "-s -w" done - - - name: Ensure freebsd agent compiles - run: | - ARCHS='amd64 386 arm64 arm' - for i in ${ARCHS}; do - env CGO_ENABLED=0 GOOS=freebsd GOARCH=${i} go build -ldflags "-s -w" - done From db5cd5b0e04570c38efcadee02d30ca00b1fc139 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 11 Nov 2022 17:46:10 -0800 Subject: [PATCH 09/14] dev --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 549be41..c6dd5c2 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.2" + version = "2.4.2-dev" log = logrus.New() logFile *os.File ) From 7a75d4d5a3a6d22b1c1f4c5480870f6180d3ee80 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 11 Nov 2022 17:46:28 -0800 Subject: [PATCH 10/14] update viper --- go.mod | 12 ++++++------ go.sum | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index cf40ceb..bdc1a3c 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/ugorji/go/codec v1.2.7 github.com/wh1te909/go-win64api v0.0.0-20210906074314-ab23795a6ae5 github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139 - golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect + golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec ) @@ -31,12 +31,12 @@ require ( github.com/fourcorelabs/wintoken v1.0.0 github.com/jaypipes/ghw v0.9.0 github.com/kardianos/service v1.2.2 - github.com/spf13/viper v1.13.0 + github.com/spf13/viper v1.14.0 ) require ( github.com/elastic/go-windows v1.0.1 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/google/cabbie v1.0.3 // indirect github.com/google/glazier v0.0.0-20220520121753-83447cca4ea7 // indirect @@ -59,7 +59,7 @@ require ( github.com/rickb777/plural v1.4.1 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e // indirect - github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/afero v1.9.2 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -68,8 +68,8 @@ require ( github.com/tklauser/numcpus v0.5.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/sync v0.1.0 // indirect + golang.org/x/text v0.4.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 // indirect diff --git a/go.sum b/go.sum index 35ebe70..a16feb1 100644 --- a/go.sum +++ b/go.sum @@ -72,8 +72,8 @@ github.com/fourcorelabs/wintoken v1.0.0/go.mod h1:jKyXHt079W09KwEMbUC9g+R2KDs5kV github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-cmd/cmd v1.4.1 h1:JUcEIE84v8DSy02XTZpUDeGKExk2oW3DA10hTjbQwmc= @@ -261,8 +261,8 @@ github.com/shirou/gopsutil/v3 v3.22.10 h1:4KMHdfBRYXGF9skjDWiL4RA2N+E8dRdodU/bOZ github.com/shirou/gopsutil/v3 v3.22.10/go.mod h1:QNza6r4YQoydyCfo6rH0blGfKahgibh4dQmV5xdFkQk= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= @@ -271,8 +271,8 @@ github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0 github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= -github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= +github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= +github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -391,8 +391,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 h1:8NSylCMxLW4JvserAndSgFL7aPli6A68yf0bYFTcWCM= -golang.org/x/net v0.0.0-20220706163947-c90051bbdb60/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -413,8 +413,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -467,10 +467,10 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -481,8 +481,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -626,7 +626,7 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From f200862b1a0e3c42933f27dc72cd72d127a0cd5f Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 12 Nov 2022 15:28:19 -0800 Subject: [PATCH 11/14] remove unused funcs --- main.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/main.go b/main.go index c6dd5c2..09d22f1 100644 --- a/main.go +++ b/main.go @@ -51,9 +51,6 @@ func main() { meshDir := flag.String("meshdir", "", "Path to custom meshcentral dir") meshNodeID := flag.String("meshnodeid", "", "Mesh Node ID") cert := flag.String("cert", "", "Path to domain CA .pem") - updateurl := flag.String("updateurl", "", "Download link to updater") - inno := flag.String("inno", "", "Inno setup file") - updatever := flag.String("updatever", "", "Update version") silent := flag.Bool("silent", false, "Do not popup any message boxes during installation") proxy := flag.String("proxy", "", "Use a http proxy") flag.Parse() @@ -127,12 +124,6 @@ func main() { return } a.RunTask(*taskPK) - case "update": - if *updateurl == "" || *inno == "" || *updatever == "" { - updateUsage() - return - } - a.AgentUpdate(*updateurl, *inno, *updatever) case "install": if runtime.GOOS != "windows" { u, err := user.Current() @@ -145,7 +136,6 @@ func main() { } if *api == "" || *clientID == 0 || *siteID == 0 || *token == "" { - installUsage() return } a.Install(&agent.Installer{ @@ -191,14 +181,3 @@ func setupLogging(level, to *string) { log.SetOutput(logFile) } } - -func installUsage() { - exe, _ := os.Executable() - u := fmt.Sprintf(`Usage: %s -m install -api -client-id X -site-id X -auth `, exe) - fmt.Println(u) -} - -func updateUsage() { - u := `Usage: tacticalrmm.exe -m update -updateurl https://example.com/tacticalagent-vX.X.X.exe -inno tacticalagent-vX.X.X.exe -updatever 1.1.1` - fmt.Println(u) -} From bcfae9dc66580da47ae51cdf16252eb5fefced44 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 12 Nov 2022 15:30:39 -0800 Subject: [PATCH 12/14] update nats --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index bdc1a3c..9127efc 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/gonutz/w32/v2 v2.4.0 github.com/iamacarpet/go-win64api v0.0.0-20220531131246-e84054eb584d github.com/nats-io/nats-server/v2 v2.9.6 // indirect - github.com/nats-io/nats.go v1.19.1 + github.com/nats-io/nats.go v1.20.0 github.com/rickb777/date v1.19.1 github.com/shirou/gopsutil/v3 v3.22.10 github.com/sirupsen/logrus v1.9.0 diff --git a/go.sum b/go.sum index a16feb1..ba4125a 100644 --- a/go.sum +++ b/go.sum @@ -216,6 +216,8 @@ github.com/nats-io/nats-server/v2 v2.9.6 h1:RTtK+rv/4CcliOuqGsy58g7MuWkBaWmF5TUN github.com/nats-io/nats-server/v2 v2.9.6/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= github.com/nats-io/nats.go v1.19.1 h1:pDQZthDfxRMSJ0ereExAM9ODf3JyS42Exk7iCMdbpec= github.com/nats-io/nats.go v1.19.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= +github.com/nats-io/nats.go v1.20.0 h1:T8JJnQfVSdh1CzGiwAOv5hEobYCBho/0EupGznYw0oM= +github.com/nats-io/nats.go v1.20.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From d3bcb10f93fa992aa0e5042465993a86c4d02ef8 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 12 Nov 2022 16:17:18 -0800 Subject: [PATCH 13/14] tidy --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index ba4125a..ce32c18 100644 --- a/go.sum +++ b/go.sum @@ -214,8 +214,6 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/nats-server/v2 v2.9.6 h1:RTtK+rv/4CcliOuqGsy58g7MuWkBaWmF5TUNwuUo9Uw= github.com/nats-io/nats-server/v2 v2.9.6/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= -github.com/nats-io/nats.go v1.19.1 h1:pDQZthDfxRMSJ0ereExAM9ODf3JyS42Exk7iCMdbpec= -github.com/nats-io/nats.go v1.19.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nats.go v1.20.0 h1:T8JJnQfVSdh1CzGiwAOv5hEobYCBho/0EupGznYw0oM= github.com/nats-io/nats.go v1.20.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= From 9ccb95449edbf20e98727d5b33705013f48c7b9d Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 12 Nov 2022 16:49:47 -0800 Subject: [PATCH 14/14] bump version --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 09d22f1..36cc94a 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ import ( ) var ( - version = "2.4.2-dev" + version = "2.4.2" log = logrus.New() logFile *os.File )