Provide command line variables for initializing an admin user. Previously to get admin access on a fresh install I had to create a user in the web interface (to make sure the password hash/salt is properly setup) then manually change the role in the database to 'admin' using a postgresql client. This was a pain in the ass, and I think there really needs to be an easy way to create the admin user on the initial deployment. This solution fixes this, and adds documentation to the README file on how to use those variables.

This commit is contained in:
endangered 2019-11-25 06:58:44 +09:30
parent defaa2ae0b
commit f836f40f89
5 changed files with 62 additions and 2 deletions

View file

@ -53,6 +53,11 @@ func (db *roDB) AddRawUser(name string, hpass []byte, salt []byte, role string)
return errors.New("RO database")
}
func (db *roDB) SetAdminUser(name string, pass string) error {
return errors.New("RO database")
}
func (db *roDB) GetRole(name string) (string, error) {
return db.db.GetRole(name)
}