Kaynağa Gözat

remove debug and allow helper in context

alteredCoder 1 yıl önce
ebeveyn
işleme
281fbd739f
2 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 0
      cmd/crowdsec-cli/lapi.go
  2. 0 2
      cmd/crowdsec-cli/utils.go

+ 4 - 0
cmd/crowdsec-cli/lapi.go

@@ -218,6 +218,10 @@ func NewLapiCmd() *cobra.Command {
 }
 
 func AddContext(key string, values []string, targetFile string) error {
+	if err := exprhelpers.Init(nil); err != nil {
+		return fmt.Errorf(err.Error())
+	}
+
 	if err := alertcontext.ValidateContextExpr(key, values); err != nil {
 		return fmt.Errorf("invalid context configuration :%s", err)
 	}

+ 0 - 2
cmd/crowdsec-cli/utils.go

@@ -758,7 +758,5 @@ func isFilePathInFolder(folderpath string, targetFilepath string) (bool, error)
 	if err != nil {
 		return false, err
 	}
-	log.Infof("F: %+v | T: %+v", folderpath, targetFilepath)
-	log.Infof("REAL POATH: %+v", relPath)
 	return !strings.Contains(relPath, ".."), nil
 }