-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cscli): add env variable flag for dashboard setup (#3110)
Signed-off-by: Nathanael DEMACON <[email protected]> Co-authored-by: Nathanael DEMACON <[email protected]> Co-authored-by: Laurence Jones <[email protected]>
- Loading branch information
1 parent
303ce8e
commit e9c1ed0
Showing
3 changed files
with
52 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,10 +36,11 @@ var ( | |
metabaseConfigFile = "metabase.yaml" | ||
metabaseImage = "metabase/metabase:v0.46.6.1" | ||
/**/ | ||
metabaseListenAddress = "127.0.0.1" | ||
metabaseListenPort = "3000" | ||
metabaseContainerID = "crowdsec-metabase" | ||
crowdsecGroup = "crowdsec" | ||
metabaseListenAddress = "127.0.0.1" | ||
metabaseListenPort = "3000" | ||
metabaseContainerID = "crowdsec-metabase" | ||
metabaseContainerEnvironmentVariables []string | ||
crowdsecGroup = "crowdsec" | ||
|
||
forceYes bool | ||
|
||
|
@@ -166,7 +167,7 @@ cscli dashboard setup -l 0.0.0.0 -p 443 --password <password> | |
if err = cli.chownDatabase(dockerGroup.Gid); err != nil { | ||
return err | ||
} | ||
mb, err := metabase.SetupMetabase(cli.cfg().API.Server.DbConfig, metabaseListenAddress, metabaseListenPort, metabaseUser, metabasePassword, metabaseDBPath, dockerGroup.Gid, metabaseContainerID, metabaseImage) | ||
mb, err := metabase.SetupMetabase(cli.cfg().API.Server.DbConfig, metabaseListenAddress, metabaseListenPort, metabaseUser, metabasePassword, metabaseDBPath, dockerGroup.Gid, metabaseContainerID, metabaseImage, metabaseContainerEnvironmentVariables) | ||
if err != nil { | ||
return err | ||
} | ||
|
@@ -193,6 +194,7 @@ cscli dashboard setup -l 0.0.0.0 -p 443 --password <password> | |
flags.BoolVarP(&forceYes, "yes", "y", false, "force yes") | ||
// flags.StringVarP(&metabaseUser, "user", "u", "[email protected]", "metabase user") | ||
flags.StringVar(&metabasePassword, "password", "", "metabase password") | ||
flags.StringSliceVarP(&metabaseContainerEnvironmentVariables, "env", "e", nil, "Additional environment variables to pass to the metabase container") | ||
|
||
return cmd | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters