fix w trackerze
This commit is contained in:
		| @@ -150,6 +150,10 @@ class LogMonDaemon: | |||||||
|             ip: Adres IP atakującego |             ip: Adres IP atakującego | ||||||
|             score: Punkty za dane niepowodzenie (domyślnie 1) |             score: Punkty za dane niepowodzenie (domyślnie 1) | ||||||
|         """ |         """ | ||||||
|  |         if ip in self.banned_ips: | ||||||
|  |             self.logger.debug(f"IP {ip} already banned, ignoring") | ||||||
|  |             return | ||||||
|  |          | ||||||
|         now = datetime.now() |         now = datetime.now() | ||||||
|          |          | ||||||
|         # Dodaj wpis do trackera |         # Dodaj wpis do trackera | ||||||
| @@ -175,10 +179,9 @@ class LogMonDaemon: | |||||||
|         ) |         ) | ||||||
|          |          | ||||||
|         # Sprawdź czy przekroczono limit |         # Sprawdź czy przekroczono limit | ||||||
|         if total_score >= max_failures and ip not in self.banned_ips: |         if total_score >= max_failures: | ||||||
|             self.ban_ip(ip) |             self.ban_ip(ip) | ||||||
|         elif total_score >= max_failures and ip in self.banned_ips: |  | ||||||
|             self.logger.debug(f"IP {ip} already banned, ignoring") |  | ||||||
|              |              | ||||||
|     def ban_ip(self, ip): |     def ban_ip(self, ip): | ||||||
|         """ |         """ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Mateusz Gruszczyński
					Mateusz Gruszczyński