Browse Source

Add a flag to avoid locking users for development

communities
meskio 1 year ago
parent
commit
51079f9416
Signed by: meskio
GPG Key ID: 52B8F5AC97A2DA86
  1. 2
      Makefile
  2. 5
      main.go

2
Makefile

@ -25,7 +25,7 @@ fixtures:
sudo slapadd -n 1 -l examples/data.ldif
demo:
./lowry -config examples/lowry.conf
./lowry -noLockUsers -config examples/lowry.conf
test:
go test ./...

5
main.go

@ -35,6 +35,7 @@ func main() {
httpaddr = flag.String("httpaddr", ":8080", "Web server address and port")
dbpath = flag.String("dbpath", "bolt.db", "The path to store the lowry status database")
ro = flag.Bool("ro", false, "Read-Only mode")
noLockUsers = flag.Bool("noLockUsers", false, "Don't lock users (mostly useful for development)")
giteaURL = flag.String("giteaURL", "", "Gitea server address")
token = flag.String("token", "", "Gitea admin token")
cloneAddr = flag.String("cloneAddr", "", "Template repo address to copy")
@ -60,7 +61,9 @@ func main() {
}
g := gitea.Init(*giteaURL, *token, *cloneAddr, *webhookRepoURL, *webhookRepoSecret, *webhookURL, *webhookSecret)
go updateUsers(l)
if !*noLockUsers {
go updateUsers(l)
}
ldb, err := db.Init(*dbpath)
if err != nil {

Loading…
Cancel
Save