Skip to content

Instantly share code, notes, and snippets.

@johackim johackim/

Last active Jun 13, 2020
What would you like to do?
Remove traefik certificate on consul
if [[ -z "$1" ]]; then
echo "usage: [domain]"
exit 1
consul kv get traefik/acme/account/object | gzip -dc > acme.json
# remove invalid domain and store it to acme-fixed.json
cat acme.json | jq -r 'del (.DomainsCertificate.Certs[] | select(.Domains.Main=="'$DOMAIN'"))' > acme-fixed.json
# gzip it
cat acme-fixed.json | gzip -c > acme-fixed.json.gz
# upload fixed and gzipped json back to consul
consul kv put traefik/acme/account/object @acme-fixed.json.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.