diff options
| author | 2019-09-18 10:18:49 +0100 | |
|---|---|---|
| committer | 2019-09-18 10:18:49 +0100 | |
| commit | ea1698499f1f1b73aedd8a627a576f4347495414 (patch) | |
| tree | 426a50d563efbbeff4fcf59aafda2469e4cafaa3 /modules/fediverse/__init__.py | |
| parent | add :$port to nginx Host header (diff) | |
through error when fediverse server is configured but crypto is missing
Diffstat (limited to 'modules/fediverse/__init__.py')
| -rw-r--r-- | modules/fediverse/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/fediverse/__init__.py b/modules/fediverse/__init__.py index dd465d6b..c53f248c 100644 --- a/modules/fediverse/__init__.py +++ b/modules/fediverse/__init__.py @@ -1,6 +1,6 @@ import urllib.parse from src import IRCBot, ModuleManager, utils -from . import ap_actor, ap_server, ap_utils +from . import ap_actor, ap_security, ap_server, ap_utils def _format_username(username, instance): return "@%s@%s" % (username, instance) @@ -25,6 +25,9 @@ class Module(ModuleManager.BaseModule): 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") + if not ap_security.has_crypto: + raise ValueError("cyprography library is not installed " + "(https://pypi.org/project/cryptography/)") server_username, instance = ap_utils.split_username(server_username) self.server = ap_server.Server(self.bot, self.exports, |
