diff --git a/packages/secubox-toolbox/secubox_toolbox/api.py b/packages/secubox-toolbox/secubox_toolbox/api.py index edc233e9..21c1c111 100644 --- a/packages/secubox-toolbox/secubox_toolbox/api.py +++ b/packages/secubox-toolbox/secubox_toolbox/api.py @@ -3229,6 +3229,23 @@ async def admin_ad_stats(hours: int = 24) -> dict: except Exception: nd = 0 out["network_drops"] = nd + # DNS-layer ad-blocking (secubox-adblock-sync #740): the Unbound sinkhole + # kills most ads BEFORE they reach the engine, so total_blocked (204s) reads + # low/0. Surface the real DNS blocking so the tab isn't misleading — "0 + # engine blocks" ≠ "no ad-blocking". + try: + import json as _json + s = _json.loads(Path("/var/lib/secubox/ad-guard/sinkhole-status.json").read_text()) + comp = s.get("compile", {}) or {} + out["dns_sinkhole"] = { + "enabled": bool(s.get("enabled")), + "domains": int(s.get("blocked", 0) or 0), + "net_rules": int(comp.get("net_rules", 0) or 0), + "cosmetic_domains": int(comp.get("cosmetic_domains", 0) or 0), + "sources": sorted((comp.get("sources") or {}).keys()), + } + except Exception: + out["dns_sinkhole"] = {"enabled": None} return out diff --git a/packages/secubox-toolbox/www/toolbox/index.html b/packages/secubox-toolbox/www/toolbox/index.html index bad2b199..9cdf5f50 100644 --- a/packages/secubox-toolbox/www/toolbox/index.html +++ b/packages/secubox-toolbox/www/toolbox/index.html @@ -177,8 +177,13 @@
La plupart des pubs sont tuées ICI, au DNS, avant d'atteindre le moteur MITM — le compteur « 204 » ci-dessous ne mesure QUE ce qui passe le DNS.
+