diff --git a/authentik/sources/ldap/management/commands/ldap_sync.py b/authentik/sources/ldap/management/commands/ldap_sync.py index 15ea1c45a..eac5a32ef 100644 --- a/authentik/sources/ldap/management/commands/ldap_sync.py +++ b/authentik/sources/ldap/management/commands/ldap_sync.py @@ -3,7 +3,10 @@ from django.core.management.base import BaseCommand from structlog.stdlib import get_logger from authentik.sources.ldap.models import LDAPSource -from authentik.sources.ldap.tasks import ldap_sync_single +from authentik.sources.ldap.sync.groups import GroupLDAPSynchronizer +from authentik.sources.ldap.sync.membership import MembershipLDAPSynchronizer +from authentik.sources.ldap.sync.users import UserLDAPSynchronizer +from authentik.sources.ldap.tasks import ldap_sync_paginator LOGGER = get_logger() @@ -20,4 +23,10 @@ class Command(BaseCommand): if not source: LOGGER.warning("Source does not exist", slug=source_slug) continue - ldap_sync_single(source) + tasks = ( + ldap_sync_paginator(source, UserLDAPSynchronizer) + + ldap_sync_paginator(source, GroupLDAPSynchronizer) + + ldap_sync_paginator(source, MembershipLDAPSynchronizer) + ) + for task in tasks: + task() diff --git a/authentik/sources/ldap/sync/users.py b/authentik/sources/ldap/sync/users.py index c55d14517..4a67c1cdc 100644 --- a/authentik/sources/ldap/sync/users.py +++ b/authentik/sources/ldap/sync/users.py @@ -49,7 +49,7 @@ class UserLDAPSynchronizer(BaseLDAPSynchronizer): uniq = self._flatten(attributes[self._source.object_uniqueness_field]) try: defaults = self.build_user_properties(user_dn, **attributes) - self._logger.debug("Creating user with attributes", **defaults) + self._logger.debug("Writing user with attributes", **defaults) if "username" not in defaults: raise IntegrityError("Username was not set by propertymappings") ak_user, created = self.update_or_create_attributes( diff --git a/website/docs/troubleshooting/ldap_source.md b/website/docs/troubleshooting/ldap_source.md index 5d7450c69..196891751 100644 --- a/website/docs/troubleshooting/ldap_source.md +++ b/website/docs/troubleshooting/ldap_source.md @@ -5,7 +5,7 @@ title: Troubleshooting LDAP Synchronization To troubleshoot LDAP sources, you can run the command below to run a synchronization in the foreground and see any errors or warnings that might happen directly ``` -docker-compose run --rm server ldap_sync *slug of the source* +docker-compose run --rm worker ldap_sync *slug of the source* ``` or, for Kubernetes, run