Skip to content
This repository was archived by the owner on Dec 17, 2020. It is now read-only.
This repository was archived by the owner on Dec 17, 2020. It is now read-only.

New version needed for traefik V2.0 #3

@dwernerinformatica

Description

@dwernerinformatica

As the traefik V2.0 container creates a slightly different acme.json v2 file format code changes are needed:

diff -c extractor.py extractor.py.orig
*** extractor.py        2019-09-23 21:30:37.703743606 +0200
--- extractor.py.orig   2019-09-23 21:17:22.761616058 +0200
***************
*** 87,93 ****

  def createCerts(args):
      # Read JSON file
!     data = json.loads(open(args.certificate).read())['default']

      # Determine ACME version
      acme_version = 2 if 'acme-v02' in data['Account']['Registration']['uri'] else 1
--- 87,93 ----

  def createCerts(args):
      # Read JSON file
!     data = json.loads(open(args.certificate).read())

      # Determine ACME version
      acme_version = 2 if 'acme-v02' in data['Account']['Registration']['uri'] else 1
***************
*** 108,120 ****
              fullchain = c['Certificate']['Certificate']
              sans = c['Domains']['SANs']
          elif acme_version == 2:
!             name = c['domain']['main']
!             privatekey = c['key']
!             fullchain = c['certificate']
!             if 'sans' in c['domain']:
!                 sans = c['domain']['sans']
!             else:
!                 sans = []

          if (args.include and name not in args.include) or (args.exclude and name in args.exclude):
              continue
--- 108,117 ----
              fullchain = c['Certificate']['Certificate']
              sans = c['Domains']['SANs']
          elif acme_version == 2:
!             name = c['Domain']['Main']
!             privatekey = c['Key']
!             fullchain = c['Certificate']
!             sans = c['Domain']['SANs']

          if (args.include and name not in args.include) or (args.exclude and name in args.exclude):
              continue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions