From 89306b132d37821e0759fc87bfef6aea27c6e370 Mon Sep 17 00:00:00 2001 From: Matthew Grotke Date: Tue, 9 Jun 2026 00:35:41 -0400 Subject: [PATCH] Development --- routlin/mod_validation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routlin/mod_validation.py b/routlin/mod_validation.py index 36c775b..d1f0652 100644 --- a/routlin/mod_validation.py +++ b/routlin/mod_validation.py @@ -502,11 +502,11 @@ def validate_config(data): for idx, bl in enumerate(data.get("dns_blocking", {}).get("blocklists", [])): name = bl.get("name", "") label = f"dns_blocking.blocklists[{idx}] '{name}'" - for field in ("name", "description", "save_as", "url", "format"): + bl_type = bl.get("bl_type", "community") + required = ("name", "description", "save_as") + (() if bl_type == "local" else ("url",)) + for field in required: if not bl.get(field): errors.append(f"{label}: missing or empty field '{field}'.") - if bl.get("format") and bl["format"] not in VALID_BLOCKLIST_FORMATS: - errors.append(f"{label}: format must be one of: {', '.join(sorted(VALID_BLOCKLIST_FORMATS))}.") if name: err = check_blocklist_name_unique( data.get("dns_blocking", {}).get("blocklists", []), name, exclude_idx=idx