mirror of
https://github.com/YunoHost/dynette.git
synced 2024-09-03 20:06:17 +02:00
[enh] Add dynette. key to Bind configuration.
This commit is contained in:
parent
15776034c1
commit
87051e96e3
1 changed files with 13 additions and 3 deletions
|
@ -8,6 +8,7 @@ subs_urls = ['http://dyndns.yunohost.org'] # 127.0.0.1 if you install subscribe
|
|||
ns0 = 'ns0.yunohost.org' # Name servers
|
||||
ns1 = 'ns1.yunohost.org'
|
||||
rname = 'hostmaster@yunohost.org' # Responsible person (https://tools.ietf.org/html/rfc1035#section-3.3.13)
|
||||
master_key= 'abcdef123456'
|
||||
|
||||
allowed_operations = {
|
||||
'.' : ['A', 'AAAA', 'TXT', 'MX'],
|
||||
|
@ -28,8 +29,15 @@ from urllib import urlopen
|
|||
|
||||
lines = ['// Generated by Dynette CRON']
|
||||
for url in subs_urls:
|
||||
domains = json.loads(str(urlopen(url +'/domains').read()))
|
||||
|
||||
lines.extend([
|
||||
'key dynette. {',
|
||||
' algorithm hmac-md5;',
|
||||
' secret "'+ master_key +'";',
|
||||
'};',
|
||||
])
|
||||
|
||||
domains = json.loads(str(urlopen(url +'/domains').read()))
|
||||
for domain in domains:
|
||||
result = json.loads(str(urlopen(url +'/all/'+ domain).read()))
|
||||
if not os.path.exists(zone_dir + domain +'.db'):
|
||||
|
@ -57,6 +65,7 @@ for url in subs_urls:
|
|||
' type master;',
|
||||
' file "'+ zone_dir + domain +'.db"; ',
|
||||
' update-policy {',
|
||||
' grant dynette. wildcard *.'+ domain +'. ANY;',
|
||||
])
|
||||
|
||||
for entry in result:
|
||||
|
@ -66,7 +75,8 @@ for url in subs_urls:
|
|||
|
||||
lines.extend([
|
||||
' };',
|
||||
'};',
|
||||
'};'
|
||||
'',
|
||||
])
|
||||
|
||||
for entry in result:
|
||||
|
|
Loading…
Reference in a new issue