From fec384f6e7063e5a085691cfc8c80c9e8cc0dac0 Mon Sep 17 00:00:00 2001 From: Daniel Huisman Date: Tue, 24 Apr 2018 16:24:34 +0200 Subject: [PATCH] Start implementing CLI --- extractor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extractor.py b/extractor.py index 3779633..335ca71 100644 --- a/extractor.py +++ b/extractor.py @@ -3,6 +3,7 @@ import os import errno import time import json +import argparse from base64 import b64decode from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler @@ -75,6 +76,8 @@ class Handler(FileSystemEventHandler): print('Extracted certificate for: ' + c['Domains']['Main'] + (', ' + ', '.join(c['Domains']['SANs']) if c['Domains']['SANs'] else '')) if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Tool to extract Let\'s Encrypt certificates from Traefik\'s ACME storage file.') + # Determine path to watch path = sys.argv[1] if len(sys.argv) > 1 else './data'