mirror of
https://github.com/h44z/wg-portal.git
synced 2025-12-15 11:06:17 +00:00
auto create account, sync ldap disabled flag
This commit is contained in:
@@ -157,7 +157,7 @@ func (s *Server) Run() {
|
||||
go func(s *Server) {
|
||||
for {
|
||||
time.Sleep(CacheRefreshDuration)
|
||||
if err := s.ldapCacheUpdater.Update(true); err != nil {
|
||||
if err := s.ldapCacheUpdater.Update(true, true); err != nil {
|
||||
log.Warnf("Failed to update ldap group cache: %v", err)
|
||||
}
|
||||
log.Debugf("Refreshed LDAP permissions!")
|
||||
@@ -165,6 +165,18 @@ func (s *Server) Run() {
|
||||
}(s)
|
||||
}
|
||||
|
||||
if !s.ldapDisabled && s.config.Core.SyncLdapStatus {
|
||||
go func(s *Server) {
|
||||
for {
|
||||
time.Sleep(CacheRefreshDuration)
|
||||
if err := s.SyncLdapAttributesWithWireGuard(); err != nil {
|
||||
log.Warnf("Failed to synchronize ldap attributes: %v", err)
|
||||
}
|
||||
log.Debugf("Synced LDAP attributes!")
|
||||
}
|
||||
}(s)
|
||||
}
|
||||
|
||||
// Run web service
|
||||
err := s.server.Run(s.config.Core.ListeningAddress)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user