traefik-certificate-exporter


Nametraefik-certificate-exporter JSON
Version 0.1.0.0 PyPI version JSON
download
home_pagehttps://github.com/ravensorb/traefik-certificate-exporter
SummaryWatches for changes to traefik acme json files and extracts certificates to a specific folder
upload_time2024-03-30 13:49:53
maintainerNone
docs_urlNone
authorShawn Anderson
requires_python<4.0,>=3.10
licenseNone
keywords traefik letsencrypt
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Overview

[![Github Tags](https://img.shields.io/github/v/tag/ravensorb/traefik-certificate-exporter?logo=github&logoColor=white)](https://github.com/ravensorb/traefik-certificate-exporter) [![PyPi Version](https://img.shields.io/pypi/v/traefik-certificate-exporter?color=g&label=pypi%20package&logo=pypi&logoColor=white)](https://pypi.org/project/traefik-certificate-exporter/) [![Docker](https://badgen.net/badge/icon/docker?icon=docker&label)](https://hub.docker.com/r/ravensorb/traefik-certificate-exporter)



This tool can be used to extract acme certificates (ex: lets encrupt) from traefik json files. The tool is design to watch for changes to a folder for any files that match a filespec (defaults to *,json however can be set to a specific file name) and when changes are detected it will process the file and extract any certificates that are in it to the specified output path

# Installation

## Python Script/Tool

Installation can be done via the python package installer tool pip

```basah
$ pip install traefik-certificate-exporter
```

# Usage

```bash
usage: traefik-certificate-exporter [-h] [-c CONFIGFILE] [-d SETTINGS.DATAPATH] [-w] [-fs SETTINGS.FILESPEC] [-o SETTINGS.OUTPUTPATH] [--traefik-resolver-id SETTINGS.TRAEFIKRESOLVERID] [--flat] [--restart-container]
                                    [--dry-run] [-r] [--include-resolvername-in-outputpath] [-ll {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-id [SETTINGS.DOMAINS.INCLUDE ...] | -xd [SETTINGS.DOMAINS.EXCLUDE ...]]

Extract traefik letsencrypt certificates.

options:
  -h, --help            show this help message and exit
  -c CONFIGFILE, --config-file CONFIGFILE
                        the path to watch for changes (default: config.yaml)
  -d SETTINGS.DATAPATH, --data-path SETTINGS.DATAPATH
                        the path that contains the acme json files
  -w, --watch-for-changes
                        If specified, monitor and watch for changes to acme files
  -fs SETTINGS.FILESPEC, --file-spec SETTINGS.FILESPEC
                        file that contains the traefik certificates
  -o SETTINGS.OUTPUTPATH, --output-path SETTINGS.OUTPUTPATH
                        The folder to exports the certificates in to
  --traefik-resolver-id SETTINGS.TRAEFIKRESOLVERID
                        Traefik certificate-resolver-id.
  --flat                If specified, all certificates into a single folder
  --restart-container   If specified, any container that are labeled with 'com.github.ravensorb.traefik-certificate-exporter.domain-restart=<DOMAIN>' will be restarted if the domain name of a generated certificates
                        matches the value of the lable. Multiple domains can be seperated by ','
  --dry-run             Don't write files and do not restart docker containers.
  -r, --run-at-start    Runs Export immediately on start (used with watch-for-changes).
  --include-resolvername-in-outputpath
                        Added the resolvername in the path used to export the certificates (ignored if flat is specified).
  -ll {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set the logging level (default: INFO)
  -id [SETTINGS.DOMAINS.INCLUDE ...], --include-domains [SETTINGS.DOMAINS.INCLUDE ...]
                        If specified, only certificates that match domains in this list will be extracted
  -xd [SETTINGS.DOMAINS.EXCLUDE ...], --exclude-domains [SETTINGS.DOMAINS.EXCLUDE ...]
                        If specified. certificates that match domains in this list will be ignored
```

## Examples

Watch the letsencrypt folder for any changes to files matching acme-*.json and export any certs managed by the resolver called "resolver-http"

### Script

Run it once and then exit

```bash
traefik-certificate-exporter \
                            -d /mnt/traefik-data/letsencrypt \
                            -o /mnt/certs \
                            -fs "acme-*.json" \
                            -r
```

Run it and watch for changes to the files

```bash
traefik-certificate-exporter \
                            -d /mnt/traefik-data/letsencrypt \
                            -o /mnt/certs \
                            -fs "acme-*.json" 
                            -w
```

## Credits

This tool is HEAVLY influenced by the excellent work of [DanielHuisman](https://github.com/DanielHuisman) and [Marc Brückner](https://github.com/SnowMB)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ravensorb/traefik-certificate-exporter",
    "name": "traefik-certificate-exporter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "traefik, letsencrypt",
    "author": "Shawn Anderson",
    "author_email": "sanderson@eye-catcher.com",
    "download_url": "https://files.pythonhosted.org/packages/94/69/8103a13745c075b206a32e7001716fd087c150a8143855bdadf6c81476d1/traefik_certificate_exporter-0.1.0.0.tar.gz",
    "platform": null,
    "description": "# Overview\n\n[![Github Tags](https://img.shields.io/github/v/tag/ravensorb/traefik-certificate-exporter?logo=github&logoColor=white)](https://github.com/ravensorb/traefik-certificate-exporter) [![PyPi Version](https://img.shields.io/pypi/v/traefik-certificate-exporter?color=g&label=pypi%20package&logo=pypi&logoColor=white)](https://pypi.org/project/traefik-certificate-exporter/) [![Docker](https://badgen.net/badge/icon/docker?icon=docker&label)](https://hub.docker.com/r/ravensorb/traefik-certificate-exporter)\n\n\n\nThis tool can be used to extract acme certificates (ex: lets encrupt) from traefik json files. The tool is design to watch for changes to a folder for any files that match a filespec (defaults to *,json however can be set to a specific file name) and when changes are detected it will process the file and extract any certificates that are in it to the specified output path\n\n# Installation\n\n## Python Script/Tool\n\nInstallation can be done via the python package installer tool pip\n\n```basah\n$ pip install traefik-certificate-exporter\n```\n\n# Usage\n\n```bash\nusage: traefik-certificate-exporter [-h] [-c CONFIGFILE] [-d SETTINGS.DATAPATH] [-w] [-fs SETTINGS.FILESPEC] [-o SETTINGS.OUTPUTPATH] [--traefik-resolver-id SETTINGS.TRAEFIKRESOLVERID] [--flat] [--restart-container]\n                                    [--dry-run] [-r] [--include-resolvername-in-outputpath] [-ll {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-id [SETTINGS.DOMAINS.INCLUDE ...] | -xd [SETTINGS.DOMAINS.EXCLUDE ...]]\n\nExtract traefik letsencrypt certificates.\n\noptions:\n  -h, --help            show this help message and exit\n  -c CONFIGFILE, --config-file CONFIGFILE\n                        the path to watch for changes (default: config.yaml)\n  -d SETTINGS.DATAPATH, --data-path SETTINGS.DATAPATH\n                        the path that contains the acme json files\n  -w, --watch-for-changes\n                        If specified, monitor and watch for changes to acme files\n  -fs SETTINGS.FILESPEC, --file-spec SETTINGS.FILESPEC\n                        file that contains the traefik certificates\n  -o SETTINGS.OUTPUTPATH, --output-path SETTINGS.OUTPUTPATH\n                        The folder to exports the certificates in to\n  --traefik-resolver-id SETTINGS.TRAEFIKRESOLVERID\n                        Traefik certificate-resolver-id.\n  --flat                If specified, all certificates into a single folder\n  --restart-container   If specified, any container that are labeled with 'com.github.ravensorb.traefik-certificate-exporter.domain-restart=<DOMAIN>' will be restarted if the domain name of a generated certificates\n                        matches the value of the lable. Multiple domains can be seperated by ','\n  --dry-run             Don't write files and do not restart docker containers.\n  -r, --run-at-start    Runs Export immediately on start (used with watch-for-changes).\n  --include-resolvername-in-outputpath\n                        Added the resolvername in the path used to export the certificates (ignored if flat is specified).\n  -ll {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}\n                        Set the logging level (default: INFO)\n  -id [SETTINGS.DOMAINS.INCLUDE ...], --include-domains [SETTINGS.DOMAINS.INCLUDE ...]\n                        If specified, only certificates that match domains in this list will be extracted\n  -xd [SETTINGS.DOMAINS.EXCLUDE ...], --exclude-domains [SETTINGS.DOMAINS.EXCLUDE ...]\n                        If specified. certificates that match domains in this list will be ignored\n```\n\n## Examples\n\nWatch the letsencrypt folder for any changes to files matching acme-*.json and export any certs managed by the resolver called \"resolver-http\"\n\n### Script\n\nRun it once and then exit\n\n```bash\ntraefik-certificate-exporter \\\n                            -d /mnt/traefik-data/letsencrypt \\\n                            -o /mnt/certs \\\n                            -fs \"acme-*.json\" \\\n                            -r\n```\n\nRun it and watch for changes to the files\n\n```bash\ntraefik-certificate-exporter \\\n                            -d /mnt/traefik-data/letsencrypt \\\n                            -o /mnt/certs \\\n                            -fs \"acme-*.json\" \n                            -w\n```\n\n## Credits\n\nThis tool is HEAVLY influenced by the excellent work of [DanielHuisman](https://github.com/DanielHuisman) and [Marc Br\u00fcckner](https://github.com/SnowMB)",
    "bugtrack_url": null,
    "license": null,
    "summary": "Watches for changes to traefik acme json files and extracts certificates to a specific folder",
    "version": "0.1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/ravensorb/traefik-certificate-exporter",
        "Repository": "https://github.com/ravensorb/traefik-certificate-exporter"
    },
    "split_keywords": [
        "traefik",
        " letsencrypt"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c52b463f1c38b223b429c9421979fa7b3a5a20a8eb5cc175d5a4180b09f4e357",
                "md5": "da1a00800e9b53770004c466f1784430",
                "sha256": "592ba880c808b8e6c303ffb65b3546d36160cf5ba34d4d10f549f3d586879e61"
            },
            "downloads": -1,
            "filename": "traefik_certificate_exporter-0.1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "da1a00800e9b53770004c466f1784430",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 15051,
            "upload_time": "2024-03-30T13:49:51",
            "upload_time_iso_8601": "2024-03-30T13:49:51.450435Z",
            "url": "https://files.pythonhosted.org/packages/c5/2b/463f1c38b223b429c9421979fa7b3a5a20a8eb5cc175d5a4180b09f4e357/traefik_certificate_exporter-0.1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "94698103a13745c075b206a32e7001716fd087c150a8143855bdadf6c81476d1",
                "md5": "a82ff5b1465134d531034af88418e6d4",
                "sha256": "8f0dd984241cf51b8e23b7c52f3d8a8f14ab360c098937695d2d397d313d44d4"
            },
            "downloads": -1,
            "filename": "traefik_certificate_exporter-0.1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a82ff5b1465134d531034af88418e6d4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 12460,
            "upload_time": "2024-03-30T13:49:53",
            "upload_time_iso_8601": "2024-03-30T13:49:53.098583Z",
            "url": "https://files.pythonhosted.org/packages/94/69/8103a13745c075b206a32e7001716fd087c150a8143855bdadf6c81476d1/traefik_certificate_exporter-0.1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-30 13:49:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ravensorb",
    "github_project": "traefik-certificate-exporter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "traefik-certificate-exporter"
}
        
Elapsed time: 0.22877s