typo fix, uppercase 'API', adjusted log level (#2361)

This commit is contained in:
mmetc 2023-07-21 23:23:24 +02:00 committed by GitHub
parent 9ac5aeda79
commit b6b6fd026b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 22 additions and 22 deletions

View file

@ -107,7 +107,7 @@ func runBouncersAdd(cmd *cobra.Command, args []string) error {
}
if csConfig.Cscli.Output == "human" {
fmt.Printf("Api key for '%s':\n\n", keyName)
fmt.Printf("API key for '%s':\n\n", keyName)
fmt.Printf(" %s\n\n", apiKey)
fmt.Print("Please keep this key since you will not be able to retrieve it!\n")
} else if csConfig.Cscli.Output == "raw" {

View file

@ -196,8 +196,8 @@ cscli dashboard setup -l 0.0.0.0 -p 443 --password <password>
fmt.Printf("\tpassword : '%s'\n", mb.Config.Password)
},
}
cmdDashSetup.Flags().BoolVarP(&force, "force", "f", false, "Force setup : override existing files.")
cmdDashSetup.Flags().StringVarP(&metabaseDbPath, "dir", "d", "", "Shared directory with metabase container.")
cmdDashSetup.Flags().BoolVarP(&force, "force", "f", false, "Force setup : override existing files")
cmdDashSetup.Flags().StringVarP(&metabaseDbPath, "dir", "d", "", "Shared directory with metabase container")
cmdDashSetup.Flags().StringVarP(&metabaseListenAddress, "listen", "l", metabaseListenAddress, "Listen address of container")
cmdDashSetup.Flags().StringVarP(&metabaseListenPort, "port", "p", metabaseListenPort, "Listen port of container")
cmdDashSetup.Flags().BoolVarP(&forceYes, "yes", "y", false, "force yes")

View file

