diff --git a/hook_launcher.py b/hook_launcher.py new file mode 100755 index 0000000..ff059f2 --- /dev/null +++ b/hook_launcher.py @@ -0,0 +1,2 @@ +from nyacme.hook import main +main() diff --git a/nyacme/__main__.py b/nyacme/__main__.py old mode 100755 new mode 100644 index e970ebf..29ab526 --- a/nyacme/__main__.py +++ b/nyacme/__main__.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 import argparse import os.path import subprocess @@ -48,7 +47,8 @@ def main() -> None: hook_path = shutil.which('nyacme-hook') if not hook_path: - hook_path = os.path.join(os.path.dirname(__file__), 'hook.py') + log.warning('setting hook path to hook launcher from git repo') + hook_path = os.path.join(os.path.dirname(__file__), '..', 'hook_launcher.py') res = subprocess.run([ 'uacme', '-v', diff --git a/nyacme/hook.py b/nyacme/hook.py old mode 100755 new mode 100644 index fc0db57..b676525 --- a/nyacme/hook.py +++ b/nyacme/hook.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 import argparse import logging from itertools import chain @@ -37,7 +36,7 @@ def main() -> None: short_record_name = record_name.replace('.' + zone_name, '') handler_name = config.get_handler(zone_name) - handler = handlers[handler_name](zone_name, config, token) + handler = handlers[handler_name](zone_name, config, args.token) if args.method == 'begin': handler.create(short_record_name, args.auth)