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
|
ns0 = 'ns0.yunohost.org' # Name servers
|
||||||
ns1 = 'ns1.yunohost.org'
|
ns1 = 'ns1.yunohost.org'
|
||||||
rname = 'hostmaster@yunohost.org' # Responsible person (https://tools.ietf.org/html/rfc1035#section-3.3.13)
|
rname = 'hostmaster@yunohost.org' # Responsible person (https://tools.ietf.org/html/rfc1035#section-3.3.13)
|
||||||
|
master_key= 'abcdef123456'
|
||||||
|
|
||||||
allowed_operations = {
|
allowed_operations = {
|
||||||
'.' : ['A', 'AAAA', 'TXT', 'MX'],
|
'.' : ['A', 'AAAA', 'TXT', 'MX'],
|
||||||
|
@ -28,11 +29,18 @@ from urllib import urlopen
|
||||||
|
|
||||||
lines = ['// Generated by Dynette CRON']
|
lines = ['// Generated by Dynette CRON']
|
||||||
for url in subs_urls:
|
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:
|
for domain in domains:
|
||||||
result = json.loads(str(urlopen(url +'/all/'+ domain).read()))
|
result = json.loads(str(urlopen(url +'/all/'+ domain).read()))
|
||||||
if not os.path.exists(zone_dir + domain +'.db'):
|
if not os.path.exists(zone_dir + domain +'.db'):
|
||||||
db_lines = [
|
db_lines = [
|
||||||
'$ORIGIN .',
|
'$ORIGIN .',
|
||||||
'$TTL 10 ; 10 seconds',
|
'$TTL 10 ; 10 seconds',
|
||||||
|
@ -57,6 +65,7 @@ for url in subs_urls:
|
||||||
' type master;',
|
' type master;',
|
||||||
' file "'+ zone_dir + domain +'.db"; ',
|
' file "'+ zone_dir + domain +'.db"; ',
|
||||||
' update-policy {',
|
' update-policy {',
|
||||||
|
' grant dynette. wildcard *.'+ domain +'. ANY;',
|
||||||
])
|
])
|
||||||
|
|
||||||
for entry in result:
|
for entry in result:
|
||||||
|
@ -66,7 +75,8 @@ for url in subs_urls:
|
||||||
|
|
||||||
lines.extend([
|
lines.extend([
|
||||||
' };',
|
' };',
|
||||||
'};',
|
'};'
|
||||||
|
'',
|
||||||
])
|
])
|
||||||
|
|
||||||
for entry in result:
|
for entry in result:
|
||||||
|
|
Loading…
Reference in a new issue