mirror of
https://github.com/FAUSheppy/atlantis-event-dispatcher
synced 2025-12-06 14:31:35 +01:00
change: require userfile for any request
- prevent accidental or malicious sending to users that are not explicitly added
This commit is contained in:
@@ -29,9 +29,15 @@ def login_required(f):
|
|||||||
return decorated_function
|
return decorated_function
|
||||||
|
|
||||||
def signalSend(user, msg):
|
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"
|
signalCliBin = "signal-cli"
|
||||||
if app.config["SIGNAL_CLI_BIN"]:
|
if app.config["SIGNAL_CLI_BIN"]:
|
||||||
signalCliBin = app.config["SIGNAL_CLI_BIN"]
|
signalCliBin = app.config["SIGNAL_CLI_BIN"]
|
||||||
|
|
||||||
cmd = [signalCliBin, "send", "-m", msg, user]
|
cmd = [signalCliBin, "send", "-m", msg, user]
|
||||||
subprocess.Popen(cmd)
|
subprocess.Popen(cmd)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user