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:
parent
eaa20ffbe3
commit
d7747639e9
@ -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'):
|
||||
|
@ -10,6 +10,7 @@ Flask-debugtoolbar
|
||||
Flask-limiter
|
||||
redis
|
||||
WTForms-Components
|
||||
socrate
|
||||
passlib
|
||||
gunicorn
|
||||
tabulate
|
||||
@ -20,3 +21,4 @@ bcrypt
|
||||
tenacity
|
||||
mysqlclient
|
||||
psycopg2
|
||||
idna
|
||||
|
Loading…
Reference in New Issue
Block a user