Development
This commit is contained in:
parent
3b2fa07ac9
commit
20082ed83e
1 changed files with 0 additions and 27 deletions
|
|
@ -28,7 +28,6 @@ import mod_validation as validation
|
||||||
|
|
||||||
HEALTH_FILE = shared.SCRIPT_DIR / ".health"
|
HEALTH_FILE = shared.SCRIPT_DIR / ".health"
|
||||||
CONFIG_FILE = shared.SCRIPT_DIR / "config.json"
|
CONFIG_FILE = shared.SCRIPT_DIR / "config.json"
|
||||||
BLOCKLIST_DIR = shared.SCRIPT_DIR / "blocklists"
|
|
||||||
NETWORKD_DIR = Path("/etc/systemd/network")
|
NETWORKD_DIR = Path("/etc/systemd/network")
|
||||||
WG_DIR = Path("/etc/wireguard")
|
WG_DIR = Path("/etc/wireguard")
|
||||||
RESOLV_CONF = Path("/etc/resolv.conf")
|
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"
|
MAINT_TIMER_NAME = f"{shared.PRODUCT_NAME}-maintenance"
|
||||||
DASHB_QUEUE_FILE = shared.SCRIPT_DIR / ".dashboard-queue"
|
DASHB_QUEUE_FILE = shared.SCRIPT_DIR / ".dashboard-queue"
|
||||||
NAT_SERVICE_NAME = f"{shared.PRODUCT_NAME}-nat"
|
NAT_SERVICE_NAME = f"{shared.PRODUCT_NAME}-nat"
|
||||||
BLOCKLIST_STALE_SECS = 36 * 3600
|
|
||||||
DISK_WARN_PCT = 90
|
DISK_WARN_PCT = 90
|
||||||
DHCP_WARN_PCT = 90
|
DHCP_WARN_PCT = 90
|
||||||
DNS_TIMEOUT_SECS = 2
|
DNS_TIMEOUT_SECS = 2
|
||||||
|
|
@ -514,31 +512,6 @@ def check_configurations(data):
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
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 ---
|
# --- Disk space ---
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue