s-hamann / desec-dns Goto Github PK
View Code? Open in Web Editor NEWA simple deSEC.io API client
License: MIT License
A simple deSEC.io API client
License: MIT License
> ... | python desec.py --token-file /proc/self/fd/0 import-zone -f ~/backups/zones/whynothugo.nl -d whynothugo.nl
Traceback (most recent call last):
File "/home/hugo/src/github.com/s-hamann/desec-dns/desec.py", line 1280, in <module>
main()
File "/home/hugo/src/github.com/s-hamann/desec-dns/desec.py", line 1254, in main
record_list = parse_zone_file(arguments.file, arguments.domain,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hugo/src/github.com/s-hamann/desec-dns/desec.py", line 731, in parse_zone_file
parsed_zone = zone.from_file(path, origin=domain, relativize=False, check_origin=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "dns/zone.py", line 1326, in dns.zone.from_file
File "dns/zone.py", line 1327, in dns.zone.from_file
TypeError: Argument 'text' has incorrect type (expected str, got _io.TextIOWrapper)
The token scoping that's currently in the project is outdated and causes 404 responses. The old API paths doesn't seem to exist anymore.
Importing an RFC-abiding zone file with newlines causes an error.
Invalid line 2022012802 ; serial
in zone file.
In the RFC, it's stated that a record in a zone file should be in one line, except if the record data is enclosed in ()
:
From https://datatracker.ietf.org/doc/html/rfc1035
5.1. Format
[...]
( ) Parentheses are used to group data that crosses a line
boundary. In effect, line terminations are not
recognized within parentheses.
. So, for example, this is valid zone file format:
example.com. 43200 IN SOA ns1.dnsprovider.com. hostmaster.dnsprovider.com. (
2022012802 ; serial
14400 ; refresh (4 hours)
3600 ; retry (1 hour)
2419000 ; expire (3 weeks 6 days 23 hours 56 minutes 40 seconds)
43200 ; minimum (12 hours)
)
43200 RRSIG SOA 8 2 43200 (
20220227064000 20220128064000 16839 example.com.
01234567890abcdef01234567890abcdef01234567890abcdef01234567890abcdef
01234567890abcdef01234567890abcdef01234567890abcdef01234567890abcdef
== )
However, desec.py expects everything on one line, causing failure here aleady on line 2.
Also, from looking at the code, it looks like comments that don't start at the beginning of the line (as in the example above) are not handled correctly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.