From: Vladimír Čunát Date: Wed, 28 May 2025 12:35:46 +0000 (+0200) Subject: datamodel: hide /local-data/rpz/*/dry-run for now X-Git-Tag: v6.0.13~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7819f1e71d07829284601d4aee8947f1c51cb2ba;p=thirdparty%2Fknot-resolver.git datamodel: hide /local-data/rpz/*/dry-run for now While this can be practical, let's not promise this approach to configuration until it's more clear how the more general score will appear in the config. --- diff --git a/doc/user/config-local-data.rst b/doc/user/config-local-data.rst index 27f9dd202..b655b0144 100644 --- a/doc/user/config-local-data.rst +++ b/doc/user/config-local-data.rst @@ -110,6 +110,7 @@ It provides various input formats described in following subsections. [rules ] => local data applied, user: ::1, name: foo.bar.93.100.in-addr.arpa. + .. hide this for now .. option:: dry-run: Do not apply these rules. You want to combine this with ``log``. diff --git a/python/knot_resolver/datamodel/local_data_schema.py b/python/knot_resolver/datamodel/local_data_schema.py index 1373e09e3..782142ed2 100644 --- a/python/knot_resolver/datamodel/local_data_schema.py +++ b/python/knot_resolver/datamodel/local_data_schema.py @@ -71,7 +71,7 @@ class RPZSchema(ConfigSchema): watchdog: Union[Literal["auto"], bool] = "auto" tags: Optional[List[IDPattern]] = None log: Optional[List[Literal["ip", "name"]]] = None - dry_run: bool = False + #dry_run: bool = False _LAYER = Raw @@ -79,7 +79,7 @@ class RPZSchema(ConfigSchema): watchdog: bool tags: Optional[List[IDPattern]] log: Optional[List[Literal["ip", "name"]]] - dry_run: bool + #dry_run: bool def _watchdog(self, obj: Raw) -> Any: if obj.watchdog == "auto": diff --git a/python/knot_resolver/datamodel/templates/macros/local_data_macros.lua.j2 b/python/knot_resolver/datamodel/templates/macros/local_data_macros.lua.j2 index 518795dbc..e91b82685 100644 --- a/python/knot_resolver/datamodel/templates/macros/local_data_macros.lua.j2 +++ b/python/knot_resolver/datamodel/templates/macros/local_data_macros.lua.j2 @@ -71,7 +71,7 @@ assert(C.kr_rule_local_hosts('{{ file }}', {{ boolean(nodata) }}, {# .opts are complicated #} {{ id }}.opts = C.KR_RULE_OPTS_DEFAULT {% if extra is not none -%} -{% if extra.dry_run is not none and extra.dry_run -%} +{% if false and extra.dry_run is not none and extra.dry_run -%} {{ id }}.opts.score = 4 {% else %} {{ id }}.opts.score = 9