bestlibre / hassio-addons

173 stars 109 forks source link

nginx use duckdns addon cert #43

Closed LordVaderXIII closed 5 years ago

LordVaderXIII commented 6 years ago

Hi There

Is it possible to use the duckdns addons certs instead of the certbot ones here?

The key and certchain must be located in /ssl/letsencrypt/live/${certname}/privkey.pem and /ssl/letsencrypt/live/${certname}/fullchain.pem. A solution to obtain them is to used the certbot addon.

This part is the one thats causing me issues. Is there a way I can specify the cert location? My certs are in /ssl

edit: added where my certs are.

ciotlosm commented 6 years ago

@LordVaderXIII Currently cert path is hardcoded. It would require some work to add params for it. I think the reason it uses a different path is vhosts. This nginx supports multiple domains, each with it's own certificate.

Using certbot is straight forward, you could easily just disable duckdns letsencrypt and use certbot

bestlibre commented 6 years ago

An option could be added to overwrite the certificates path. The vhost template could be modify to use this path instead of /ssl/letsencrypt/live/{{certname}}/.

Howerver :

The template modification should be something like (with certdir as the new option) :

ssl_trusted_certificate {{^certdir}}/ssl/letsencrypt/live/{{certname}}{{/certdir}}{{#certdir}}{{certdir}}{{/certdir}}/chain.pem;
ssl_certificate {{^certdir}}/ssl/letsencrypt/live/{{certname}}{{/certdir}}{{#certdir}}{{certdir}}{{/certdir}}/fullchain.pem;
ssl_certificate_key {{^certdir}}/ssl/letsencrypt/live/{{certname}}{{/certdir}}{{#certdir}}{{certdir}}{{/certdir}}/privkey.pem;
bestlibre commented 5 years ago

I will close this old issue. Feel free to reopen if needed.