mariuskimmina / coredns-tlsplus

4 stars 0 forks source link

How to request certs for multiple domains? #2

Open raldone01 opened 7 months ago

raldone01 commented 7 months ago

Is there a way to get certs for multiple domains? Preferably in one file.

I would like to replace the following certbot with this plugin: certbot certonly --agree-tos -n --keep-until-expiring --email 'mail@example.com' --no-redirect --text --cert-name cert -d example.com -d www.example.com -d nextcloud.example.com -d '*.pages.example.com' --authenticator dns-godaddy --dns-godaddy-propagation-seconds 160 --dns-godaddy-credentials /run/secrets/nginx_cerbot_godaddy_credentials --server https://acme-v02.api.letsencrypt.org/directory

I tried adding multiple domains to the domain keyword but it didn't work. I also added two domain keys to the acme block but then only the last one is used.

Here is my Corefile:

example.com {
    log
    errors
    file /root/example.com.db example.com
    #forward . 8.8.8.8

    tls acme {
        domain example.com
        domain www.example.com # doesn't work

        domain example.com www.example.com # doesn't work

        email raldone01@gmail.com
        #certpath $HOME/.local/share/certmagic
        # Production endpoint
        #ca https://acme-v02.api.letsencrypt.org/directory
        # Staging endpoint
        ca https://acme-staging-v02.api.letsencrypt.org/directory
    }
}

If this is already possible the documentation could be improved. Thank you for your work on the plugin.

mariuskimmina commented 7 months ago

Hi @raldone01

I am afraid at the moment this is not possible. I can see that this would be useful tho, I'll add it when I find time.