JessThrysoee / synology-letsencrypt

94 stars 31 forks source link

Missing files when used with wildcard domain #2

Closed MoreJetPacks closed 1 year ago

MoreJetPacks commented 1 year ago

This is working for me without issue for FQDN but not for wildcard domains.

For example, if env has DOMAINS=(--domains "some.example.com)`, the script and the hook will create the following files correctly:

Which are then correctly outputted to:

However, when executing this script, if env has DOMAINS=(--domains "*.example.com), several of the files have a proceeding_` which is not picked up correctly in subsequent sections of the script:

Which results in the following lines not correctly copying files:

cp  $cert_path/$cert_domain.crt "$archive_path/cert.pem"
cp  $cert_path/$cert_domain.issuer.crt "$archive_path/chain.pem"
cat $cert_path/$cert_domain.crt $cert_path/$cert_domain.issuer.crt > $archive_path/fullchain.pem
cp  $cert_path/$cert_domain.key $archive_path/privkey.pem
MoreJetPacks commented 1 year ago

For wildcards, it works if you specify both a FQDN and wildcard for it, example:

DOMAINS=(--domains "example.com" --domains "*.example.com")