Add adminpass config item.
This commit is contained in:
parent
9f02063c86
commit
144060c3cb
@ -52,6 +52,7 @@ type config struct {
|
||||
SupportEmail string `long:"supportemail" ini-name:"supportemail" description:"Email address for users in need of support."`
|
||||
BackupInterval time.Duration `long:"backupinterval" ini-name:"backupinterval" description:"Time period between automatic database backups. Valid time units are {s,m,h}. Minimum 30 seconds."`
|
||||
VspClosed bool `long:"vspclosed" ini-name:"vspclosed" description:"Closed prevents the VSP from accepting new tickets."`
|
||||
AdminPass string `long:"adminpass" ini-name:"adminpass" description:"Password for accessing admin page."`
|
||||
|
||||
// The following flags should be set on CLI only, not via config file.
|
||||
FeeXPub string `long:"feexpub" no-ini:"true" description:"Cold wallet xpub used for collecting fees. Should be provided once to initialize a vspd database."`
|
||||
@ -271,6 +272,11 @@ func loadConfig() (*config, error) {
|
||||
return nil, errors.New("the supportemail option is not set")
|
||||
}
|
||||
|
||||
// Ensure the administrator password is set.
|
||||
if cfg.AdminPass == "" {
|
||||
return nil, errors.New("the adminpass option is not set")
|
||||
}
|
||||
|
||||
// Ensure the dcrd RPC username is set.
|
||||
if cfg.DcrdUser == "" {
|
||||
return nil, errors.New("the dcrduser option is not set")
|
||||
|
||||
@ -125,6 +125,7 @@ webserverdebug = false
|
||||
supportemail = example@test.com
|
||||
backupinterval = 3m0s
|
||||
vspclosed = false
|
||||
adminpass=12345
|
||||
EOF
|
||||
|
||||
tmux new-window -t $TMUX_SESSION -n "vspd"
|
||||
|
||||
1
main.go
1
main.go
@ -88,6 +88,7 @@ func run(ctx context.Context) error {
|
||||
NetParams: cfg.netParams.Params,
|
||||
SupportEmail: cfg.SupportEmail,
|
||||
VspClosed: cfg.VspClosed,
|
||||
AdminPass: cfg.AdminPass,
|
||||
}
|
||||
err = webapi.Start(ctx, shutdownRequestChannel, &shutdownWg, cfg.Listen, db,
|
||||
dcrd, wallets, cfg.WebServerDebug, apiCfg)
|
||||
|
||||
@ -24,6 +24,7 @@ type Config struct {
|
||||
FeeAccountName string
|
||||
SupportEmail string
|
||||
VspClosed bool
|
||||
AdminPass string
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user