Hello, I am stuck on the problem that Seafile syncs the users via LDAP, but you can not log in with these LDAP users in Seafile.
I have made the configuration in /opt/seafile-data/seafile/conf/ccnet.conf.
I have now read through the documentation again and realized that the configuration was made in the documentation in seahub_settings.py.
I have now tried to configure the same configuration as described in the documentation in seahub_settings.py and to leave ccnet.conf alone.
Unfortunately the LDAP sync does not work at all, it does not seem to register this at all. Do you have any other ideas?
root@server:/opt/seafile# docker exec -it seafile /opt/seafile/seafile-server-latest/pro/pro.py ldapsync
[04/23/2024 16:33:06] [INFO] [seafevents] database: mysql, name: seahub_db
[04/23/2024 16:33:06] [INFO] LDAP section is not set, disable ldap sync.
Here is the configuration in seahub_settings.py:
cat seahub_settings.py
# -*- coding: utf-8 -*-
SECRET_KEY = "b''"
SERVICE_URL = "http://URL"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': 'db',
'PORT': '3306',
'OPTIONS': {'charset': 'utf8mb4'},
}
}
CACHES = {
'default': {
'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
'LOCATION': 'memcached:11211',
},
'locmem': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
}
COMPRESS_CACHE_BACKEND = 'locmem'
TIME_ZONE = 'Europe/Berlin'
FILE_SERVER_ROOT = "http://URL"
# LDAP Configuration
ENABLE_LDAP = True
LDAP_SERVER_URL = 'ldap://IP of LDAP Server' # The URL of LDAP server
LDAP_BASE_DN = 'ou=XXX,dc=XXXXXX,dc=XX;ou=XXXXXXXX,dc=XXXXXX,dc=XX' # The root node of users who can
# log in to Seafile in the LDAP server
LDAP_ADMIN_DN = 'USER@DOMAIN.COM' # DN of the administrator used
# to query the LDAP server for information.
# For OpenLDAP, it maybe cn=admin,dc=example,dc=com
LDAP_ADMIN_PASSWORD = 'PASSWORD' # Password of LDAP_ADMIN_DN
LDAP_PROVIDER = 'ldap' # Identify the source of the user, used in
# the table social_auth_usersocialauth, defaults to 'ldap'
LDAP_LOGIN_ATTR = 'mail' # User's attribute used to log in to Seafile.
# It should be a unique identifier for the user in LDAP server.
# Learn more about this id from the descriptions at begining of this section.
LDAP_CONTACT_EMAIL_ATTR = '' # LDAP user's contact_email attribute
LDAP_USER_ROLE_ATTR = '' # LDAP user's role attribute
LDAP_USER_FIRST_NAME_ATTR = 'givenName' # For update user's first name when login
LDAP_USER_LAST_NAME_ATTR = 'sn' # For update user's last name when login
LDAP_USER_NAME_REVERSE = False # Whether to reverse the user's first and last name
LDAP_FILTER = 'memberOf=CN=XXXXXXXXX,OU=XXXXXXX,OU=XXX,DC=XXXXX,DC=XX' # Additional filter conditions,
# users who meet the filter conditions can log in, otherwise they cannot log in
# Basic configuration items
ENABLE_LDAP = True
# ldap user sync options.
LDAP_SYNC_INTERVAL = 30 # LDAP sync task period, in minutes
ENABLE_LDAP_USER_SYNC = True # Whether to enable user sync
LDAP_USER_OBJECT_CLASS = 'person' # This is the name of the class used to search for user objects.
# In Active Directory, it's usually "person". The default value is "person".
LDAP_DEPT_ATTR = '' # LDAP user's department info
LDAP_UID_ATTR = '' # LDAP user's login_id attribute
# In Active Directory, it's usually "sAMAccountName".
LDAP_AUTO_REACTIVATE_USERS = True # Whether to auto activate deactivated user
LDAP_USE_PAGED_RESULT = False # Whether to use pagination extension
# It is useful when you have more than 1000 users in LDAP server.
IMPORT_NEW_USER = True # Whether to import new users when sync user
ACTIVATE_USER_WHEN_IMPORT = True # Whether to activate the user when importing new user
DEACTIVE_USER_IF_NOTFOUND = True # Set to "true" if you want to deactivate a user
# when he/she was deleted in AD server.
ENABLE_EXTRA_USER_INFO_SYNC = True # Whether to enable sync of additional user information,
# including user's full name, department, and Windows login name, etc.