mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
email_server: Don't get domain name during initialization
This keeps the LE module working better when the domain name is changed after startup. Tests: - Untested. The module is not enabled yet. LE functionality in email server is not fully functional. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
b163423a26
commit
6429806114
@ -82,17 +82,13 @@ class EmailServerApp(plinth.app.App):
|
|||||||
self.add(webserver)
|
self.add(webserver)
|
||||||
|
|
||||||
# Let's Encrypt event hook
|
# Let's Encrypt event hook
|
||||||
default_domain = get_domainname()
|
letsencrypt = LetsEncrypt('letsencrypt-email-server',
|
||||||
domains = [default_domain] if default_domain else []
|
domains=get_domains,
|
||||||
letsencrypt = LetsEncrypt('letsencrypt-email-server', domains=domains,
|
|
||||||
daemons=['postfix', 'dovecot'],
|
daemons=['postfix', 'dovecot'],
|
||||||
should_copy_certificates=False,
|
should_copy_certificates=False,
|
||||||
managing_app='email_server')
|
managing_app='email_server')
|
||||||
self.add(letsencrypt)
|
self.add(letsencrypt)
|
||||||
|
|
||||||
if not domains:
|
|
||||||
logger.warning('Could not fetch the FreedomBox domain name!')
|
|
||||||
|
|
||||||
def _add_ui_components(self):
|
def _add_ui_components(self):
|
||||||
info = plinth.app.Info(
|
info = plinth.app.Info(
|
||||||
app_id=self.app_id, version=version, name=self.app_name,
|
app_id=self.app_id, version=version, name=self.app_name,
|
||||||
@ -146,6 +142,12 @@ class EmailServerApp(plinth.app.App):
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
def get_domains():
|
||||||
|
"""Return the list of domains configured."""
|
||||||
|
default_domain = get_domainname()
|
||||||
|
return [default_domain] if default_domain else []
|
||||||
|
|
||||||
|
|
||||||
def setup(helper, old_version=None):
|
def setup(helper, old_version=None):
|
||||||
"""Installs and configures module"""
|
"""Installs and configures module"""
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user