Skip to content

Commit

Permalink
Release 2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Mar 25, 2024
2 parents 8461698 + b09eaf8 commit 3e0366c
Show file tree
Hide file tree
Showing 21 changed files with 1,016 additions and 98 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"[go]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": false,
"source.organizeImports": "always"
},
"editor.snippetSuggestions": "none",
},
"[go.mod]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.organizeImports": "explicit"
},
},
"gopls": {
Expand Down
25 changes: 25 additions & 0 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ type Agent struct {
MeshSystemEXE string
MeshSVC string
PyBin string
NuBin string
DenoBin string
AgentHeader string
Headers map[string]string
Logger *logrus.Logger
Version string
Expand Down Expand Up @@ -86,6 +89,8 @@ const (
nixAgentDir = "/opt/tacticalagent"
nixMeshDir = "/opt/tacticalmesh"
nixAgentBin = nixAgentDir + "/tacticalagent"
nixAgentBinDir = nixAgentDir + "/bin"
nixAgentEtcDir = nixAgentDir + "/etc"
nixMeshAgentBin = nixMeshDir + "/meshagent"
macPlistPath = "/Library/LaunchDaemons/tacticalagent.plist"
macPlistName = "tacticalagent"
Expand Down Expand Up @@ -119,8 +124,25 @@ func New(logger *logrus.Logger, version string) *Agent {
pybin = filepath.Join(pd, "py38-x32", "python.exe")
}

var nuBin string
switch runtime.GOOS {
case "windows":
nuBin = filepath.Join(pd, "bin", "nu.exe")
default:
nuBin = filepath.Join(nixAgentBinDir, "nu")
}

var denoBin string
switch runtime.GOOS {
case "windows":
denoBin = filepath.Join(pd, "bin", "deno.exe")
default:
denoBin = filepath.Join(nixAgentBinDir, "deno")
}

ac := NewAgentConfig()

agentHeader := fmt.Sprintf("trmm/%s/%s/%s", version, runtime.GOOS, runtime.GOARCH)
headers := make(map[string]string)
if len(ac.Token) > 0 {
headers["Content-Type"] = "application/json"
Expand Down Expand Up @@ -232,7 +254,10 @@ func New(logger *logrus.Logger, version string) *Agent {
MeshSystemEXE: MeshSysExe,
MeshSVC: meshSvcName,
PyBin: pybin,
NuBin: nuBin,
DenoBin: denoBin,
Headers: headers,
AgentHeader: agentHeader,
Logger: logger,
Version: version,
Debug: logger.IsLevelEnabled(logrus.DebugLevel),
Expand Down
Loading

0 comments on commit 3e0366c

Please sign in to comment.