From f8d24bc4227152ba04e0ee6aa9fed308d54cc900 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 15 Sep 2019 17:11:45 +0100 Subject: [PATCH] throw on_start() exceptions when tls key/certificate are not present --- modules/fediverse/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/fediverse/__init__.py b/modules/fediverse/__init__.py index 6e624ffe..93f75338 100644 --- a/modules/fediverse/__init__.py +++ b/modules/fediverse/__init__.py @@ -21,6 +21,11 @@ class Module(ModuleManager.BaseModule): def on_load(self): server_username = self.bot.get_setting("fediverse-server", None) if server_username: + if not "tls-key" in self.bot.config: + raise ValueError("`tls-key` not provided in bot config") + if not "tls-certificate" in self.bot.config: + raise ValueError("`tls-certificate` not provided in bot config") + server_username, instance = ap_utils.split_username(server_username) self.server = ap_server.Server(self.bot, server_username, instance)