ejabberd.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # SPDX-FileCopyrightText: 2016-2017 Helmut Pozimski <helmut@pozimski.eu>
  2. #
  3. # SPDX-License-Identifier: GPL-2.0-only
  4. # -*- coding: utf8 -*-
  5. """ Contains the postfix module which manages certificates for the ejabberd
  6. server.
  7. """
  8. from amulib import service
  9. def run(config=None, acme_dir="/var/lib/acme",
  10. named_key_path="/run/named/session.key", dns_server="localhost"):
  11. """ manages the certificates for dovecot
  12. :param config: configuration for the service
  13. :type config: dict
  14. :param acme_dir: path to the acme state dir
  15. :type acme_dir: str
  16. :param named_key_path: path to the named session.key
  17. :type named_key_path: str
  18. :param dns_server: DNS server to use to create TLSA records
  19. :type dns_server: str
  20. """
  21. if not config:
  22. config = {
  23. "certificate_path": "/etc/ejabberd/ejabberd.pem",
  24. "key_path": "/etc/ejabberd/ejabberd.pem",
  25. "tlsa": True,
  26. "tlsa_ports": [5222, 5269]
  27. }
  28. service.run("ejabberd", config, acme_dir, named_key_path, dns_server)