pyceo/ceo_common/model/Config.py

44 lines
1.5 KiB
Python
Raw Normal View History

2021-07-19 01:47:39 -04:00
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 = {
2021-07-23 20:08:22 -04:00
'base_domain': _domain,
2021-07-19 01:47:39 -04:00
'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,
2021-07-23 20:08:22 -04:00
'ldap_sudo_base': 'ou=SUDOers,' + _ldap_base,
2021-07-19 01:47:39 -04:00
'ldap_sasl_realm': _domain.upper(),
2021-07-23 20:08:22 -04:00
'uwldap_server_url': 'ldap://uwldap.uwaterloo.ca',
'uwldap_base': 'dc=uwaterloo,dc=ca',
2021-07-19 01:47:39 -04:00
'member_min_id': 20001,
'member_max_id': 29999,
'club_min_id': 30001,
'club_max_id': 39999,
2021-07-23 20:08:22 -04:00
'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',
2021-07-24 17:09:10 -04:00
'new_member_list': 'csc-general',
'ceod_admin_host': 'phosphoric-acid',
'fs_root_host': 'phosphoric-acid',
'mailman_host': 'mail',
'ceod_use_https': False,
'ceod_port': 9987,
2021-07-19 01:47:39 -04:00
}
def get(self, key: str) -> str:
return self._config[key]