增加使用命令初始化用户密码功能
This commit is contained in:
@ -8,10 +8,11 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
DB string
|
||||
Server *Server
|
||||
Mysql *Mysql
|
||||
Sqlite *Sqlite
|
||||
DB string
|
||||
Server *Server
|
||||
Mysql *Mysql
|
||||
Sqlite *Sqlite
|
||||
ResetPassword string
|
||||
}
|
||||
|
||||
type Mysql struct {
|
||||
@ -53,6 +54,7 @@ func SetupConfig() (*Config, error) {
|
||||
pflag.String("server.addr", "", "server listen addr")
|
||||
pflag.String("server.cert", "", "tls cert file")
|
||||
pflag.String("server.key", "", "tls key file")
|
||||
pflag.String("reset-password", "", "")
|
||||
|
||||
pflag.Parse()
|
||||
_ = viper.BindPFlags(pflag.CommandLine)
|
||||
@ -75,6 +77,7 @@ func SetupConfig() (*Config, error) {
|
||||
Cert: viper.GetString("server.cert"),
|
||||
Key: viper.GetString("server.key"),
|
||||
},
|
||||
ResetPassword: viper.GetString("reset-password"),
|
||||
}
|
||||
|
||||
return config, nil
|
||||
|
Reference in New Issue
Block a user