resolvers-yang issueshttps://gitlab.nic.cz/labs/resolvers-yang/-/issues2018-12-19T14:07:45+01:00https://gitlab.nic.cz/labs/resolvers-yang/-/issues/8`Converter.parse_line` doesn't remove remove trailing whitespace before comments2018-12-19T14:07:45+01:00Štěpán Balážik`Converter.parse_line` doesn't remove remove trailing whitespace before commentsFor example:
`Converter.parse_line(" stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.`)`
leads to:
`Converter._check_ipaddress("193.0.14.129 ")`
which fails for obvious reasons.
In general, it is really hard to work with all the rege...For example:
`Converter.parse_line(" stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.`)`
leads to:
`Converter._check_ipaddress("193.0.14.129 ")`
which fails for obvious reasons.
In general, it is really hard to work with all the regexes and corner cases of parsing a configuration file with parser written from scratch. I dare to guess the most of real-life `unbound.conf` files would not pass `converter.py` in the current state.Aleš MrázekAleš Mrázekhttps://gitlab.nic.cz/labs/resolvers-yang/-/issues/4Add missing fields from unbound.conf we need in Deckard2018-12-19T14:07:45+01:00Štěpán BalážikAdd missing fields from unbound.conf we need in Deckard`converter_new.py` currently does not support some options from unbound.conf:
There are namely (with respective paragraphs from `man unbound.conf`):
* [x] `trust-anchor`
```
trust-anchor: <"Resource Record">
A DS or DNSK...`converter_new.py` currently does not support some options from unbound.conf:
There are namely (with respective paragraphs from `man unbound.conf`):
* [x] `trust-anchor`
```
trust-anchor: <"Resource Record">
A DS or DNSKEY RR for a key to use for validation. Multiple entries can be given to
specify multiple trusted keys, in addition to the trust-anchor-files. The resource
record is entered in the same format as 'dig' or 'drill' prints them, the same format as
in the zone file. Has to be on a single line, with "" around it. A TTL can be specified
for ease of cut and paste, but is ignored. A class can be specified, but class IN is
default.
```
* [x] `val-override-date`
```
val-override-date: <rrsig-style date spec>
Default is "" or "0", which disables this debugging feature. If enabled by giving a
RRSIG style date, that date is used for verifying RRSIG inception and expiration dates,
instead of the current date. Do not set this unless you are debugging signature incep‐
tion and expiration. The value -1 ignores the date altogether, useful for some special
applications.
```
* [x] `do-not-query-localhost`
```
do-not-query-localhost: <yes or no>
If yes, localhost is added to the do-not-query-address entries, both IP6 ::1 and IP4
127.0.0.1/8. If no, then localhost can be used to send queries to. Default is yes.
```
* [x] `harden-glue`
```
harden-glue: <yes or no>
Will trust glue only if it is within the servers authority. Default is on.
```
I am not sure that this list is conclusive. I might add more later.https://gitlab.nic.cz/labs/resolvers-yang/-/issues/7`Converter._ignore_comments` fails on commented lines with two or more `;` or...2018-12-11T09:02:05+01:00Štěpán Balážik`Converter._ignore_comments` fails on commented lines with two or more `;` or `#`In `converter.py` if for example `Converter._ignore_comments(";some string with two ; (semilocons)")` is called the converter crashes with `ValueError: too many values to unpack (expected 2)`.
This is a easy fix since `str.split` provid...In `converter.py` if for example `Converter._ignore_comments(";some string with two ; (semilocons)")` is called the converter crashes with `ValueError: too many values to unpack (expected 2)`.
This is a easy fix since `str.split` provides a `maxsplit` argument.Štěpán BalážikŠtěpán Balážikhttps://gitlab.nic.cz/labs/resolvers-yang/-/issues/2Support comments in `converter_new.py`2018-11-05T12:29:45+01:00Štěpán BalážikSupport comments in `converter_new.py`Comments at the end of lines currently break `converter_new.py`.
For example this line
```stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.```
won't parse.
I think we should support both `#` and `;`. That would make our lives a lot easi...Comments at the end of lines currently break `converter_new.py`.
For example this line
```stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.```
won't parse.
I think we should support both `#` and `;`. That would make our lives a lot easier in Deckard. :)Aleš MrázekAleš Mrázekhttps://gitlab.nic.cz/labs/resolvers-yang/-/issues/5`converter.Converter.domain` doesn't match domains with trailing dot2018-11-05T12:29:45+01:00Štěpán Balážik`converter.Converter.domain` doesn't match domains with trailing dotThis is important (especially) for matching `.` (root).
Example:
```
>>> from converter import Converter
>>> print(Converter.domain.match("."))
None
>>> print(Converter.domain.match("nic.cz."))
None
>>> print(Converter.domain.match("ni...This is important (especially) for matching `.` (root).
Example:
```
>>> from converter import Converter
>>> print(Converter.domain.match("."))
None
>>> print(Converter.domain.match("nic.cz."))
None
>>> print(Converter.domain.match("nic.cz"))
<_sre.SRE_Match object; span=(0, 6), match='nic.cz'>
```https://gitlab.nic.cz/labs/resolvers-yang/-/issues/6`converter.Converter.ipv6_prefix` does not match `fe80::21b:aabb:0:0`2018-11-05T12:14:42+01:00Štěpán Balážik`converter.Converter.ipv6_prefix` does not match `fe80::21b:aabb:0:0`Actually I wasn't able to come up with a prefix that would match the regular expression in question.
Example:
```
>>> import converter
>>> print(converter.Converter.ipv6_prefix.match("fe80::21b:aabb:0:0"))
None
>>> print(converter.Conve...Actually I wasn't able to come up with a prefix that would match the regular expression in question.
Example:
```
>>> import converter
>>> print(converter.Converter.ipv6_prefix.match("fe80::21b:aabb:0:0"))
None
>>> print(converter.Converter.ipv6_prefix.match("2001:0db8"))
None
```https://gitlab.nic.cz/labs/resolvers-yang/-/issues/3Support IPv6 in `converter_new.py`2018-10-31T13:08:46+01:00Štěpán BalážikSupport IPv6 in `converter_new.py````stub-addr: 2001:503:ba3e::2:30```
breaks the parser.
I think IPv6 is not currently supported at all.```stub-addr: 2001:503:ba3e::2:30```
breaks the parser.
I think IPv6 is not currently supported at all.https://gitlab.nic.cz/labs/resolvers-yang/-/issues/1Rewrite `converter.py` with a parser using Augeas2018-10-03T10:02:11+02:00Štěpán BalážikRewrite `converter.py` with a parser using AugeasWe are using a configuration editing tool `augeas` in Deckard (for parsing rpl files) which provides the machinery to programatically read, create and create configuration files without the need for regex spaghetti. (http://augeas.net/)
...We are using a configuration editing tool `augeas` in Deckard (for parsing rpl files) which provides the machinery to programatically read, create and create configuration files without the need for regex spaghetti. (http://augeas.net/)
Since `unbound.conf` structure seems pretty simple so I could write a `lens` (basically a regular grammar with some thing added for a possibility of two way conversion between a AST and plaintext). (This was actually suggested in Augeas' issue tracker https://github.com/hercules-team/augeas/issues/162).
The code would end up much nicer and sustainable since all the regex shenanigans would be neatly packed outside of the Python code.