Skip to content

rafi0101/traefik-ssl-certificate-exporter

Repository files navigation

Traefik SSL Certificate Exporter

Go Language PRWelcome

Built with ❤︎ by Raphael Ebner

Go tool to export traefik ssl certificates

The Docker container exports periodically the traefik ssl certificates and make them available in the certs/ folder

Content

Important:

This tool only works with Acmev2

Usage:

Command line:

go build && ./traefik-ssl-certificate-exporter --source traefik/acme.json --dest certs/

Docker:

Docker image: rafi0101/traefik-ssl-certificate-exporter

See docker-compose.yml

Variables:

CLI Docker Default Value Description
--source - traefik/acme.json Input
--dest - certs/ Output
--owner CERT_OWNER_ID 0 (root) owner for the extracted cert/keys
--group CERT_GROUP_ID 0 (root) group for the extracted cert/keys
- CRON_TIME * * * * * cron time for the container to extract certs
- ON_START 1 (true) export certs on start

Input:

Your acme.json from traefik tls configuration

Output:

certs/
    example.com/
        cert.pem
        chain.pem
        fullchain.pem
        privkey.pem
    sub.example.com/
        cert.pem
        chain.pem
        fullchain.pem
        privkey.pem

Developed by

  • Raphael Ebner

License

MIT License

Copyright (c) 2021 Raphael Ebner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.