Sign inSign up

slocomptech/traefik-cert-extract

By slocomptech

Updated about 6 years ago

Traefik certificate extractor

Image
0

2.3K

slocomptech/traefik-cert-extract repository overview

Traefik certificate extractor

Traefik certificate extractor extracts certificates (Let's encrypt) from acme.json and saves them into couple of .pem files so they can be used with other services.

Install

cd traefik-cert-extract
npm install

Usage

$ ./main.js
Options:
  --help                  Show help                                    [boolean]
  --version               Show version number                          [boolean]
  -d, --directory         Output directory                   [string] [required]
  -e, --exclude           Exclude domain                   [array] [default: []]
  -f, --file              File that contains Traefik certificates
                                                             [string] [required]
  -i, --include           Include domain                   [array] [default: []]
  -r, --docker-restart    Restart docker containers with label tce.restart=true
                                                      [boolean] [default: false]
  -x, --exclude-provider  Exclude listed providers         [array] [default: []]
  -y, --include-provider  Only process listed providers    [array] [default: []]

Missing required arguments: d, f

Docker

docker run --name traefik-extractor \
  -v cert_vol:/config \
  -v traefik_vol:/data \
  -v /var/run/docker.socket:/var/run/docker.sock \
IMAGETAG
services:
  certs:
     image: slocomptech/traefik-cert-extractor
     volumes:
      - cert_vol:/config
      - traefik_vol:/data:ro
      - /var/run/docker.sock:/var/run/docker.sock
     restart: always

Parameters

ParameterFunction
-e ARGS="..."Add additional arguments for main.js script
-e DOCKER_RESTART=trueEnable docker restart on acme.json update (label: tce.restart=true)
-e FILE=acme.jsonacme.json file path inside /data container volume
-v $(pwd)/certs:/configConfig volume (inside certs folder are certificates)
-v $(pwd)/data:/dataTraefik volume (folder inside which is acme.json
-v /var/run/docker.sock:/var/run/docker.sockEnable access to docker (for container restart)

See upstream image for additional parameters.

Config volume structure

certs
  example.org
    cert.pem
    chain.pem
    fullchain.pem
    privkey.pem (RSA PRIVATE KEY)
    privkey2.pem (PRIVATE KEY)
  sub.example.org
    cert.pem
    chain.pem
    fullchain.pem
    privkey.pem
    privkey2.pem

Tag summary

Content type

Image

Digest

Size

37.4 MB

Last updated

about 6 years ago

docker pull slocomptech/traefik-cert-extract