kchristensen / udm-le

Let's Encrypt support for Ubiquiti UniFi OS
MIT License
572 stars 79 forks source link

fix: Issue 20 #23

Closed duffenterprises closed 3 years ago

duffenterprises commented 3 years ago

@kchristensen I've added the documentation to support gcloud, and modifications to the shell script.

During my testing last week, I observered that the shell script did not support wildcard DNS entries. Let's Encrypt creates *.whatever.anotherhostname.com as _.whatever.anotherhostname.com.cert (etc) which is why I introduced the regex

LEGO_CERT_NAME=${CERT_NAME/\*/_}

I also observed that Let's Encrypt errored with domains like your original example:

CERT_HOSTS='whatever.hostname.com,*.whatever.hostname.com'

because whatever.hostname.com is encompased within *.whatever.hostname.com, thus the example update to *.whatever.anotherhostname.com.

Hopefully this PR is useful to the UDM community.

kchristensen commented 3 years ago

This looks great. Good catch on the wildcard stuff, that was something another contributor added that I don't actually use at home so it wasn't well vetted. Going to merge this now and if I don't hear anyone grumble I'll cut a release announcing google support in a couple of days. Thanks!