From 281fbd739fde2bdb3bb0b0c349bc871d36a13e9f Mon Sep 17 00:00:00 2001 From: alteredCoder Date: Fri, 29 Sep 2023 15:44:30 +0200 Subject: [PATCH] remove debug and allow helper in context --- cmd/crowdsec-cli/lapi.go | 4 ++++ cmd/crowdsec-cli/utils.go | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/crowdsec-cli/lapi.go b/cmd/crowdsec-cli/lapi.go index b0a2fd78a..f1b2423ff 100644 --- a/cmd/crowdsec-cli/lapi.go +++ b/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) } diff --git a/cmd/crowdsec-cli/utils.go b/cmd/crowdsec-cli/utils.go index 51344b69e..d6ea07548 100644 --- a/cmd/crowdsec-cli/utils.go +++ b/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 }