throw on_start() exceptions when tls key/certificate are not present
This commit is contained in:
parent
5800fef4c9
commit
f8d24bc422
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,11 @@ class Module(ModuleManager.BaseModule):
|
||||||
def on_load(self):
|
def on_load(self):
|
||||||
server_username = self.bot.get_setting("fediverse-server", None)
|
server_username = self.bot.get_setting("fediverse-server", None)
|
||||||
if server_username:
|
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)
|
server_username, instance = ap_utils.split_username(server_username)
|
||||||
self.server = ap_server.Server(self.bot, server_username, instance)
|
self.server = ap_server.Server(self.bot, server_username, instance)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue