Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide -TAGS= support for windows silent installer #464

Merged
merged 2 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/pr-464.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type = "added"
message = "Provide -TAGS= support for windows silent installer"

issues = ["460"]
pulls = ["464"]

5 changes: 5 additions & 0 deletions dist/chocolatey/graylog-sidecar.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
To properly configure the sidecar, you'll need to pass in your **server url** and your **api token**.

choco install graylog-sidecar --install-arguments="'-SERVERURL=http://10.0.2.2:9000/api -APITOKEN=yourapitoken'"

Other optional example parameters are:

-TAGS=["example","foo"] -NODENAME=mynodename -NODEID=1234 -SENDSTATUS=false -TLSSKIPVERIFY=true -UPDATEINTERVAL=10s

</description>
<releaseNotes></releaseNotes>
</metadata>
Expand Down
10 changes: 10 additions & 0 deletions dist/recipe.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
Var ParamSendStatus
Var ParamApiToken
Var ParamNodeId
Var ParamTags
Var Tags
Var NodeId
Var SendStatus
Var Dialog
Expand Down Expand Up @@ -227,6 +229,7 @@ Section "Post"
${GetOptions} $Params " -SEND_STATUS=" $ParamSendStatus
${GetOptions} $Params " -APITOKEN=" $ParamApiToken
${GetOptions} $Params " -NODEID=" $ParamNodeId
${GetOptions} $Params " -TAGS=" $ParamTags

${If} $ParamServerUrl != ""
StrCpy $ServerUrl $ParamServerUrl
Expand All @@ -249,6 +252,9 @@ Section "Post"
${If} $ParamNodeId != ""
StrCpy $NodeId $ParamNodeId
${EndIf}
${If} $ParamTags != ""
StrCpy $Tags $ParamTags
${EndIf}

; set defaults
${If} $ServerUrl == ""
Expand All @@ -267,6 +273,9 @@ Section "Post"
;sidecar.yml needs double escapes
${WordReplace} "file:$INSTDIR\node-id" "\" "\\" "+" $NodeId
${EndIf}
${If} $Tags == ""
StrCpy $Tags "[]"
${EndIf}

!insertmacro _ReplaceInFile "$INSTDIR\sidecar.yml" "<SERVERURL>" $ServerUrl
!insertmacro _ReplaceInFile "$INSTDIR\sidecar.yml" "<NODENAME>" $NodeName
Expand All @@ -275,6 +284,7 @@ Section "Post"
!insertmacro _ReplaceInFile "$INSTDIR\sidecar.yml" "<SENDSTATUS>" $SendStatus
!insertmacro _ReplaceInFile "$INSTDIR\sidecar.yml" "<APITOKEN>" $ApiToken
!insertmacro _ReplaceInFile "$INSTDIR\sidecar.yml" "<NODEID>" $NodeId
!insertmacro _ReplaceInFile "$INSTDIR\sidecar.yml" "<TAGS>" $Tags

;Install sidecar service
${If} $IsUpgrade == 'false'
Expand Down
9 changes: 9 additions & 0 deletions sidecar-windows-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ send_status: <SENDSTATUS>
# Default:
# windows_drive_range: "CDEFGHIJKLMNOPQRSTUVWXYZ"

# A list of tags to assign to this sidecar. Collector configuration matching any of these tags will automatically be
# applied to the sidecar.
# Default: []
tags: <TAGS>
# Example:
# tags:
# - apache-logs
# - dns-logs

# A list of binaries which are allowed to be executed by the Sidecar. An empty list disables the access list feature.
# Wildcards can be used, for a full pattern description see https://golang.org/pkg/path/filepath/#Match
# Example:
Expand Down