I’m trying to work out how to add a new sub-domain alias via CLI:
v-add-web-domain-alias $username $domain autodiscover.$domain yes
This works , but the SSL certificate isn’t changed to include the new alias. Looking at system.log when I do a change from the GUI, I see:
2023-01-08 07:30:45 v-add-letsencrypt-domain ‘ukraine’ ‘
domain.org.uk’ ‘ www.domain.org.uk’
How do I get a list of all the aliases, to pass along to v-add-letsencrypt-domain ?
UPDATE: Manually running it I can get the aliases added:
v-add-letsencrypt-domain 'ukraine' 'billingshurstforukraine.org.uk' 'www.billingshurstforukraine.org.uk,autoconfig.billingshurstforukraine.org.uk,autodiscover.billingshurstforukraine.org.uk' 'yes'
but when I look at the certificate, it doesn’t have the new aliases setup. What am I missing?
Unfortunatly not. I’ve even tried doing:
v-schedule-letsencrypt-domain 'ukraine' 'billingshurstforukraine.org.uk' 'www.billingshurstforukraine.org.uk,autoconfig.billingshurstforukraine.org.uk,autodiscover.billingshurstforukraine.org.uk'
Looking at the source code, I can see it adds that into
letsencrypt.pipe, but I’m not sure what then runs that? Is it an admin cronjob?
I still see this in the CP:
(and similar when looking at the SSL certificate from the browser)
haha typical! Just as I posted that, a cron must have run! It now works and shows the new domains. So the process seems to be:
# now setup the aliases on the main domain
`v-add-web-domain-alias $username $domain autoconfig.$domain yes`;
`v-add-web-domain-alias $username $domain autodiscover.$domain yes`;
`v-add-web-domain-ssl-force '$username' '$domain'`;
`v-schedule-letsencrypt-domain '$username' '$domain' 'www.$domain,autodiscover.$domain,autoconfig.$domain'`;
Rather than manually hard-coding:
Is there a way I can just grab all the aliases on the domain? (just in case there are others setup)
January 9, 2023, 10:16am
Use double quotes instead of single
Single quotes makes it ‘$domain’ instead of $domain
Sorry, that was my Perl code
$domain gets converted fine. I think the problem was that I was missing
v-schedule-letsencrypt-domain which seems to run the LE scripts and update the certificate.
January 9, 2023, 10:40am
v-schedule-letsencrypt-domain will run v-add-letsencrypt only on a 5 min delay to allow DNS cluster to catch up…
Ah ok - that would explain the delay
(and makes sense… as that was my next concern… ie how to tell it to wait for several minutes, as I only add the autodiscover/autoconfig DNS records further up the script)
Once its finished I’ll share it here. Its not perfect, but seems to add auto-config for most clients
February 8, 2023, 10:45am
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.