Re-add banlist features

This effectively reverts commit b366290118.
This commit is contained in:
sfan5
2017-05-14 15:03:05 +02:00
parent 5de6082f57
commit 705ea6e1a0
2 changed files with 14 additions and 0 deletions

View File

@@ -39,6 +39,9 @@ def announce():
if ip.startswith("::ffff:"):
ip = ip[7:]
if ip in app.config["BANNED_IPS"]:
return "Banned (IP).", 403
data = request.values["json"]
if len(data) > 5000:
@@ -72,6 +75,9 @@ def announce():
server["port"] = int(server["port"])
#### End compatability code ####
if "%s/%d" % (server["ip"], server["port"]) in app.config["BANNED_SERVERS"]:
return "Banned (Server).", 403
old = serverList.get(ip, server["port"])
if action == "delete":