Petr Špaček [Mon, 4 Jul 2022 10:33:04 +0000 (12:33 +0200)]
Parse and render rst syntax in :short: statement descriptions in tables
Without this change tables generated by .. namedconf:statementlist::
contained raw text and displayed rst syntax to users.
The raw docutil node returned by rst parser can contain unresolved
references (pending_xref nodes). We just store those nodes and let
Sphinx to resolve them later on.
Beware: This would not work if we injected nodes in later stages of
processing. All unresolved references must be in place before
'doctree-resolved' event is emitted (i.e. before resolve_references() is
called inside Sphinx).
Petr Špaček [Mon, 4 Jul 2022 09:30:33 +0000 (11:30 +0200)]
Generate tables of statements in doctree-read phase
This change allows us to generate "unresolved" references and let Sphinx
deal with dereferencing them in later stages. It is not useful by itself
but it serves as preparation for the next commit.
Petr Špaček [Mon, 4 Jul 2022 09:01:17 +0000 (11:01 +0200)]
Optimize resolve_xref to avoid O(n^2) iteration
Formerly resolve_xref() in Sphinx extension called get_objects() from
Sphinx API which subsequently iterated the whole list of objects,
causing single iteration per single reference, which is essentially.
O(n^2). Avoid using get_objects() and access internal dictionary
directly intead.
The docs build time was still dominated by other factors but speedup is
about 10 % on my machine.
Mark Andrews [Mon, 4 Jul 2022 03:32:01 +0000 (13:32 +1000)]
Fix for GitLab 15.0: cobertura replaced by coverage_report
From Gitlab 15.0 release notes:
artifacts:reports:cobertura keyword
As of GitLab 15.0, the artifacts:reports:cobertura keyword has
been replaced by artifacts:reports:coverage_report. Cobertura
is the only supported report file, but this is the first step
towards GitLab supporting other report types.
Petr Špaček [Thu, 30 Jun 2022 12:20:17 +0000 (14:20 +0200)]
Add link anchor and hyperlinks to keys statement
This is super confusing because statement "keys" exists in context
controls and server blocks where it refers to symmetric TSIG key, and it
_also_ exists in dnssec-policy block where it specifies public-private
key pair parameters.
In an (unsuccessful) attempt to disambiguate these two I added bunch of
hyperlinks and a warning.
Petr Špaček [Fri, 24 Jun 2022 13:17:22 +0000 (15:17 +0200)]
Sort grammar map keys while pretty printing them
It would be too easy if we could just call sorted(). Thanks to zone
grammar the most important key "type" gets sorted near end, so we pull
it up to the top using a hack.
Petr Špaček [Fri, 24 Jun 2022 13:05:02 +0000 (15:05 +0200)]
Pretty-print grammar for zones
It turns out the tree of dictionaries is not the best structure to
represent our grammar, unfortunatelly. The problem is that "zone" has
several context-dependent variants which change meaning of "zone" based
on inner field "type".
Redesigning the whole structure does not seem to be worth, so I settled
on this terrible hack.
Petr Špaček [Mon, 9 May 2022 16:04:40 +0000 (18:04 +0200)]
Add utility to search for context-dependent configuration statements
The utility detects statements which use the same name (e.g.
max-zone-ttl) but use different grammar in different contexts. These
typically need special case in docs.
Petr Špaček [Wed, 11 May 2022 07:20:51 +0000 (09:20 +0200)]
Un-format grammar files in doc/misc
The next commit is going to add parser for ISC configuration format.
To simplify the parser the grammar files in doc/misc are no longer
line-wrapped as handling it would make the grammar parser unnecessairly
complicated.
This affects visible output in the ARM, but in the end we are going to
replace the auto-generated .rst files with grammar pretty printed, so
formatting of these files does not matter in practical terms.
Michał Kępień [Thu, 30 Jun 2022 13:24:08 +0000 (15:24 +0200)]
Obsolete the "glue-cache" option
The "glue-cache" option was marked as deprecated by commit 5ae33351f286feb25a965bf3c9e6b122ab495342 (first released in BIND 9.17.6,
back in October 2020), so now obsolete that option, removing all code
and documentation related to it.
Note: this causes the glue cache feature to be permanently enabled, not
disabled.
Artem Boldariev [Wed, 22 Jun 2022 11:52:58 +0000 (14:52 +0300)]
Store HTTP quota size inside a listenlist instead of the quota
This way only quota size is passed to the interface/listener
management code instead of a quota object. Thus, we can implement
updating the quota object size instead of recreating the object.
Matthijs Mekking [Fri, 24 Jun 2022 07:22:38 +0000 (09:22 +0200)]
Also inherit from "default" for "insecure" policy
Remove the duplication from the defaultconf and inherit the values
not set in the "insecure" policy from the "default" policy. Therefore,
we must insist that the first read built-in policy is the default one.
Matthijs Mekking [Tue, 21 Jun 2022 10:40:12 +0000 (12:40 +0200)]
When loading dnssec-policies, inherit from default
Most of the settings (durations) are already inheriting from the default
because they use the constants from lib/dns/kasp.h. We need them as
constants so we can use them in named-checkconf to verify the policy
parameters.
The NSEC(3) parameters and keys should come from the actual default
policy. Change the call to cfg_kasp_fromconfig() to include the default
kasp. We also no longer need to corner case where config is NULL we load
the built-in policy: the built-in policies are now loaded when config is
set to named_g_config.
Finally, add a debug log (it is useful to see which policies are being
loaded).
Matthijs Mekking [Tue, 21 Jun 2022 10:31:05 +0000 (12:31 +0200)]
Store built-in dnssec-policies in defaultconf
Update the defaultconf with the built-in policies. These will now be
printed with "named -C".
Change the defines in kasp.h to be strings, so they can be concatenated
in the defaultconf. This means when creating a kasp structure, we no
longer initialize the defaults (this is fine because only kaspconf.c
uses dns_kasp_create() and it inherits from the default policy).
In kaspconf.c, the default values now need to be parsed from string.
Introduce some variables so we don't need to do get_duration multiple
times on the same configuration option.
Finally, clang-format-14 decided to do some random formatting changes.
Petr Špaček [Fri, 17 Jun 2022 12:42:32 +0000 (14:42 +0200)]
Remove ambiguous link anchors for logging { file } statement
Unfortunatelly logging and zone blocks use file statements with
different semantics but the same name.
There is no sane way to disambiguate them in text, so let's remove the
link anchor from logging so we can link to the file statement in zone.
My assumption is that linking to logging { file } is very unlikely
because logging is self-contained in one block but zone config is all
over the place.
Petr Špaček [Fri, 17 Jun 2022 12:33:26 +0000 (14:33 +0200)]
Remove ambiguous link anchors for keys statement
Unfortunatelly dnssec-policy and servers blocks use keys statements with
a totally different grammar and semantics but the same name.
There is no sane way to disambiguate them in text, so let's remove the
link anchors to prevent errorneous linking.
Petr Špaček [Fri, 17 Jun 2022 12:27:16 +0000 (14:27 +0200)]
Change statement->argument terminology for control channel
control { inet ... allow keys read-only }; are not actual statements
but in fact arguments of a statement. Remove .. namedconf:statement::
syntax to avoid collisions with other statements of the same name.