#

MEMCACHE_ADDR = ['127.0.0.1:11211']

# Lock all low-level authentications (email and dav services) to
# accounts assigned to the local machine.
import socket
host = socket.gethostname().split('.')[0]

LDAP_SERVICE_MAP = {

    # Mail accounts (dovecot, nginx-mail-mapper).
    'mail': {
        'base': 'ou=People, dc=investici, dc=org, o=Anarchy',
        'filter': '(&(objectClass=virtualMailUser)(status=active)(mail=%s))',
    },
 
    # DAV access (webdav fcgi handler).
    'dav': {
        'base': 'ou=People, dc=investici, dc=org, o=Anarchy',
        'filter': '(&(objectClass=ftpAccount)(status=active)(host=%s)(ftpname=%%s))' % host,
    },

    # Main account (pannello).
    'account': {
        'dn': 'uid=%s, ou=People, dc=investici, dc=org, o=Anarchy',
    },

}

LDAP_BIND_DN = 'cn=manager, o=Anarchy'

with open('/etc/ldap.secret') as fd:
    LDAP_BIND_PW = fd.read().strip()
