From d6c80b40159eac4d2d5b5a43f69eb84bde302fcb Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Sat, 16 Mar 2024 07:28:36 +0100 Subject: [PATCH] fix: i still have no idea how python modules work --- hook_launcher.py | 2 ++ nyacme/__main__.py | 4 ++-- nyacme/hook.py | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100755 hook_launcher.py mode change 100755 => 100644 nyacme/__main__.py mode change 100755 => 100644 nyacme/hook.py 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)