1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

userdb: Use protocol buffers instead of our custom format

Protocol buffers are a more portable, practical and safe format for the user
database.
This commit is contained in:
Alberto Bertogli
2016-09-18 01:12:41 +01:00
parent 5c6fb934fe
commit 394067bbd3
12 changed files with 384 additions and 316 deletions

View File

@@ -136,13 +136,10 @@ func loadDomain(s *Server, name, dir string) {
if _, err := os.Stat(dir + "/users"); err == nil {
glog.Infof(" adding users")
udb, warnings, err := userdb.Load(dir + "/users")
udb, err := userdb.Load(dir + "/users")
if err != nil {
glog.Errorf(" error: %v", err)
} else {
for _, w := range warnings {
glog.Warningf(" %v", w)
}
s.AddUserDB(name, udb)
// TODO: periodically reload the database.
}