mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 13:24:24 -07:00
Fixing removing certificates during apache reload
v-suspend-web-domain on line 49 is triggering apache/nginx reload... that is doing it in the background... and on line 64, we were previously doing 'mv' for certificates... If the reload lasts too long it in the background, certificates will vanish because of 'mv' on line 64. This fix will avoid this collision by doing 'cp' instead of 'mv', then sleeping for 10 sec, and then removing certificates. We will call this bug "Nemanja Puhalo's bug" because he hit this bug first.
This commit is contained in:
parent
1848c36784
commit
a4acb57e54
1 changed files with 14 additions and 5 deletions
|
@ -60,11 +60,11 @@ if [ ! -z "$web_data" ]; then
|
|||
ssl_key=$VESTA/data/users/$owner/ssl/$domain.key
|
||||
ssl_ca=$VESTA/data/users/$owner/ssl/$domain.ca
|
||||
ssl_pem=$VESTA/data/users/$owner/ssl/$domain.pem
|
||||
mv $ssl_crt $VESTA/data/users/$user/ssl/
|
||||
mv $ssl_key $VESTA/data/users/$user/ssl/
|
||||
mv $ssl_ca $VESTA/data/users/$user/ssl/ >> /dev/null 2>&1
|
||||
mv $ssl_pem $VESTA/data/users/$user/ssl/ >> /dev/null 2>&1
|
||||
rm -f $HOMEDIR/$owner/conf/web/ssl.$domain.*
|
||||
cp $ssl_crt $VESTA/data/users/$user/ssl/
|
||||
cp $ssl_key $VESTA/data/users/$user/ssl/
|
||||
cp $ssl_ca $VESTA/data/users/$user/ssl/ > /dev/null 2>&1
|
||||
cp $ssl_pem $VESTA/data/users/$user/ssl/ > /dev/null 2>&1
|
||||
# rm -f $HOMEDIR/$owner/conf/web/ssl.$domain.*
|
||||
fi
|
||||
|
||||
# Check ftp user account
|
||||
|
@ -86,6 +86,15 @@ if [ ! -z "$web_data" ]; then
|
|||
find $HOMEDIR/$user/web/$domain -user $owner \
|
||||
-exec chown -h $user:$user {} \;
|
||||
|
||||
if [ "$SSL" = 'yes' ]; then
|
||||
sleep 10
|
||||
rm $ssl_crt
|
||||
rm $ssl_key
|
||||
rm $ssl_ca > /dev/null 2>&1
|
||||
rm $ssl_pem > /dev/null 2>&1
|
||||
rm -f $HOMEDIR/$owner/conf/web/ssl.$domain.*
|
||||
fi
|
||||
|
||||
# Rebuild config
|
||||
$BIN/v-unsuspend-web-domain $user $domain no >> /dev/null 2>&1
|
||||
$BIN/v-rebuild-web-domains $owner no
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue