From 37cada9e4f8235cec4d12fdb43dad265b7233170 Mon Sep 17 00:00:00 2001 From: Laurence Date: Mon, 2 Sep 2024 08:45:45 +0100 Subject: [PATCH] enhance: return an error if cscli dashboard is run within a container --- cmd/crowdsec-cli/dashboard.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/crowdsec-cli/dashboard.go b/cmd/crowdsec-cli/dashboard.go index eb4a2a5956a..31efd074bf9 100644 --- a/cmd/crowdsec-cli/dashboard.go +++ b/cmd/crowdsec-cli/dashboard.go @@ -23,6 +23,7 @@ import ( "github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/idgen" "github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/require" "github.com/crowdsecurity/crowdsec/pkg/metabase" + "github.com/crowdsecurity/go-cs-lib/version" ) var ( @@ -103,6 +104,10 @@ cscli dashboard remove log.Warn("cscli dashboard will be deprecated in version 1.7.0, read more at https://docs.crowdsec.net/blog/cscli_dashboard_deprecation/") + if version.System == "docker" { + return errors.New("cscli dashboard is not supported whilst running CrowdSec within a container please see: https://github.com/crowdsecurity/example-docker-compose/tree/main/basic") + } + return nil }, }