diff --git a/config b/config index 83daabf..b1ee131 100644 --- a/config +++ b/config @@ -27,7 +27,7 @@ stock = utf-8 [acl] # Access method -# Value: fake | htpasswd +# Value: fake | htpasswd | authLdap type = fake # Personal calendars only available for logged in users (if needed) personal = False @@ -37,6 +37,16 @@ filename = /etc/radicale/users # Value: plain | sha1 | crypt encryption = crypt +[authLdap] +#LDAP Host +LDAPServer = 127.0.0.1 +#Fields to create a LDAP bind +#Value to add before the user name in a LDAP bind +LDAPPrepend = uid= +#Value to add after the user name in a LDAP bind +LDAPAppend = ou=users,dc=exmaple,dc=dom +#=> uid=corentin,ou=users,dc=exmaple,dc=dom + [storage] # Folder for storing local calendars, # created if not present diff --git a/radicale/acl/authLdap.py b/radicale/acl/authLdap.py index b8142b5..b80964a 100644 --- a/radicale/acl/authLdap.py +++ b/radicale/acl/authLdap.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -import sys, ldap +import sys, ldap, syslog from radicale import config, log diff --git a/radicale/config.py b/radicale/config.py index 77f34af..b3eb419 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -59,7 +59,15 @@ INITIAL_CONFIG = { "folder": os.path.expanduser("~/.config/radicale/calendars")}, "logging": { "logfile": os.path.expanduser("~/.config/radicale/radicale.log"), - "facility": 10}} + "facility": 10}, + "authLdap": { + "LDAPServer": "127.0.0.1", + "LDAPPrepend": "uid=", + "LDAPAppend": "ou=users,dc=example,dc=com"}, + "logging": { + "logfile": os.path.expanduser("~/.config/radicale/radicale.log"), + "facility": "error"} + } # Create a ConfigParser and configure it _CONFIG_PARSER = ConfigParser() diff --git a/radicale/log.py b/radicale/log.py index 1861e4e..072857a 100644 --- a/radicale/log.py +++ b/radicale/log.py @@ -19,4 +19,5 @@ class log: _LOGGING = log() -sys.modules[__name__] = _LOGGING \ No newline at end of file +sys.modules[__name__] = _LOGGING +