1
0
mirror of https://github.com/moepman/acertmgr.git synced 2024-12-29 09:21:51 +01:00

fix broken references from move and add legacy run script

This commit is contained in:
Kishi85 2019-02-20 11:49:30 +01:00
parent f1f2d5c7cd
commit 5d8b0134ea
8 changed files with 24 additions and 14 deletions

11
acertmgr.py Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# acertmgr compatibility script for legacy installations
# Copyright (c) Rudolf Mayerhofer, 2019.
# available under the ISC license, see LICENSE
import acertmgr
if __name__ == "__main__":
acertmgr.main()

View File

@ -16,8 +16,7 @@ import stat
import subprocess import subprocess
import tempfile import tempfile
import configuration from acertmgr import configuration, tools
import tools
# @brief check whether existing target file is still valid or source crt has been updated # @brief check whether existing target file is still valid or source crt has been updated
@ -46,7 +45,7 @@ def create_authority(settings):
tools.new_rsa_key(acc_file) tools.new_rsa_key(acc_file)
acc_key = tools.read_key(acc_file) acc_key = tools.read_key(acc_file)
authority_module = importlib.import_module("authority.{0}".format(api)) authority_module = importlib.import_module("acertmgr.authority.{0}".format(api))
authority_class = getattr(authority_module, "ACMEAuthority") authority_class = getattr(authority_module, "ACMEAuthority")
return authority_class(settings.get('authority'), acc_key) return authority_class(settings.get('authority'), acc_key)
@ -59,7 +58,7 @@ def create_challenge_handler(settings):
else: else:
mode = "standalone" mode = "standalone"
handler_module = importlib.import_module("modes.{0}".format(mode)) handler_module = importlib.import_module("acertmgr.modes.{0}".format(mode))
handler_class = getattr(handler_module, "ChallengeHandler") handler_class = getattr(handler_module, "ChallengeHandler")
return handler_class(settings) return handler_class(settings)
@ -162,7 +161,7 @@ def cert_put(settings):
return crt_action return crt_action
if __name__ == "__main__": def main():
# load config # load config
configs = configuration.load() configs = configuration.load()

View File

@ -17,15 +17,15 @@ from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import padding from cryptography.hazmat.primitives.asymmetric import padding
import tools from acertmgr import tools
from tools import byte_string_format from acertmgr.tools import byte_string_format
try: try:
from urllib.request import urlopen # Python 3 from urllib.request import urlopen # Python 3
except ImportError: except ImportError:
from urllib2 import urlopen # Python 2 from urllib2 import urlopen # Python 2
from authority.acme import ACMEAuthority as AbstractACMEAuthority from acertmgr.authority.acme import ACMEAuthority as AbstractACMEAuthority
class ACMEAuthority(AbstractACMEAuthority): class ACMEAuthority(AbstractACMEAuthority):

View File

@ -10,7 +10,7 @@ import copy
import io import io
import os import os
import tools from acertmgr import tools
ACME_DIR = "/etc/acme" ACME_DIR = "/etc/acme"
ACME_CONF = os.path.join(ACME_DIR, "acme.conf") ACME_CONF = os.path.join(ACME_DIR, "acme.conf")

View File

@ -12,8 +12,8 @@ import dns.update
from cryptography.hazmat.backends import default_backend from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives import hashes
import tools from acertmgr import tools
from modes.abstract import AbstractChallengeHandler from acertmgr.modes.abstract import AbstractChallengeHandler
class DNSChallengeHandler(AbstractChallengeHandler): class DNSChallengeHandler(AbstractChallengeHandler):

View File

@ -17,7 +17,7 @@ import dns.resolver
import dns.tsigkeyring import dns.tsigkeyring
import dns.update import dns.update
from modes.dns.abstract import DNSChallengeHandler from acertmgr.modes.dns.abstract import DNSChallengeHandler
DEFAULT_KEY_ALGORITHM = "HMAC-MD5.SIG-ALG.REG.INT" DEFAULT_KEY_ALGORITHM = "HMAC-MD5.SIG-ALG.REG.INT"

View File

@ -19,7 +19,7 @@ except ImportError:
import os import os
import threading import threading
from modes.webdir import ChallengeHandler as WebChallengeHandler from acertmgr.modes.webdir import ChallengeHandler as WebChallengeHandler
# @brief custom request handler for ACME challenges # @brief custom request handler for ACME challenges

View File

@ -8,7 +8,7 @@
import datetime import datetime
import os import os
from modes.abstract import AbstractChallengeHandler from acertmgr.modes.abstract import AbstractChallengeHandler
try: try:
from urllib.request import urlopen # Python 3 from urllib.request import urlopen # Python 3