Compare commits
3 commits
d6c80b4015
...
312f63d06b
Author | SHA1 | Date | |
---|---|---|---|
312f63d06b | |||
e3a61d3eb6 | |||
dfb239346b |
2 changed files with 11 additions and 0 deletions
|
@ -1,2 +1,3 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
from nyacme.hook import main
|
from nyacme.hook import main
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -38,6 +38,10 @@ def main() -> None:
|
||||||
handler_name = config.get_handler(zone_name)
|
handler_name = config.get_handler(zone_name)
|
||||||
handler = handlers[handler_name](zone_name, config, args.token)
|
handler = handlers[handler_name](zone_name, config, args.token)
|
||||||
|
|
||||||
|
if (args.type == 'dns-01') == (handler_name == 'http'):
|
||||||
|
log.error('wrong handler for type, try again')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if args.method == 'begin':
|
if args.method == 'begin':
|
||||||
handler.create(short_record_name, args.auth)
|
handler.create(short_record_name, args.auth)
|
||||||
else:
|
else:
|
||||||
|
@ -54,8 +58,14 @@ def main() -> None:
|
||||||
except dns.resolver.NXDOMAIN:
|
except dns.resolver.NXDOMAIN:
|
||||||
values = []
|
values = []
|
||||||
log.info('response from DNS: %s', values)
|
log.info('response from DNS: %s', values)
|
||||||
|
|
||||||
if (args.method == 'begin') == (args.auth in values):
|
if (args.method == 'begin') == (args.auth in values):
|
||||||
|
if args.method == 'begin':
|
||||||
|
# success, but have to wait
|
||||||
|
# because let's encrypt dns is ??? slow
|
||||||
|
time.sleep(10)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
log.warning('could not ensure the DNS record was created!!')
|
log.warning('could not ensure the DNS record was created!!')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue