mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Fix error in python script extracting certs from the acme.json file if there are sections with null values as certs
Signed-off-by: Brandon Schmitt <Brandon.Schmitt@live.de>
This commit is contained in:
parent
ec290acd1f
commit
6251f898ea
|
@ -56,11 +56,12 @@ import sys,json
|
||||||
acme = json.load(sys.stdin)
|
acme = json.load(sys.stdin)
|
||||||
for key, value in acme.items():
|
for key, value in acme.items():
|
||||||
certs = value['Certificates']
|
certs = value['Certificates']
|
||||||
for cert in certs:
|
if certs is not None:
|
||||||
if 'domain' in cert and 'key' in cert:
|
for cert in certs:
|
||||||
if 'main' in cert['domain'] and cert['domain']['main'] == '${1}' or 'sans' in cert['domain'] and '${1}' in cert['domain']['sans']:
|
if 'domain' in cert and 'key' in cert:
|
||||||
print cert['key']
|
if 'main' in cert['domain'] and cert['domain']['main'] == '${1}' or 'sans' in cert['domain'] and '${1}' in cert['domain']['sans']:
|
||||||
break
|
print cert['key']
|
||||||
|
break
|
||||||
")
|
")
|
||||||
|
|
||||||
local CERT
|
local CERT
|
||||||
|
@ -70,11 +71,12 @@ import sys,json
|
||||||
acme = json.load(sys.stdin)
|
acme = json.load(sys.stdin)
|
||||||
for key, value in acme.items():
|
for key, value in acme.items():
|
||||||
certs = value['Certificates']
|
certs = value['Certificates']
|
||||||
for cert in certs:
|
if certs is not None:
|
||||||
if 'domain' in cert and 'certificate' in cert:
|
for cert in certs:
|
||||||
if 'main' in cert['domain'] and cert['domain']['main'] == '${1}' or 'sans' in cert['domain'] and '${1}' in cert['domain']['sans']:
|
if 'domain' in cert and 'certificate' in cert:
|
||||||
print cert['certificate']
|
if 'main' in cert['domain'] and cert['domain']['main'] == '${1}' or 'sans' in cert['domain'] and '${1}' in cert['domain']['sans']:
|
||||||
break
|
print cert['certificate']
|
||||||
|
break
|
||||||
")
|
")
|
||||||
|
|
||||||
if [[ -n "${KEY}${CERT}" ]]
|
if [[ -n "${KEY}${CERT}" ]]
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
{
|
{
|
||||||
|
"empty": {
|
||||||
|
"Account": null,
|
||||||
|
"Certificates": null
|
||||||
|
},
|
||||||
"le": {
|
"le": {
|
||||||
"Account": {
|
"Account": {
|
||||||
"Email": "acme@admin.com",
|
"Email": "acme@admin.com",
|
||||||
|
|
Loading…
Reference in a new issue