Making Vesta able to update hostname SSL automatically

This feature will allow VestaCP to automatically update system SSL when you add SSL to your domain (that is also hostname) through VestaCP panel.
For example, if your server hostname is my.server.net and you add SSL to that domain (as you usually do via VestaCP panel), that SSL will be also installed to Vesta nginx (on 8083 port), to Exim and to devocot.
This will work if you use LetsEncrypt, and it will also automatically apply renewed certificate when Vesta renew letsencrypt certificate.

--- IMPORTANT ---
This feature will work only if you have
UPDATE_HOSTNAME_SSL='yes'
in /usr/local/vesta/conf/vesta.conf

Why?
Because I'm not sure that Serghey want to use this mechanism for installing system SSL.
So, this way it's only OPTIONAL feature, not enabled by default.
On all servers nothing will happen.

If Sergey likes this idea, he will easily make it enabled by default.

Cheers.
This commit is contained in:
dpeca 2018-04-07 00:38:55 +02:00 committed by GitHub
parent 082095b164
commit b2e75d89b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -120,6 +120,13 @@ check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-proxy $restart
check_result $? "Proxy restart failed" >/dev/null
if [ ! -z "$UPDATE_HOSTNAME_SSL" ] && [ "$UPDATE_HOSTNAME_SSL" = "yes" ]; then
hostname=$(hostname)
if [ "$hostname" = "$domain" ]; then
$BIN/v-update-host-certificate $user $domain
fi
fi
# Logging
log_history "enabled ssl support for $domain"
log_event "$OK" "$ARGUMENTS"