@ -180,7 +180,7 @@ func NewLapiRegisterCmd() *cobra.Command {
cmdLapiRegister := &cobra.Command{
Use: "register",
Short: "Register a machine to Local API (LAPI)",
Long: `Register you machine to the Local API (LAPI).
Long: `Register your machine to the Local API (LAPI).
Keep in mind the machine needs to be validated by an administrator on LAPI side to be effective.`,
Args: cobra.MinimumNArgs(0),
DisableAutoGenTag: true,

View file

@ -199,13 +199,13 @@ It is meant to allow you to manage bans, parsers/scenarios/etc, api and generall
rootCmd.AddCommand(cmdVersion)
rootCmd.PersistentFlags().StringVarP(&ConfigFilePath, "config", "c", csconfig.DefaultConfigPath("config.yaml"), "path to crowdsec config file")
rootCmd.PersistentFlags().StringVarP(&OutputFormat, "output", "o", "", "Output format: human, json, raw.")
rootCmd.PersistentFlags().StringVarP(&OutputColor, "color", "", "auto", "Output color: yes, no, auto.")
rootCmd.PersistentFlags().BoolVar(&dbg_lvl, "debug", false, "Set logging to debug.")
rootCmd.PersistentFlags().BoolVar(&nfo_lvl, "info", false, "Set logging to info.")
rootCmd.PersistentFlags().BoolVar(&wrn_lvl, "warning", false, "Set logging to warning.")
rootCmd.PersistentFlags().BoolVar(&err_lvl, "error", false, "Set logging to error.")
rootCmd.PersistentFlags().BoolVar(&trace_lvl, "trace", false, "Set logging to trace.")
rootCmd.PersistentFlags().StringVarP(&OutputFormat, "output", "o", "", "Output format: human, json, raw")
rootCmd.PersistentFlags().StringVarP(&OutputColor, "color", "", "auto", "Output color: yes, no, auto")
rootCmd.PersistentFlags().BoolVar(&dbg_lvl, "debug", false, "Set logging to debug")
rootCmd.PersistentFlags().BoolVar(&nfo_lvl, "info", false, "Set logging to info")
rootCmd.PersistentFlags().BoolVar(&wrn_lvl, "warning", false, "Set logging to warning")
rootCmd.PersistentFlags().BoolVar(&err_lvl, "error", false, "Set logging to error")
rootCmd.PersistentFlags().BoolVar(&trace_lvl, "trace", false, "Set logging to trace")
rootCmd.PersistentFlags().StringVar(&cwhub.HubBranch, "branch", "", "Override hub branch on github")
if err := rootCmd.PersistentFlags().MarkHidden("branch"); err != nil {

View file

@ -199,7 +199,7 @@ func lapiStatsTable(out io.Writer, stats map[string]map[string]int) {
}
if numRows > 0 {
renderTableTitle(out, "\nLocal Api Metrics:")
renderTableTitle(out, "\nLocal API Metrics:")
t.Render()
}
}
@ -213,7 +213,7 @@ func lapiMachineStatsTable(out io.Writer, stats map[string]map[string]map[string
numRows := lapiMetricsToTable(t, stats)
if numRows > 0 {
renderTableTitle(out, "\nLocal Api Machines Metrics:")
renderTableTitle(out, "\nLocal API Machines Metrics:")
t.Render()
}
}
@ -227,7 +227,7 @@ func lapiBouncerStatsTable(out io.Writer, stats map[string]map[string]map[string
numRows := lapiMetricsToTable(t, stats)
if numRows > 0 {
renderTableTitle(out, "\nLocal Api Bouncers Metrics:")
renderTableTitle(out, "\nLocal API Bouncers Metrics:")
t.Render()
}
}
@ -253,7 +253,7 @@ func lapiDecisionStatsTable(out io.Writer, stats map[string]struct {
}
if numRows > 0 {
renderTableTitle(out, "\nLocal Api Bouncers Decisions:")
renderTableTitle(out, "\nLocal API Bouncers Decisions:")
t.Render()
}
}
@ -280,7 +280,7 @@ func decisionStatsTable(out io.Writer, stats map[string]map[string]map[string]in
}
if numRows > 0 {
renderTableTitle(out, "\nLocal Api Decisions:")
renderTableTitle(out, "\nLocal API Decisions:")
t.Render()
}
}
@ -301,7 +301,7 @@ func alertStatsTable(out io.Writer, stats map[string]int) {
}
if numRows > 0 {
renderTableTitle(out, "\nLocal Api Alerts:")
renderTableTitle(out, "\nLocal API Alerts:")
t.Render()
}
}

View file

@ -102,7 +102,7 @@ func (Profile *Runtime) GenerateDecisionFromProfile(Alert *models.Alert) ([]*mod
for _, refDecision := range Profile.Cfg.Decisions {
decision := models.Decision{}
/*the reference decision from profile is in sumulated mode */
/*the reference decision from profile is in simulated mode */
if refDecision.Simulated != nil && *refDecision.Simulated {
decision.Simulated = new(bool)
*decision.Simulated = true

View file

@ -268,7 +268,7 @@ func LoadBuckets(cscfg *csconfig.CrowdsecServiceCfg, files []string, tomb *tomb.
return nil, nil, fmt.Errorf("unable to load alert context: %s", err)
}
log.Warningf("Loaded %d scenarios", len(ret))
log.Infof("Loaded %d scenarios", len(ret))
return ret, response, nil
}

View file

@ -227,7 +227,7 @@ teardown() {
rune -0 cscli metrics
assert_output --partial "Route"
assert_output --partial '/v1/watchers/login'
assert_output --partial "Local Api Metrics:"
assert_output --partial "Local API Metrics:"
}
@test "'cscli completion' with or without configuration file" {

View file

@ -78,5 +78,5 @@ teardown() {
rune -0 cscli metrics
assert_output --partial "Route"
assert_output --partial '/v1/watchers/login'
assert_output --partial "Local Api Metrics:"
assert_output --partial "Local API Metrics:"
}

View file

@ -30,7 +30,7 @@ teardown() {
@test "we can add one bouncer, and delete it" {
rune -0 cscli bouncers add ciTestBouncer
assert_output --partial "Api key for 'ciTestBouncer':"
assert_output --partial "API key for 'ciTestBouncer':"
rune -0 cscli bouncers delete ciTestBouncer
rune -0 cscli bouncers list -o json
assert_output '[]'