Dump ACME data from Traefik to certificates
* chore(deps): bump github.com/traefik/traefik/v2 from 2.3.6 to 2.3.7 Bumps [github.com/traefik/traefik/v2](https://github.com/traefik/traefik) from 2.3.6 to 2.3.7. - [Release notes](https://github.com/traefik/traefik/releases) - [Changelog](https://github.com/traefik/traefik/blob/v2.3.7/CHANGELOG.md) - [Commits](https://github.com/traefik/traefik/compare/v2.3.6...v2.3.7) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * go mod tidy Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com> |
||
|---|---|---|
| .github | ||
| cmd | ||
| docs | ||
| dumper | ||
| hook | ||
| integrationtest | ||
| .dockerignore | ||
| .gitignore | ||
| .golangci.toml | ||
| .goreleaser.yml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| godownloader.sh | ||
| LICENSE | ||
| main.go | ||
| Makefile | ||
| readme.md | ||
| tmpl.Dockerfile | ||
traefik-certs-dumper
If you appreciate this project:
Features
- Supported sources:
- file ("acme.json")
- KV stores (Consul, Etcd, Zookeeper, Boltdb)
- Watch changes:
- from file ("acme.json")
- from KV stores (Consul, Etcd, Zookeeper)
- Output formats:
- use domain as sub-directory (allow custom names and extensions)
- flat (domain as filename)
- Hook (only with watch mode and if the data source changes)
Installation
Download / CI Integration
curl -sfL https://raw.githubusercontent.com/ldez/traefik-certs-dumper/master/godownloader.sh | bash -s -- -b $(go env GOPATH)/bin v2.7.4
From Binaries
You can use pre-compiled binaries:
- To get the binary just download the latest release for your OS/Arch from the releases page
- Unzip the archive.
- Add
traefik-certs-dumperin yourPATH.
From Docker
docker run ldez/traefik-certs-dumper:<tag_name>
Examples:
- Traefik v1: docker-compose
- Traefik v2: docker-compose
Usage
Examples
Note: to dump data from Traefik v2, the CLI flag --version v2 must be added.
Simple Dump
$ traefik-certs-dumper file
dump
├──certs
│ └──my.domain.com.key
└──private
├──my.domain.com.crt
└──letsencrypt.key
Change source and destination
$ traefik-certs-dumper file --source ./acme.json --dest ./dump/test
test
├──certs
│ └──my.domain.com.key
└──private
├──my.domain.com.crt
└──letsencrypt.key
Use domain as sub-directory
$ traefik-certs-dumper file --domain-subdir=true
dump
├──my.domain.com
│ ├──certificate.crt
│ └──privatekey.key
└──private
└──letsencrypt.key
Change file extension
$ traefik-certs-dumper file --domain-subdir --crt-ext=.pem --key-ext=.pem
dump
├──my.domain.com
│ ├──certificate.pem
│ └──privatekey.pem
└──private
└──letsencrypt.key
Change file name
$ traefik-certs-dumper file --domain-subdir --crt-name=fullchain --key-name=privkey
dump
├──my.domain.com
│ ├──fullchain.crt
│ └──privkey.key
└──private
└──letsencrypt.key
KV store
Consul
$ traefik-certs-dumper kv consul --endpoints localhost:8500
Etcd
$ traefik-certs-dumper kv etcd --endpoints localhost:2379
Boltdb
$ traefik-certs-dumper kv boltdb --endpoints /the/path/to/mydb.db
Zookeeper
$ traefik-certs-dumper kv zookeeper --endpoints localhost:2181