change: require userfile for any request

- prevent accidental or malicious sending to users that are not explicitly added
This commit is contained in:
2023-04-10 10:14:55 +02:00
parent 4286a175a5
commit 989b605ca7

View File

@@ -29,9 +29,15 @@ def login_required(f):
return decorated_function
def signalSend(user, msg):
if user not in dbReadSignalUserFile():
print("{} not in Userfiler, refusing to send".format(user), file=sys.stderr)
return
signalCliBin = "signal-cli"
if app.config["SIGNAL_CLI_BIN"]:
signalCliBin = app.config["SIGNAL_CLI_BIN"]
cmd = [signalCliBin, "send", "-m", msg, user]
subprocess.Popen(cmd)