فهرست منبع

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

mmetc 2 سال پیش
والد
کامیت
b6b6fd026b

+ 1 - 1
cmd/crowdsec-cli/bouncers.go

@@ -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" {

+ 2 - 2
cmd/crowdsec-cli/dashboard.go

@@ -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")

+ 1 - 1
cmd/crowdsec-cli/lapi.go

@@ -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,

+ 7 - 7
cmd/crowdsec-cli/main.go

@@ -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 {

+ 6 - 6
cmd/crowdsec-cli/metrics_table.go

@@ -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()
 	}
 }

+ 1 - 1
pkg/csprofiles/csprofiles.go

@@ -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

+ 1 - 1
pkg/leakybucket/manager_load.go

@@ -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
 }
 

+ 1 - 1
test/bats/01_cscli.bats

@@ -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" {

+ 1 - 1
test/bats/04_nocapi.bats

@@ -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:"
 }

+ 1 - 1
test/bats/10_bouncers.bats

@@ -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 '[]'