Skip to content

Commit b63b12a

Browse files
author
Kristan Kenney
committed
Merge branch 'main' into feature/system-health-check
2 parents e922a1c + 2b37760 commit b63b12a

19 files changed

+726
-556
lines changed

bin/v-restore-user

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ if [ "$web" != 'no' ] && [ ! -z "$WEB_SYSTEM" ]; then
312312

313313
# Merging web.conf keys
314314
str="DOMAIN='$domain' IP='$IP' IP6='$IP6' ALIAS='$ALIAS'"
315-
str="$str CUSTOM_DOCROOT='$CUSTOM_DOCROOT' CUSTOM_PHPROOT='$CUSTOM_PHPROOT' IP='$IP' IP6='$IP6' ALIAS='$ALIAS'"
315+
str="$str CUSTOM_DOCROOT='$CUSTOM_DOCROOT' CUSTOM_PHPROOT='$CUSTOM_PHPROOT'"
316+
str="$str REDIRECT='$REDIRECT' REDIRECT_CODE='$REDIRECT_CODE'"
317+
str="$str FASTCGI_CACHE='$FASTCGI_CACHE' FASTCGI_CACHE_LENGTH='$FASTCGI_CACHE_LENGTH'"
316318
str="$str TPL='$TPL' SSL='$SSL' SSL_HOME='$SSL_HOME'"
317319
str="$str LETSENCRYPT='$LETSENCRYPT' FTP_USER='$FTP_USER'"
318320
str="$str FTP_MD5='$FTP_MD5' BACKEND='$BACKEND' PROXY='$PROXY'"
@@ -544,20 +546,29 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
544546
if [ ! -e "$HOMEDIR/$user/conf/mail/$domain/ssl/" ]; then
545547
mkdir -p $HOMEDIR/$user/conf/mail/$domain/ssl/
546548
fi
547-
549+
548550
# Add certificate to Hestia user configuration data directory
549551
if [ -f $tmpdir/mail/$domain/$backup_system/ssl/$domain.crt ]; then
550-
echo "path found"
551552
cp -f $tmpdir/mail/$domain/$backup_system/ssl/$domain.crt $USER_DATA/ssl/mail.$domain.crt
552553
cp -f $tmpdir/mail/$domain/$backup_system/ssl/$domain.key $USER_DATA/ssl/mail.$domain.key
553554
cp -f $tmpdir/mail/$domain/$backup_system/ssl/$domain.crt $USER_DATA/ssl/mail.$domain.pem
554-
if [ -e "$tmpdir/mail/$domain/$backup_system/ssl//$domain.ca" ]; then
555-
cp -f $tmpdir/mail/$domain/$backup_system/ssl//$domain.ca $USER_DATA/ssl/mail.$domain.ca
555+
if [ -e "$tmpdir/mail/$domain/$backup_system/ssl/$domain.ca" ]; then
556+
cp -f $tmpdir/mail/$domain/$backup_system/ssl/$domain.ca $USER_DATA/ssl/mail.$domain.ca
557+
echo >> $USER_DATA/ssl/mail.$domain.pem
558+
cat $USER_DATA/ssl/mail.$domain.ca >> $USER_DATA/ssl/mail.$domain.pem
559+
fi
560+
elif [ -f "$tmpdir/mail/$domain/conf/ssl/$domain.crt" ]; then
561+
cp -f $tmpdir/mail/$domain/conf/ssl/$domain.crt $USER_DATA/ssl/mail.$domain.crt
562+
cp -f $tmpdir/mail/$domain/conf/ssl/$domain.key $USER_DATA/ssl/mail.$domain.key
563+
cp -f $tmpdir/mail/$domain/conf/ssl/$domain.crt $USER_DATA/ssl/mail.$domain.pem
564+
if [ -e "$tmpdir/mail/$domain/conf/ssl/$domain.ca" ]; then
565+
cp -f $tmpdir/mail/$domain/conf/ssl/$domain.ca $USER_DATA/ssl/mail.$domain.ca
556566
echo >> $USER_DATA/ssl/mail.$domain.pem
557567
cat $USER_DATA/ssl/mail.$domain.ca >> $USER_DATA/ssl/mail.$domain.pem
558568
fi
569+
559570
fi
560-
571+
561572
chmod 660 $USER_DATA/ssl/mail.$domain.*
562573

