From 5f498edbaed750d4d70eeccc21d4d79bffe61576 Mon Sep 17 00:00:00 2001 From: thomasciesla Date: Thu, 4 Dec 2025 17:08:11 +0100 Subject: [PATCH] geoip_shop_manager.py aktualisiert --- geoip_shop_manager.py | 77 ++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/geoip_shop_manager.py b/geoip_shop_manager.py index bdc5cc7..8372456 100644 --- a/geoip_shop_manager.py +++ b/geoip_shop_manager.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 """ -GeoIP Shop Blocker Manager - Final Fixed Version +GeoIP Shop Blocker Manager - DACH Version 2-Component System: PHP blocking + Python watcher (systemd service) +Blocks all IPs outside Germany, Austria, and Switzerland (DACH region) """ import os @@ -17,7 +18,7 @@ from pathlib import Path VHOSTS_DIR = "/var/www/vhosts" BACKUP_SUFFIX = ".geoip_backup" BLOCKING_FILE = "geoip_blocking.php" -CACHE_FILE = "de_ip_ranges.cache" +CACHE_FILE = "dach_ip_ranges.cache" LOG_FILE = "geoip_blocked.log" CROWDSEC_QUEUE_FILE = "geoip_crowdsec_queue.log" WATCHER_SCRIPT = "/usr/local/bin/geoip_crowdsec_watcher.py" @@ -27,7 +28,8 @@ ACTIVE_SHOPS_FILE = "/var/lib/crowdsec/geoip_active_shops.json" # PHP GeoIP blocking script (no exec, just logging) GEOIP_SCRIPT = '''