main: Allow loading the component secret

This commit is contained in:
PapaTutuWawa 2021-11-25 22:32:51 +01:00
parent 8ab23c63ab
commit 9822d7770c

View File

@ -510,8 +510,18 @@ def main():
raise Exception("config.toml not found") raise Exception("config.toml not found")
general = config["general"] general = config["general"]
secret = ""
if not "secret" in general:
if "secret_file" in general:
with open(general["secret_file"], "r") as f:
secret = f.read().replace("\n", "")
else:
raise Exception("No component secret specified")
else:
secret = general["secret"]
xmpp = BridgeComponent(general["jid"], xmpp = BridgeComponent(general["jid"],
general["secret"], secret,
general["server"], general["server"],
general["port"], general["port"],
general["discord_token"], general["discord_token"],