|
@@ -0,0 +1,45 @@
|
|
|
|
+# This file is part of acme-updater, written by Helmut Pozimski 2016-2017.
|
|
|
|
+#
|
|
|
|
+# stov is free software: you can redistribute it and/or modify
|
|
|
|
+# it under the terms of the GNU General Public License as published by
|
|
|
|
+# the Free Software Foundation, version 2 of the License.
|
|
|
|
+#
|
|
|
|
+# stov is distributed in the hope that it will be useful,
|
|
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
+# GNU General Public License for more details.
|
|
|
|
+#
|
|
|
|
+# You should have received a copy of the GNU General Public License
|
|
|
|
+# along with stov. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+# -*- coding: utf8 -*-
|
|
|
|
+
|
|
|
|
+""" Contains the dovecot module which manages certificates for the dovecot
|
|
|
|
+mail server.
|
|
|
|
+"""
|
|
|
|
+
|
|
|
|
+import socket
|
|
|
|
+
|
|
|
|
+from amulib import service
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def run(config=None, acme_dir="/var/lib/acme",
|
|
|
|
+ named_key_path="/run/named/session.key"):
|
|
|
|
+ """ manages the certificates for dovecot
|
|
|
|
+
|
|
|
|
+ :param config: configuration for the service
|
|
|
|
+ :type config: dict
|
|
|
|
+ :param acme_dir: path to the acme state dir
|
|
|
|
+ :type acme_dir: str
|
|
|
|
+ :param named_key_path: path to the named session.key
|
|
|
|
+ :type named_key_path: str
|
|
|
|
+ """
|
|
|
|
+ if not config:
|
|
|
|
+ config = {
|
|
|
|
+ "certificate_path": "/usr/share/ssl/certs/dovecot.pem",
|
|
|
|
+ "key_path": "/usr/share/ssl/private/dovecot.pem",
|
|
|
|
+ "tlsa": True,
|
|
|
|
+ "tlsa_ports": [993]
|
|
|
|
+ }
|
|
|
|
+ service.run("dovecot", config, acme_dir, named_key_path)
|