Skip to content

Commit b2e75d8

Browse files
authored
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.
1 parent 082095b commit b2e75d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bin/v-add-web-domain-ssl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ check_result $? "Web restart failed" >/dev/null
120120
$BIN/v-restart-proxy $restart
121121
check_result $? "Proxy restart failed" >/dev/null
122122

123+
if [ ! -z "$UPDATE_HOSTNAME_SSL" ] && [ "$UPDATE_HOSTNAME_SSL" = "yes" ]; then
124+
hostname=$(hostname)
125+
if [ "$hostname" = "$domain" ]; then
126+
$BIN/v-update-host-certificate $user $domain
127+
fi
128+
fi
129+
123130
# Logging
124131
log_history "enabled ssl support for $domain"
125132
log_event "$OK" "$ARGUMENTS"

0 commit comments

Comments
 (0)