diff --git a/cmd/crowdsec-cli/config.go b/cmd/crowdsec-cli/config.go index 51bc65d96..7e7c95fe5 100644 --- a/cmd/crowdsec-cli/config.go +++ b/cmd/crowdsec-cli/config.go @@ -417,6 +417,9 @@ func NewConfigCmd() *cobra.Command { Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { var err error + if err := csConfig.LoadHub(); err != nil { + log.Fatalf(err.Error()) + } if err = cwhub.GetHubIdx(csConfig.Hub); err != nil { log.Fatalf("Failed to get Hub index : %v", err) log.Infoln("Run 'sudo cscli hub update' to get the hub index") diff --git a/pkg/apiserver/middlewares/v1/api_key.go b/pkg/apiserver/middlewares/v1/api_key.go index 9cb975017..36392275e 100644 --- a/pkg/apiserver/middlewares/v1/api_key.go +++ b/pkg/apiserver/middlewares/v1/api_key.go @@ -9,7 +9,6 @@ import ( "strings" "github.com/crowdsecurity/crowdsec/pkg/database" - "github.com/crowdsecurity/crowdsec/pkg/types" "github.com/gin-gonic/gin" log "github.com/sirupsen/logrus" ) @@ -49,7 +48,6 @@ func HashSHA512(str string) string { func (a *APIKey) MiddlewareFunc() gin.HandlerFunc { return func(c *gin.Context) { - defer types.CatchPanic("crowdsec/middlewaresV1/api_key/MiddlewareFunc") val, ok := c.Request.Header[APIKeyHeader] if !ok { c.JSON(http.StatusForbidden, gin.H{"message": "access forbidden"}) diff --git a/pkg/apiserver/middlewares/v1/jwt.go b/pkg/apiserver/middlewares/v1/jwt.go index 3cd9d73b9..c531ad6dc 100644 --- a/pkg/apiserver/middlewares/v1/jwt.go +++ b/pkg/apiserver/middlewares/v1/jwt.go @@ -13,7 +13,6 @@ import ( "github.com/crowdsecurity/crowdsec/pkg/database" "github.com/crowdsecurity/crowdsec/pkg/database/ent/machine" "github.com/crowdsecurity/crowdsec/pkg/models" - "github.com/crowdsecurity/crowdsec/pkg/types" "github.com/gin-gonic/gin" "github.com/go-openapi/strfmt" log "github.com/sirupsen/logrus" @@ -45,7 +44,6 @@ func IdentityHandler(c *gin.Context) interface{} { } func (j *JWT) Authenticator(c *gin.Context) (interface{}, error) { - defer types.CatchPanic("crowdsec/middlewaresV1/jwt/Authenticator") var loginInput models.WatcherAuthRequest var scenarios string var err error