瀏覽代碼

refuse to run the dashboard if not on amd64 (#843)

blotus 4 年之前
父節點
當前提交
556f93827a
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      cmd/crowdsec-cli/dashboard.go

+ 6 - 0
cmd/crowdsec-cli/dashboard.go

@@ -6,6 +6,7 @@ import (
 	"os/exec"
 	"os/exec"
 	"os/user"
 	"os/user"
 	"path/filepath"
 	"path/filepath"
+	"runtime"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
 	"unicode"
 	"unicode"
@@ -53,6 +54,11 @@ cscli dashboard stop
 cscli dashboard remove
 cscli dashboard remove
 `,
 `,
 		PersistentPreRun: func(cmd *cobra.Command, args []string) {
 		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 {
 			if err := csConfig.LoadAPIServer(); err != nil || csConfig.DisableAPI {
 				log.Fatal("Local API is disabled, please run this command on the local API machine")
 				log.Fatal("Local API is disabled, please run this command on the local API machine")
 			}
 			}