Skip to content

Commit

Permalink
Add "service" field in bans when sending it to the API from bwcli
Browse files Browse the repository at this point in the history
  • Loading branch information
TheophileDiot committed Oct 23, 2024
1 parent 0d6fdbd commit f29095a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/cli/CLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def ban(self, ip: str, exp: float, reason: str) -> Tuple[bool, str]:
self.__logger.error(f"Failed to ban {ip} in redis: {e}")

try:
if self.send_to_apis("POST", "/ban", data={"ip": ip, "exp": exp, "reason": reason}):
if self.send_to_apis("POST", "/ban", data={"ip": ip, "exp": exp, "reason": reason, "service": "bwcli"}):
return True, f"IP {ip} has been banned for {format_remaining_time(exp)} with reason {reason}"
except BaseException as e:
return False, f"Failed to ban {ip}: {e}"
Expand Down

0 comments on commit f29095a

Please sign in to comment.