Giter Site home page Giter Site logo

joweisberg / docker-certs-extraction Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 4.0 41 KB

Docker to generate certificates based on Traefik docker from json file to crt, key, pem, pfx and like Neilpang/acme.sh

Shell 100.00%
docker acme traefik docker-image certificates pfx crt pem

docker-certs-extraction's Introduction

docker-certs-extraction

This project:

Docker certificates extraction based on Traefik

Generate certificates based on Traefik docker from json file to crt, key, pem, pfx and like Neilpang/acme.sh

A certs-extraction container is available. It includes the latest development HEAD version. You can use it to manage certificates.

Prerequisite:

  • Generate certificates by Traefik
  • Get a valid acme.json file

Steps

  1. Detect change every 3s on acme.json file based on Traefik
  2. Extract crt, key, pem, pfx files under certs/
  3. Copy certificates like acme.sh under acme/
  4. Duplicate acme certificates under ACME_COPY

Example:

/var/docker/traefik
  - acme.json
  certs/
    - ssl-cert.key
    - ssl-cert.crt
    - ssl-cert.pem
    - ssl-cert.pfx
  acme/
    - ca.cer
    - fullchain.cer
    - sub.example.com.key
    - sub.example.com.cer

Environmental variables

  • TZ: name of the TimeZone - ie. "Etc/UTC" or "Europe/Paris" (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
  • DOMAIN: The domain name that you are updating - ie. sub.example.com
  • ACME_COPY: the mounted volume to copy acme folder content. Use | separator for multiples folders (need to be mounted as volume on Docker)

Installation via Docker

Please follow the official documentation:

https://docs.docker.com/install/

Docker image platform / architecture

The Docker image to use joweisberg/certs-extraction:latest. Build on Linux Ubuntu 20.04 LTS, Docker 19.03 and above for:

Platform Architecture / Tags
x86_64 amd64
aarch64 arm64
arm arm32

Docker

Get the container

$ docker pull joweisberg/certs-extraction:latest

Run the container in console mode (notice the environment variable setting parameters for the startup command)

$ docker run -d --restart="unless-stopped" -e TZ="Europe/Paris" -e DOMAIN="sub.example.com" -v /var/docker/traefik:/mnt/data joweisberg/certs-extraction:latest

Run the container via docker-compose

version: "3.5"
services:
  certs-extraction:
    container_name: certs-extraction
    image: joweisberg/certs-extraction:latest
    restart: unless-stopped
    environment:
      - TZ=Europe/Paris
      - DOMAINS=sub1.example.com sub2.example.com
      - ACME_COPY=/mnt/certs-to-copy
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - /var/docker/traefik:/mnt/data
      - /mnt/certs-to-copy:/mnt/certs-to-copy

docker-certs-extraction's People

Contributors

joweisberg avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-certs-extraction's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.