Skip to content

Commit

Permalink
change label
Browse files Browse the repository at this point in the history
  • Loading branch information
raph2i committed Mar 22, 2020
1 parent 7c4a9ac commit 412e5da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def __call__(self, string):

def restartContainerWithDomains(domains):
client = docker.from_env()
container = client.containers.list(filters = {"label" : "com.github.SnowMB.traefik-certificate-extractor.restart_domain"})
container = client.containers.list(filters = {"label" : "traefik-certificate-extractor.restart_domain"})
for c in container:
restartDomains = str.split(c.labels["com.github.SnowMB.traefik-certificate-extractor.restart_domain"], ',')
restartDomains = str.split(c.labels["traefik-certificate-extractor.restart_domain"], ',')
if not set(domains).isdisjoint(restartDomains):
print('restarting container ' + c.id)
if not args.dry:
Expand Down Expand Up @@ -210,14 +210,14 @@ def doTheWork(self):
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='Extract traefik letsencrypt certificates.')
parser.add_argument('-c', '--certificate', default='acme.json', type=PathType(
parser.add_argument('-c', '--certificate', default='/data/acme.json', type=PathType(
exists=True), help='file that contains the traefik certificates (default acme.json)')
parser.add_argument('-d', '--directory', default='.',
type=PathType(type='dir'), help='output folder')
parser.add_argument('-f', '--flat', action='store_true',
help='outputs all certificates into one folder')
parser.add_argument('-r', '--restart_container', action='store_true',
help="uses the docker API to restart containers that are labeled with 'com.github.SnowMB.traefik-certificate-extractor.restart_domain=<DOMAIN>' if the domain name of a generated certificates matches. Multiple domains can be seperated by ','")
help="uses the docker API to restart containers that are labeled with 'traefik-certificate-extractor.restart_domain=<DOMAIN>' if the domain name of a generated certificates matches. Multiple domains can be seperated by ','")
parser.add_argument('--dry-run', action='store_true', dest='dry',
help="Don't write files and do not start docker containers.")
group = parser.add_mutually_exclusive_group()
Expand Down

0 comments on commit 412e5da

Please sign in to comment.