feat: restore CHFS JWT session compatibility
This commit is contained in:
@@ -64,6 +64,26 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
for _, ac := range cfg.Accounts {
|
||||
a := &auth.Account{Username: ac.Username, Password: ac.Password, Mask: auth.ParseMask(ac.Default)}
|
||||
for _, d := range ac.None {
|
||||
a.Rules = append(a.Rules, auth.PathRule{Dir: d, Deny: true})
|
||||
}
|
||||
for _, d := range ac.Read {
|
||||
a.Rules = append(a.Rules, auth.PathRule{Dir: d, Mask: auth.Read, ChildrenOnly: true})
|
||||
}
|
||||
for _, d := range ac.Write {
|
||||
a.Rules = append(a.Rules, auth.PathRule{Dir: d, Mask: auth.Write, ChildrenOnly: true})
|
||||
}
|
||||
for _, d := range ac.Delete {
|
||||
a.Rules = append(a.Rules, auth.PathRule{Dir: d, Mask: auth.Delete, ChildrenOnly: true})
|
||||
}
|
||||
if ac.Username == "guest" {
|
||||
mgr.Guest = a
|
||||
} else {
|
||||
mgr.Accounts[ac.Username] = a
|
||||
}
|
||||
}
|
||||
multi := storage.NewMulti(cfg.Path)
|
||||
store := storage.Storage(multi)
|
||||
if len(cfg.Path) == 1 {
|
||||
|
||||
Reference in New Issue
Block a user