Authelia users sync
This commit is contained in:
parent
9e1b06a448
commit
6654463aee
5 changed files with 252 additions and 6 deletions
13
main.go
13
main.go
|
|
@ -9,6 +9,7 @@ import (
|
|||
|
||||
"git.readonly.ch/bouzoure/pop-camarades/controllers"
|
||||
"git.readonly.ch/bouzoure/pop-camarades/helpers"
|
||||
"git.readonly.ch/bouzoure/pop-camarades/helpers/authelia"
|
||||
"git.readonly.ch/bouzoure/pop-camarades/jobs"
|
||||
"git.readonly.ch/bouzoure/pop-camarades/middlewares"
|
||||
"github.com/flosch/pongo2/v6"
|
||||
|
|
@ -57,6 +58,18 @@ func main() {
|
|||
// Note: jobs will be executed at launch and after every interval
|
||||
go helpers.RegisterJob(60*time.Minute, "clean saved sessions", jobs.CleanSavedSessions)
|
||||
|
||||
// Goroutine to update Authelia accounts in the background
|
||||
go func() {
|
||||
for {
|
||||
err = authelia.SyncUsers()
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
time.Sleep(time.Minute)
|
||||
}
|
||||
}()
|
||||
|
||||
// Initialize the Pongo2 templating engine
|
||||
// If we are in dev mode, load templates from directory
|
||||
// Otherwise, use the templates embedded in the binary
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue