This commit is contained in:
Marc Brückner 2018-08-04 22:48:28 +02:00
parent 0c9e004332
commit cbface8332
2 changed files with 7 additions and 6 deletions

View File

@ -15,4 +15,4 @@ RUN pip3 install -r requirements.txt
COPY . /app
# Define entrypoint of the app
ENTRYPOINT ["python3", "-u", "extractor.py /data/acme.json /data/certs"]
ENTRYPOINT ["python3", "-u", "extractor.py"]

View File

@ -84,7 +84,7 @@ def restartContainerWithDomain(domain):
# c.restart()
def createCerts(file):
def createCerts(file, directory, flat):
# Read JSON file
data = json.loads(open(file).read())
@ -117,6 +117,7 @@ def createCerts(file):
cert = fullchain[0:start]
chain = fullchain[start:]
# Create domain directory if it doesn't exist
directory = 'certs/' + name + '/'
try:
@ -193,12 +194,12 @@ if __name__ == "__main__":
help='outputs all certificates into one folder')
args = parser.parse_args()
print('DEBUG: watching path: ' + str(args.FILE))
print('DEBUG: output path: ' + str(args.OUTPUT))
print('DEBUG: watching path: ' + str(args.certificate))
print('DEBUG: output path: ' + str(args.directory))
# Create output directories if it doesn't exist
try:
os.makedirs(args.OUTPUT)
os.makedirs(args.directory)
except OSError as error:
if error.errno != errno.EEXIST:
raise
@ -208,7 +209,7 @@ if __name__ == "__main__":
observer = Observer()
# Register the directory to watch
observer.schedule(event_handler, str(args.FILE.parent))
observer.schedule(event_handler, str(Path(args.certificate).parent))
# Main loop to watch the directory
observer.start()