kereis / traefik-certs-dumper

Dumps Let's Encrypt certificates of a specified domain which Traefik stores in acme.json.
Apache License 2.0
129 stars 24 forks source link

traefik/acme.json is a directory #186

Closed seisdr closed 7 months ago

seisdr commented 8 months ago

Here I'm running crt dumper as instructed by mailcow docs , so i can get the bloody crts

✔ Container traefik-cert-dumper-certdumper-1  Created                      0.0s
Attaching to certdumper-1
certdumper-1  | [2024-03-31T06:11:30+0000]: --restart-containers is empty. Won't attempt to restart containers.
certdumper-1  | [2024-03-31T06:11:30+0000]: --restart-services is empty. Won't attempt to restart services.                                                                                                         certdumper-1  | [2024-03-31T06:11:30+0000]: Environment variable DOMAIN empty. Will dump all certificates possible...                                                                                               certdumper-1  | [2024-03-31T06:11:30+0000]: ACME file path: /traefik/acme.json
certdumper-1  | [2024-03-31T06:11:30+0000]: Clearing dumping directory
certdumper-1  | [2024-03-31T06:11:30+0000]: Dumping certificates
certdumper-1  | Error: v2: dump failed: failed to open file "/traefik/acme.json": open /traefik/acme.json: no such file or directory
certdumper-1  | Usage:
certdumper-1  |   traefik-certs-dumper file [flags]
certdumper-1  |
certdumper-1  | Flags:
certdumper-1  |   -h, --help             help for file
certdumper-1  |       --source string    Path to 'acme.json' file. (default "./acme.json")
certdumper-1  |       --version string   Traefik version. If empty use v1. Possible values: 'v2'.
certdumper-1  |
certdumper-1  | Global Flags:
certdumper-1  |       --clean              Clean destination folder before dumping content. (default true)
certdumper-1  |       --config string      config file (default is $HOME/.traefik-certs-dumper.yaml)
certdumper-1  |       --crt-ext string     The file extension of the generated certificates. (default ".crt")
certdumper-1  |       --crt-name string    The file name (without extension) of the generated certificates. (default "certificate")
certdumper-1  |       --dest string        Path to store the dump content. (default "./dump")
certdumper-1  |       --domain-subdir      Use domain as sub-directory.
certdumper-1  |       --key-ext string     The file extension of the generated private keys. (default ".key")
certdumper-1  |       --key-name string    The file name (without extension) of the generated private keys. (default "privatekey")
certdumper-1  |       --post-hook string   Execute a command only if changes occurs on the data source. (works only with the watch mode)
certdumper-1  |       --watch              Enable watching changes.
certdumper-1  |
certdumper-1  | 2024/03/31 06:11:30 root.go:45: v2: dump failed: failed to open file "/traefik/acme.json": open /traefik/acme.json: no such file or directory
certdumper-1  | [2024-03-31T06:11:30+0000]: Certificates for domain '*' don't exist. Omitting...
certdumper-1  | [2024-03-31T06:11:30+0000]: /traefik/acme.json is not a file. Retrying...
^CGracefully stopping... (press Ctrl+C again to force)
[+] Stopping 1/1
 ✔ Container traefik-cert-dumper-certdumper-1  Stopped                     11.1s
canceled

and I get that traefik/acme.json is a directory not a file. and honestly i don't know what I'm doing anymore Docker-compose.yaml

version: '3.7'                                                                                                                                                                                                      services:                                                                                                   certdumper:
    image: ghcr.io/kereis/traefik-certs-dumper:latest
    volumes:
    - ./traefik/acme:/traefik:ro                                                                              - ./output:/output:rw                                                                                     # Don't set DOMAIN
 #   environment:
#     - DOMAIN=
kereis commented 7 months ago

Hi,

you are mounting a host directory /traefik/acme. Does it contain a file acme.json?

seisdr commented 7 months ago

Hi , no, i managed to fix this somehow, thanks