From 52132ce39812e3abbd576763b6d9e3f2bbaeb448 Mon Sep 17 00:00:00 2001 From: "Thibault \"bui\" Koechlin" Date: Thu, 10 Mar 2022 13:23:21 +0100 Subject: [PATCH] fix #1157 (#1327) --- cmd/crowdsec-cli/dashboard.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmd/crowdsec-cli/dashboard.go b/cmd/crowdsec-cli/dashboard.go index ee53d2b33..c0ccf9a86 100644 --- a/cmd/crowdsec-cli/dashboard.go +++ b/cmd/crowdsec-cli/dashboard.go @@ -209,6 +209,20 @@ cscli dashboard setup -l 0.0.0.0 -p 443 --password } cmdDashboard.AddCommand(cmdDashStop) + var cmdDashShowPassword = &cobra.Command{Use: "show-password", + Short: "displays password of metabase.", + Args: cobra.ExactArgs(0), + DisableAutoGenTag: true, + Run: func(cmd *cobra.Command, args []string) { + m := metabase.Metabase{} + if err := m.LoadConfig(metabaseConfigPath); err != nil { + log.Fatal(err) + } + log.Printf("%s", m.Config.Password) + }, + } + cmdDashboard.AddCommand(cmdDashShowPassword) + var cmdDashRemove = &cobra.Command{ Use: "remove", Short: "removes the metabase container.",