ldez / traefik-certs-dumper

Dump ACME data from Traefik to certificates
Other
462 stars 30 forks source link

make domain name as crt-name and key-name #182

Open woobenjamin opened 1 year ago

woobenjamin commented 1 year ago

Hi there,

This is the perfect solution for what I'm looking for. I'm wondering if I could suggest the opportunity to name the crt and key name files as the domain name, i.e. example.com.crt and example.com.key.

Thanks again for creating this!

ben

ldez commented 1 year ago

Hi,

the domain is already used to name files:

https://github.com/ldez/traefik-certs-dumper#examples

woobenjamin commented 1 year ago

I think I might be doing something wrong, or going cross-eyed... I took away the --crt-name and --key-name, and diid the following

      && traefik-certs-dumper file --version v2 --watch
      --source /data/acme.json --dest /data/certs
      --crt-ext=.crt --key-ext=.key 
      --domain-subdir=true'

and

      && traefik-certs-dumper file --version v2 --watch
      --source /data/acme.json --dest /data/certs
      --domain-subdir=true'

in both situations, the directories were correct, but the files generated were named certificate.crt and privatekey.crt

What I was thinking was like this:

dump
├──my.domain.com
│  ├──my.domain.com.crt
│  └──my.domain.com.key
└──private
   └──letsencrypt.key

Many thanks!

ldez commented 1 year ago

It's because you are using --domain-subdir=true

woobenjamin commented 1 year ago

@ldez,

I'm sorry, I feel like I'm not expressing what I want clearly. I do want the domain-subdir, but I also want the crt and key files to be named as the domain as well.

So, I want the directory structure as domain1.com, domain2.com, etc. But I also want the files within the directory tree to be named domain1.com.crt and domain1.key.

One way of representing it might be: /data/domain1.com which has 2 files domain1.com.crt and domain1.com.key /data/domain2.com which has 2 files domain2.com.crt and domain2.com.key etc.

ben

zgqq commented 1 year ago

+1 Any news on this?