main: Allow loading the component secret
This commit is contained in:
parent
8ab23c63ab
commit
9822d7770c
@ -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"],
|
||||||
|
Loading…
Reference in New Issue
Block a user