fix: extractCertsFromAcmeJson fails if "sans" not in Certificates.domain.main#1574
Merged
erik-wramner merged 2 commits intodocker-mailserver:masterfrom Jul 21, 2020
martinwepner:fix/traefik-acme-parser
Merged
fix: extractCertsFromAcmeJson fails if "sans" not in Certificates.domain.main#1574erik-wramner merged 2 commits intodocker-mailserver:masterfrom martinwepner:fix/traefik-acme-parser
erik-wramner merged 2 commits intodocker-mailserver:masterfrom
martinwepner:fix/traefik-acme-parser
Conversation
martinwepner
commented
Jul 19, 2020
| KEY=$(cat /etc/letsencrypt/acme.json | python -c " | ||
| import sys,json | ||
| acme = json.load(sys.stdin) | ||
| for key, value in acme.items(): |
Contributor
Author
There was a problem hiding this comment.
could probably just iterate over acme.values() here instead...
Contributor
|
I'm also not an python expert myself so thanks for improving my crappy code :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@MichaelSp made a great PR #1553 supporting acme.json from traefik.
However, if
acme.json'sCertificates[x].domain.sans === undefinedpython will crash and the keys won't be added to/etc/letsencrypt/live/"$HOSTNAME"/key|fullchain.pem.In my case this (
sans === undefined) is true for all my certificates inacme.json; I just have themain-entry.My logs when I start
docker-mailserver:tbh I am not really into python and I don't get everything what's going on in @MichaelSp python code. I did therefore rewrite it to my understanding (but maybe this is dumb because my lack of python-skills and we should just add the
\"sans\" in c[\"domain\"]check to the existing code.