ejabberd.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # SPDX-FileCopyrightText: 2016-2023 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. from amulib.cert_path_provider import CertPathProvider
  10. def run(cert_path_provider: CertPathProvider, config=None, named_key_path="/run/named/session.key",
  11. dns_server="localhost"):
  12. """ manages the certificates for dovecot
  13. :param cert_path_provider: provider for certificate paths
  14. :type cert_path_provider: CertPathProvider
  15. :param config: configuration for the service
  16. :type config: dict
  17. :param acme_dir: path to the acme state dir
  18. :type acme_dir: str
  19. :param named_key_path: path to the named session.key
  20. :type named_key_path: str
  21. :param dns_server: DNS server to use to create TLSA records
  22. :type dns_server: str
  23. """
  24. if not config:
  25. config = {
  26. "certificate_path": "/etc/ejabberd/ejabberd.pem",
  27. "key_path": "/etc/ejabberd/ejabberd.pem",
  28. "tlsa": True,
  29. "tlsa_ports": [5222, 5269]
  30. }
  31. service.run(cert_path_provider, config, named_key_path, dns_server)