1717# ###### You can use \n within the string to create new lines. #######
1818# ######################################################################################
1919
20- upgrade_config_set_value ' UPGRADE_UPDATE_WEB_TEMPLATES' ' false '
20+ upgrade_config_set_value ' UPGRADE_UPDATE_WEB_TEMPLATES' ' true '
2121upgrade_config_set_value ' UPGRADE_UPDATE_DNS_TEMPLATES' ' false'
2222upgrade_config_set_value ' UPGRADE_UPDATE_MAIL_TEMPLATES' ' false'
23- upgrade_config_set_value ' UPGRADE_REBUILD_USERS' ' false '
23+ upgrade_config_set_value ' UPGRADE_REBUILD_USERS' ' true '
2424upgrade_config_set_value ' UPGRADE_UPDATE_FILEMANAGER_CONFIG' ' false'
2525
2626if [ " $IMAP_SYSTEM " = " dovecot" ]; then
3737
3838if [ -f /etc/fail2ban/jail.local ]; then
3939 # Add phpmyadmin rule
40- if ! -qw " ^[phpmyadmin-auth]$" /etc/fail2ban/jail.local 2> /dev/null; then
40+ if ! grep -qw " ^[phpmyadmin-auth]$" /etc/fail2ban/jail.local 2> /dev/null; then
4141 sed -i ' /\[recidive\]/i [phpmyadmin-auth]\nenabled = true\nfilter = phpmyadmin-syslog\naction = hestia[name=WEB]\nlogpath = /var/log/auth.log\nmaxretry = 5\n' /etc/fail2ban/jail.local
4242 fi
4343fi
4444
4545if [ " $MAIL_SYSTEM " = " exim4" ]; then
4646 echo " [ * ] Disable SMTPUTF8 for Exim for now"
47- if grep -qw " ^smtputf8_advertise_hosts =" /etc/exim4/exim4.conf.template 2> /dev/null; then
48- sed -i " /^domainlist local_domains = dsearch;\/etc\/exim4\/domains\ /i smtputf8_advertise_hosts =" /etc/exim4/exim4.conf.template
47+ if ! grep -qw " ^smtputf8_advertise_hosts =" /etc/exim4/exim4.conf.template 2> /dev/null; then
48+ sed -i " /^domainlist local_domains = dsearch;\/etc\/exim4\/domains/i smtputf8_advertise_hosts =" /etc/exim4/exim4.conf.template
4949 fi
5050fi
5151
@@ -56,30 +56,32 @@ echo '[ * ] Enable the "Enhanced and Optimized TLS" feature...'
5656os_release=" $( lsb_release -s -i | tr " [:upper:]" " [:lower:]" ) -$( lsb_release -s -r) "
5757tls13_ciphers=" TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384"
5858
59- if [ " $os_release " = " debian-10" ] || [ " $os_release " = " debian-11" ]; then
60- sed -i ' /^system_default = system_default_sect$/a system_default = hestia_openssl_sect\n\n[hestia_openssl_sect]\nCiphersuites = ' " $tls13_ciphers " ' \nOptions = PrioritizeChaCha' /etc/ssl/openssl.cnf
61- elif [ " $os_release " = " debian-12" ]; then
62- if ! grep -qw " ^ssl_conf = ssl_sect$" /etc/ssl/openssl.cnf 2> /dev/null; then
63- sed -i ' /providers = provider_sect$/a ssl_conf = ssl_sect' /etc/ssl/openssl.cnf
64- fi
65-
66- if ! grep -qw " ^[ssl_sect]$" /etc/ssl/openssl.cnf 2> /dev/null; then
67- sed -i ' $a \\n[ssl_sect]\nsystem_default = hestia_openssl_sect\n\n[hestia_openssl_sect]\nCiphersuites = ' " $tls13_ciphers " ' \nOptions = PrioritizeChaCha' /etc/ssl/openssl.cnf
68- elif grep -qw " ^system_default = system_default_sect$" /etc/ssl/openssl.cnf 2> /dev/null; then
59+ if ! grep -qw " ^[hestia_openssl_sect]$" /etc/ssl/openssl.cnf 2> /dev/null; then
60+ if [ " $os_release " = " debian-10" ] || [ " $os_release " = " debian-11" ]; then
6961 sed -i ' /^system_default = system_default_sect$/a system_default = hestia_openssl_sect\n\n[hestia_openssl_sect]\nCiphersuites = ' " $tls13_ciphers " ' \nOptions = PrioritizeChaCha' /etc/ssl/openssl.cnf
70- fi
71- elif [ " $os_release " = " ubuntu-20.04" ]; then
72- if ! grep -qw " ^openssl_conf = default_conf$" /etc/ssl/openssl.cnf 2> /dev/null; then
73- sed -i ' /^oid_section = new_oids$/a \\n# System default\nopenssl_conf = default_conf' /etc/ssl/openssl.cnf
74- fi
62+ elif [ " $os_release " = " debian-12" ]; then
63+ if ! grep -qw " ^ssl_conf = ssl_sect$" /etc/ssl/openssl.cnf 2> /dev/null; then
64+ sed -i ' /providers = provider_sect$/a ssl_conf = ssl_sect' /etc/ssl/openssl.cnf
65+ fi
7566
76- if ! grep -qw " ^[default_conf]$" /etc/ssl/openssl.cnf 2> /dev/null; then
77- sed -i ' $a [default_conf]\nssl_conf = ssl_sect\n\n[ssl_sect]\nsystem_default = hestia_openssl_sect\n\n[hestia_openssl_sect]\nCiphersuites = ' " $tls13_ciphers " ' \nOptions = PrioritizeChaCha' /etc/ssl/openssl.cnf
78- elif grep -qw " ^system_default = system_default_sect$" /etc/ssl/openssl.cnf 2> /dev/null; then
67+ if ! grep -qw " ^[ssl_sect]$" /etc/ssl/openssl.cnf 2> /dev/null; then
68+ sed -i ' $a \\n[ssl_sect]\nsystem_default = hestia_openssl_sect\n\n[hestia_openssl_sect]\nCiphersuites = ' " $tls13_ciphers " ' \nOptions = PrioritizeChaCha' /etc/ssl/openssl.cnf
69+ elif grep -qw " ^system_default = system_default_sect$" /etc/ssl/openssl.cnf 2> /dev/null; then
70+ sed -i ' /^system_default = system_default_sect$/a system_default = hestia_openssl_sect\n\n[hestia_openssl_sect]\nCiphersuites = ' " $tls13_ciphers " ' \nOptions = PrioritizeChaCha' /etc/ssl/openssl.cnf
71+ fi
72+ elif [ " $os_release " = " ubuntu-20.04" ]; then
73+ if ! grep -qw " ^openssl_conf = default_conf$" /etc/ssl/openssl.cnf 2> /dev/null; then
74+ sed -i ' /^oid_section = new_oids$/a \\n# System default\nopenssl_conf = default_conf' /etc/ssl/openssl.cnf
75+ fi
76+
77+ if ! grep -qw " ^[default_conf]$" /etc/ssl/openssl.cnf 2> /dev/null; then
78+ sed -i ' $a [default_conf]\nssl_conf = ssl_sect\n\n[ssl_sect]\nsystem_default = hestia_openssl_sect\n\n[hestia_openssl_sect]\nCiphersuites = ' " $tls13_ciphers " ' \nOptions = PrioritizeChaCha' /etc/ssl/openssl.cnf
79+ elif grep -qw " ^system_default = system_default_sect$" /etc/ssl/openssl.cnf 2> /dev/null; then
80+ sed -i ' /^system_default = system_default_sect$/a system_default = hestia_openssl_sect\n\n[hestia_openssl_sect]\nCiphersuites = ' " $tls13_ciphers " ' \nOptions = PrioritizeChaCha' /etc/ssl/openssl.cnf
81+ fi
82+ elif [ " $os_release " = " ubuntu-22.04" ]; then
7983 sed -i ' /^system_default = system_default_sect$/a system_default = hestia_openssl_sect\n\n[hestia_openssl_sect]\nCiphersuites = ' " $tls13_ciphers " ' \nOptions = PrioritizeChaCha' /etc/ssl/openssl.cnf
8084 fi
81- elif [ " $os_release " = " ubuntu-22.04" ]; then
82- sed -i ' /^system_default = system_default_sect$/a system_default = hestia_openssl_sect\n\n[hestia_openssl_sect]\nCiphersuites = ' " $tls13_ciphers " ' \nOptions = PrioritizeChaCha' /etc/ssl/openssl.cnf
8385fi
8486
8587# Update server configuration files
@@ -150,7 +152,8 @@ if [ "$WEB_SYSTEM" = "nginx" ] || [ "$PROXY_SYSTEM" = "nginx" ]; then
150152 echo -e " [ ! ] Manual action required, please view:\n[ - ] $HESTIA_BACKUP /message.log"
151153 add_upgrade_message " Manual Action Required [IMPORTANT]\n\nTo enable the \" Enhanced and Optimized TLS\" feature, we must update the NGINX configuration file (/etc/nginx/nginx.conf).\n\nBut for unknown reason or you edited it, may not be fully apply all the changes in this upgrade.\n\nPlease follow the default configuration file to sync it:\n$HESTIA_INSTALL_DIR /nginx/nginx.conf\n\nBacked up configuration file:\n$HESTIA_BACKUP /conf/nginx/nginx.conf\n\nLearn more:\nhttps://github.com/hestiacp/hestiacp/pull/3555"
152154 " $BIN " /v-add-user-notification admin " IMPORTANT: Manual Action Required" ' To enable the <b>Enhanced and Optimized TLS</b> feature, we must update the NGINX configuration file (/etc/nginx/nginx.conf).<br><br>But for unknown reason or you edited it, may not be fully apply all the changes in this upgrade.<br><br>Please follow the default configuration file to sync it:<br>' " $HESTIA_INSTALL_DIR " ' /nginx/nginx.conf<br><br>Backed up configuration file:<br>' " $HESTIA_BACKUP " ' /conf/nginx/nginx.conf<br><br>Visit PR <a href="https://github.com/hestiacp/hestiacp/pull/3555" target="_blank">#3555</a> on GitHub to learn more.'
153- sed -i " s/" " $( grep " IMPORTANT: Manual Action Required" " $HESTIA " /data/users/admin/notifications.conf | awk ' {print $1}' ) " " /NID='1'/" " $HESTIA " /data/users/admin/notifications.conf
155+
156+ sed -i " s/" " $( grep -m 1 " IMPORTANT: Manual Action Required" " $HESTIA " /data/users/admin/notifications.conf | awk ' {print $1}' ) " " /NID='1'/" " $HESTIA " /data/users/admin/notifications.conf
154157
155158 cp -f /etc/nginx/nginx.conf /etc/nginx/nginx.conf-staging
156159
0 commit comments