From 20082ed83ed5f369792592382a874f0eeb330417 Mon Sep 17 00:00:00 2001 From: Matthew Grotke Date: Tue, 9 Jun 2026 11:47:00 -0400 Subject: [PATCH] Development --- routlin/health.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/routlin/health.py b/routlin/health.py index e12e73f..b053d42 100644 --- a/routlin/health.py +++ b/routlin/health.py @@ -28,7 +28,6 @@ import mod_validation as validation HEALTH_FILE = shared.SCRIPT_DIR / ".health" CONFIG_FILE = shared.SCRIPT_DIR / "config.json" -BLOCKLIST_DIR = shared.SCRIPT_DIR / "blocklists" NETWORKD_DIR = Path("/etc/systemd/network") WG_DIR = Path("/etc/wireguard") RESOLV_CONF = Path("/etc/resolv.conf") @@ -43,7 +42,6 @@ HEALTH_TIMER_NAME = f"{shared.PRODUCT_NAME}-health-check" MAINT_TIMER_NAME = f"{shared.PRODUCT_NAME}-maintenance" DASHB_QUEUE_FILE = shared.SCRIPT_DIR / ".dashboard-queue" NAT_SERVICE_NAME = f"{shared.PRODUCT_NAME}-nat" -BLOCKLIST_STALE_SECS = 36 * 3600 DISK_WARN_PCT = 90 DHCP_WARN_PCT = 90 DNS_TIMEOUT_SECS = 2 @@ -514,31 +512,6 @@ def check_configurations(data): except Exception: pass - # --- Blocklist file freshness --- - now = datetime.now(timezone.utc).timestamp() - bl_library = {bl["name"]: bl for bl in data.get("dns_blocking", {}).get("blocklists", [])} - needed = set() - for vlan in vlans: - needed.update(vlan.get("use_blocklists", [])) - for name in sorted(needed): - bl = bl_library.get(name) - if not bl or bl.get("bl_type") == "local": - continue - save_as = bl.get("save_as", "") - path = BLOCKLIST_DIR / save_as if save_as else None - if not path or not path.exists(): - results.append(problem( - f"blocklist_{name}", f"blocklist ({name})", "warning", - f"Blocklist file for '{name}' has not been downloaded.", - "Run `sudo python3 dl_blocklists.py`.")) - elif now - path.stat().st_mtime > BLOCKLIST_STALE_SECS: - age_h = int((now - path.stat().st_mtime) / 3600) - results.append(problem( - f"blocklist_{name}", f"blocklist ({name})", "warning", - f"Blocklist '{name}' is {age_h}h old (threshold 36h).", - "Run `sudo python3 dl_blocklists.py`.")) - else: - results.append(ok(f"blocklist_{name}", f"blocklist ({name})")) # --- Disk space --- try: