Compare commits

...

3 commits

2 changed files with 11 additions and 0 deletions

View file

@ -1,2 +1,3 @@
#!/usr/bin/env python3
from nyacme.hook import main
main()

View file

@ -38,6 +38,10 @@ def main() -> None:
handler_name = config.get_handler(zone_name)
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':
handler.create(short_record_name, args.auth)
else:
@ -54,8 +58,14 @@ def main() -> None:
except dns.resolver.NXDOMAIN:
values = []
log.info('response from DNS: %s', 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)
time.sleep(5)
log.warning('could not ensure the DNS record was created!!')