From 556f93827aca0cd911d8467a4d895e6a1c5030a6 Mon Sep 17 00:00:00 2001 From: blotus Date: Thu, 1 Jul 2021 13:41:16 +0200 Subject: [PATCH] refuse to run the dashboard if not on amd64 (#843) --- cmd/crowdsec-cli/dashboard.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/crowdsec-cli/dashboard.go b/cmd/crowdsec-cli/dashboard.go index b44cd4074..514cda95b 100644 --- a/cmd/crowdsec-cli/dashboard.go +++ b/cmd/crowdsec-cli/dashboard.go @@ -6,6 +6,7 @@ import ( "os/exec" "os/user" "path/filepath" + "runtime" "strconv" "strings" "unicode" @@ -53,6 +54,11 @@ cscli dashboard stop cscli dashboard remove `, PersistentPreRun: func(cmd *cobra.Command, args []string) { + + if runtime.GOARCH != "amd64" { + log.Fatalf("cscli dashboard is only available on amd64, but you are running %s", runtime.GOARCH) + } + if err := csConfig.LoadAPIServer(); err != nil || csConfig.DisableAPI { log.Fatal("Local API is disabled, please run this command on the local API machine") }