563574
# Add certificate to user home directory
@@ -602,18 +613,24 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
602613
chmod -R 0644 /usr/local/hestia/ssl/mail/*
603614
chown -h $user:mail /usr/local/hestia/ssl/mail/*
604615
fi
605-
616+
606617
# Restoring email accounts
607618
cp -f $tmpdir/mail/$domain/$backup_system/$domain.conf $USER_DATA/mail/
608-
619+
609620
domain_idn=$domain
610621
format_domain_idn
611622

623+
if [ ! -d "$HOMEDIR/$user/mail/$domain_idn" ]; then
624+
mkdir $HOMEDIR/$user/mail/$domain_idn
625+
fi
626+
627+
# Current Hestia store email in the $HOMEDIR/$user/mail/$domain_idn
628+
chmod u+w "$HOMEDIR/$user/mail/$domain_idn"
629+
chown $user:$user "$HOMEDIR/$user/mail/$domain_idn"
630+
612631
# Restoring emails
613632
if [ $backup_mode = 'zstd' ]; then
614633
if [ -e "$tmpdir/mail/$domain/accounts.tar.zst" ]; then
615-
# Current Hestia store email in the $HOMEDIR/$user/mail/$domain_idn
616-
chmod u+w "$HOMEDIR/$user/mail/$domain_idn"
617634
$BIN/v-extract-fs-archive "$user" "$tmpdir/mail/$domain/accounts.tar.zst" "$HOMEDIR/$user/mail/$domain_idn/"
618635
if [ "$?" -ne 0 ]; then
619636
rm -rf $tmpdir
@@ -629,7 +646,6 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
629646
fi
630647
else
631648
if [ -e "$tmpdir/mail/$domain/accounts.tar.gz" ]; then
632-
chmod u+w "$HOMEDIR/$user/mail/$domain_idn"
633649
$BIN/v-extract-fs-archive "$user" "$tmpdir/mail/$domain/accounts.tar.gz" "$HOMEDIR/$user/mail/$domain_idn/"
634650
if [ "$?" -ne 0 ]; then
635651
rm -rf $tmpdir
@@ -645,9 +661,13 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
645661
fi
646662
fi
647663
# Chowning mail conf files to exim user
648-
find $HOMEDIR/$user/conf/mail/$domain -user root \
649-
-exec chown $exim_user {} \;
650-
664+
if [ -d "$HOMEDIR/$user/conf/mail/$domain" ]; then
665+
find $HOMEDIR/$user/conf/mail/$domain -user root \
666+
-exec chown $exim_user {} \;
667+
fi
668+
669+
$HESTIA/bin/v-rebuild-mail-domain $user $domain
670+
651671
done
652672

653673
# Restarting web server

web/css/src/themes/dark.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,10 @@ a.button.cancel {
11191119
color: #e8e8e8 !important;
11201120
}
11211121

1122+
.section-title {
1123+
border-bottom-color: #484848 !important;
1124+
}
1125+
11221126
.qr-code {
11231127
border: 1px solid #3b3b3b;
11241128
box-shadow: 0px 1px 4px rgba(0,0,0,0.35);

web/css/src/themes/default.css

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,7 +2925,6 @@ a.vst-text:active b{
29252925
}
29262926

29272927
.additional-control {
2928-
margin-left: 17px;
29292928
color: #326b9b;
29302929
border-bottom: 0px solid #326b9b;
29312930
font-size: 0.8rem;
@@ -3292,13 +3291,30 @@ a.button.cancel {
32923291
}
32933292

32943293
.page-title {
3295-
font-size: 1.4rem!important;
3296-
font-weight: 500!important;
3297-
padding-bottom: 30px!important;
3294+
font-size: 1.4rem !important;
3295+
font-weight: 500 !important;
3296+
padding-bottom: 30px !important;
32983297
letter-spacing: -0.01em;
32993298
cursor: default;
33003299
}
33013300

3301+
.section-title {
3302+
cursor: default;
3303+
font-size: 1.2rem!important;
3304+
font-weight: 600!important;
3305+
padding-bottom: 12px!important;
3306+
padding-top: 28px!important;
3307+
letter-spacing: -0.01em;
3308+
border-bottom: 1px solid #ccc;
3309+
cursor: pointer;
3310+
}
3311+
3312+
.section-hide-button {
3313+
margin-top: 30px;
3314+
display: inline-block;
3315+
margin-left: -14px;
3316+
}
3317+
33023318
.qr-code {
33033319
border: 1px solid #cfcfcf;
33043320
border-radius: 4px;

web/css/themes/dark.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/css/themes/default.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/templates/admin/add_mail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<input type="text" size="20" class="vst-input" name="v_domain" value="<?=htmlentities(trim($v_domain, "'"))?>">
8181
</td>
8282
</tr>
83-
<?php if($_SESSION['IMAP_SYSTEM']){?>
83+
<?php if($_SESSION['WEBMAIL_SYSTEM']){?>
8484
<tr>
8585
<td class="vst-text step-top">
8686
<?php print _('Webmail Client');?>

web/templates/admin/add_mail_acc.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,12 @@
207207
<td><?=_('SMTP auth method')?>:</td>
208208
<td><div><?=_('Normal password')?></div></td>
209209
</tr>
210+
<?php if($_SESSION['WEBMAIL_SYSTEM']){?>
210211
<tr>
211212
<td><?=_('Webmail URL')?>:</td>
212213
<td><div><a class="vst" href="http://<?=$v_webmail_alias?>" target="_blank">http://<?=$v_webmail_alias?> <i></i></a></div></td>
213214
</tr>
215+
<?php } ?>
214216
</table>
215217
</div>
216218
</td>

0 commit comments

Comments
 (0)