mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +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)
|
||||
|
||||
# Let's Encrypt event hook
|
||||
default_domain = get_domainname()
|
||||
domains = [default_domain] if default_domain else []
|
||||
letsencrypt = LetsEncrypt('letsencrypt-email-server', domains=domains,
|
||||
letsencrypt = LetsEncrypt('letsencrypt-email-server',
|
||||
domains=get_domains,
|
||||
daemons=['postfix', 'dovecot'],
|
||||
should_copy_certificates=False,
|
||||
managing_app='email_server')
|
||||
self.add(letsencrypt)
|
||||
|
||||
if not domains:
|
||||
logger.warning('Could not fetch the FreedomBox domain name!')
|
||||
|
||||
def _add_ui_components(self):
|
||||
info = plinth.app.Info(
|
||||
app_id=self.app_id, version=version, name=self.app_name,
|
||||
@ -146,6 +142,12 @@ class EmailServerApp(plinth.app.App):
|
||||
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):
|
||||
"""Installs and configures module"""
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user