Archived
2
0

rename admin flag to password_admin

This commit is contained in:
Craig 2020-04-05 01:24:54 +00:00
parent 9c6fd9638e
commit 2bcd9e985b
2 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@
"envFile": "${workspaceFolder}/.env.development", "envFile": "${workspaceFolder}/.env.development",
"output": "${workspaceFolder}/bin/debug/neko", "output": "${workspaceFolder}/bin/debug/neko",
"cwd": "${workspaceFolder}/", "cwd": "${workspaceFolder}/",
"args": ["serve", "-d", "--bind", ":3000", "--static", "../client/dist", "--password", "neko", "--admin", "admin"] "args": ["serve", "-d", "--bind", ":3000", "--static", "../client/dist", "--password", "neko", "--password_admin", "admin"]
} }
] ]
} }

View File

@ -16,8 +16,8 @@ func (WebSocket) Init(cmd *cobra.Command) error {
return err return err
} }
cmd.PersistentFlags().String("admin", "admin", "admin password for connecting to stream") cmd.PersistentFlags().String("password_admin", "admin", "admin password for connecting to stream")
if err := viper.BindPFlag("admin", cmd.PersistentFlags().Lookup("admin")); err != nil { if err := viper.BindPFlag("password_admin", cmd.PersistentFlags().Lookup("password_admin")); err != nil {
return err return err
} }
@ -26,5 +26,5 @@ func (WebSocket) Init(cmd *cobra.Command) error {
func (s *WebSocket) Set() { func (s *WebSocket) Set() {
s.Password = viper.GetString("password") s.Password = viper.GetString("password")
s.AdminPassword = viper.GetString("admin") s.AdminPassword = viper.GetString("password_admin")
} }