bjornsnoen / minica-api

GNU General Public License v3.0
15 stars 2 forks source link

Problem with more than one host in a single label #1

Closed Casburggraaf closed 2 years ago

Casburggraaf commented 2 years ago

I love the idea of this package and it works fine. But i use on some services multiple hostnames

- "traefik.http.routers.${APP_NAME}.rule=Host(`${DOMAIN1}`) || Host(`${DOMAIN2}`)  || Host(`${DOMAIN3}`)}"

But then i makes a folder like and the certs wont work

domain1.test`) || Host(`www.domain2.test`) || Host(`www.domain3.test

any solution for this?

bjornsnoen commented 2 years ago

Oh, interesting! The label parsing is very rudimentary, I'll try to whip up a fix right away. Thanks for reporting it!

bjornsnoen commented 2 years ago

Just pushed a fix for this so you can have any amount of hosts in your rules. Would you mind checking that it works for you?

Casburggraaf commented 2 years ago

yes this works. Thank you!

Other less related question, do you have an easy way to add the root cert to a docker contianer itself?

bjornsnoen commented 2 years ago

Great! Again thanks for reporting this😊

Only one of my other containers needs to trust the root certificate, so I mount it in as a volume and override the entrypoint to add it to the trust store, before handing execution back to the initial entrypoint. Another way to do the same without volumes would be to curl the /root/pem endpoint of the minica container to get the certificate, and again add it to the trust store before proceeding. The problem with that approach is going to be the timing of waiting for the minica API to be up when you're starting both containers at the same time.