1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00

Remove the dependency to mailustart, introducing socrate

This commit is contained in:
kaiyou 2019-05-06 15:14:00 +02:00
parent eaa20ffbe3
commit d7747639e9
2 changed files with 9 additions and 7 deletions

View File

@ -1,5 +1,6 @@
import os
from mailustart import resolve
from socrate import system
DEFAULT_CONFIG = {
# Specific to the admin UI
@ -72,16 +73,15 @@ class ConfigManager(dict):
'mysql': 'mysql://{DB_USER}:{DB_PW}@{DB_HOST}/{DB_NAME}'
}
HOSTS = ('HOST_IMAP', 'HOST_POP3', 'HOST_AUTHSMTP', 'HOST_SMTP',
'HOST_WEBMAIL')
def __init__(self):
self.config = dict()
def resolve_host(self):
self.config['HOST_IMAP'] = resolve(self.config['HOST_IMAP'])
self.config['HOST_POP3'] = resolve(self.config['HOST_POP3'])
self.config['HOST_AUTHSMTP'] = resolve(self.config['HOST_AUTHSMTP'])
self.config['HOST_SMTP'] = resolve(self.config['HOST_SMTP'])
if self.config['WEBMAIL'] != 'none':
self.config['HOST_WEBMAIL'] = resolve(self.config['HOST_WEBMAIL'])
for item in self.HOSTS:
self.config[item] = system.resolve_address(self.config[item])
def __coerce_value(self, value):
if isinstance(value, str) and value.lower() in ('true','yes'):

View File

@ -10,6 +10,7 @@ Flask-debugtoolbar
Flask-limiter
redis
WTForms-Components
socrate
passlib
gunicorn
tabulate
@ -20,3 +21,4 @@ bcrypt
tenacity
mysqlclient
psycopg2
idna