Skip to content

Commit

Permalink
enhance: return an error if cscli dashboard is run within a container
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceJJones committed Sep 2, 2024
1 parent 0fb6468 commit 37cada9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/crowdsec-cli/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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")

Check warning on line 108 in cmd/crowdsec-cli/dashboard.go

View check run for this annotation

Codecov / codecov/patch

cmd/crowdsec-cli/dashboard.go#L107-L108

Added lines #L107 - L108 were not covered by tests
}

return nil
},
}
Expand Down

0 comments on commit 37cada9

Please sign in to comment.