Changing domain aliases on main done via CLI, and then rebuild?

Hi,

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?

Thanks!

Andy

restart nginx?

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:

Screenshot 2023-01-09 at 10-10-52 WEB - north.newbyhost.com 9183 - Hestia Control Panel

(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:

'www.$domain,autodiscover.$domain,autoconfig.$domain'

Is there a way I can just grab all the aliases on the domain? (just in case there are others setup)

Use double quotes instead of single

Single quotes makes it ‘$domain’ instead of $domain

Sorry, that was my Perl code :slight_smile: $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.

v-schedule-letsencrypt-domain will run v-add-letsencrypt only on a 5 min delay to allow DNS cluster to catch up…

1 Like

Ah ok - that would explain the delay :slight_smile: (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

Cheers

Andy