pyceo/ceo_common/model/Config.py

38 lines
1.3 KiB
Python

from zope.interface import implementer
from ceo_common.interfaces import IConfig
@implementer(IConfig)
class Config:
# TODO: read from a config file
_domain = 'csclub.internal'
_ldap_base = ','.join(['dc=' + dc for dc in _domain.split('.')])
_config = {
'base_domain': _domain,
'ldap_admin_principal': 'ceod/admin',
'ldap_server_url': 'ldap://ldap-master.' + _domain,
'ldap_users_base': 'ou=People,' + _ldap_base,
'ldap_groups_base': 'ou=Group,' + _ldap_base,
'ldap_sudo_base': 'ou=SUDOers,' + _ldap_base,
'ldap_sasl_realm': _domain.upper(),
'uwldap_server_url': 'ldap://uwldap.uwaterloo.ca',
'uwldap_base': 'dc=uwaterloo,dc=ca',
'member_min_id': 20001,
'member_max_id': 29999,
'club_min_id': 30001,
'club_max_id': 39999,
'member_home': '/users',
'club_home': '/users',
'member_home_skel': '/users/skel',
'club_home_skel': '/users/skel',
'smtp_url': 'smtp://mail.' + _domain,
'smtp_starttls': False,
'mailman3_api_base_url': 'http://localhost:8001/3.1',
'mailman3_api_username': 'restadmin',
'mailman3_api_password': 'mailman3',
}
def get(self, key: str) -> str:
return self._config[key]