mirror of
https://github.com/SnowMB/traefik-certificate-extractor.git
synced 2025-01-18 22:09:33 +08:00
bugfixes
This commit is contained in:
parent
890df35826
commit
3cb95ccf5f
@ -81,7 +81,7 @@ def restartContainerWithDomains(domains):
|
|||||||
restartDomains = str.split(c.labels["com.github.SnowMB.traefik-certificate-extractor.restart_domain"], ',')
|
restartDomains = str.split(c.labels["com.github.SnowMB.traefik-certificate-extractor.restart_domain"], ',')
|
||||||
if not set(domains).isdisjoint(restartDomains):
|
if not set(domains).isdisjoint(restartDomains):
|
||||||
print('restarting container ' + c.id)
|
print('restarting container ' + c.id)
|
||||||
# c.restart()
|
c.restart()
|
||||||
|
|
||||||
|
|
||||||
def createCerts(args):
|
def createCerts(args):
|
||||||
@ -111,8 +111,8 @@ def createCerts(args):
|
|||||||
privatekey = c['Key']
|
privatekey = c['Key']
|
||||||
fullchain = c['Certificate']
|
fullchain = c['Certificate']
|
||||||
sans = c['Domain']['SANs']
|
sans = c['Domain']['SANs']
|
||||||
|
|
||||||
if (len(args.include)>0 and name not in args.include) or (len(args.exclude)>0 and name in args.exclude):
|
if (args.include and name not in args.include) or (args.exclude and name in args.exclude):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Decode private key, certificate and chain
|
# Decode private key, certificate and chain
|
||||||
@ -145,7 +145,7 @@ def createCerts(args):
|
|||||||
with (directory / name + '.chain.pem').open('w') as f:
|
with (directory / name + '.chain.pem').open('w') as f:
|
||||||
f.write(chain)
|
f.write(chain)
|
||||||
else:
|
else:
|
||||||
directory = args.directory / name
|
directory = directory / name
|
||||||
if not directory.exists():
|
if not directory.exists():
|
||||||
directory.mkdir()
|
directory.mkdir()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user