...
 
Commits (48)
[submodule "re2oapi"]
path = re2oapi
url = https://gitlab.federez.net/re2o/re2oapi.git
url = https://gitlab.crans.org/nounous/re2o-re2oapi.git
......@@ -6,4 +6,10 @@ This service uses Re2o API to generate DNS zone files
## Requirements
* python3
* knot
* requirements in https://gitlab.federez.net/re2o/re2oapi
## Scripts
* `main.py`: Generates the zone files and reloads the zones
* `dnssec_generate.py`: Generate the DS records for the zones in `dnssec_domains.json` and writes them to `dnssec.json`
import subprocess
def get_ds(zone, verbose=False):
if verbose:
print("Getting CDS of %s:" % (zone,))
print("/usr/sbin/knotc zone-read %s @ CDS" % (zone,))
try:
cdss = subprocess.check_output(['/usr/sbin/knotc', 'zone-read', zone, '@', 'CDS'])[:-1].decode('utf-8').split('\n')
except subprocess.CalledProcessError:
return []
dss = []
if verbose:
print("CDS of %s = %s" % (zone, cdss))
for cds in cdss:
ds = {}
try:
cds = cds.split(' ')
ds['subzone'] = cds[1]
ds['id'] = cds[4]
ds['algo'] = cds[5]
ds['type'] = cds[6]
ds['fp'] = cds[7]
except:
if verbose:
print('Unable to find ksk for', zone)
continue
ds['ttl'] = 172800
if verbose:
print("DS record of %s : %s" % (zone, ds))
print("\n\n")
dss.append(ds)
return dss
This diff is collapsed.
Subproject commit 5b4523c797bffb90c998d5b424548756baa0c1d2
Subproject commit 6565b92f3bfc13d02b95888ae021f5bd6f7ef317