Просмотр исходного кода

Don't enable apparmour profile is abi4.0 is not available (#4795)

Robert-Jan de Dreu 1 год назад
Родитель
Сommit
a78eb656a1
2 измененных файлов с 34 добавлено и 1 удалено
  1. 5 1
      bin/v-add-sys-ssh-jail
  2. 29 0
      install/upgrade/versions/1.9.3.sh

+ 5 - 1
bin/v-add-sys-ssh-jail

@@ -37,9 +37,13 @@ check_hestia_demo_mode
 # Move jailbash to /usr/sbin
 if [ ! -x /usr/sbin/jailbash ]; then
 	cp -f $HESTIA_COMMON_DIR/bubblewrap/jailbash /usr/sbin/jailbash
-	cp -f $HESTIA_COMMON_DIR/bubblewrap/bwrap-userns-restrict /etc/apparmor.d/bwrap-userns-restrict
 	chmod +x /usr/sbin/jailbash
 
+	# only install the apparmor profile is abi 4.0 is available
+	if [ -f /etc/apparmor.d/abi/4.0 ]; then
+		cp -f $HESTIA_COMMON_DIR/bubblewrap/bwrap-userns-restrict /etc/apparmor.d/bwrap-userns-restrict
+	fi
+
 	service apparmor reload > /dev/null 2>&1
 fi
 

+ 29 - 0
install/upgrade/versions/1.9.3.sh

@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Hestia Control Panel upgrade script for target version 1.9.3
+
+#######################################################################################
+#######                      Place additional commands below.                   #######
+#######################################################################################
+####### upgrade_config_set_value only accepts true or false.                    #######
+#######                                                                         #######
+####### Pass through information to the end user in case of a issue or problem  #######
+#######                                                                         #######
+####### Use add_upgrade_message "My message here" to include a message          #######
+####### in the upgrade notification email. Example:                             #######
+#######                                                                         #######
+####### add_upgrade_message "My message here"                                   #######
+#######                                                                         #######
+####### You can use \n within the string to create new lines.                   #######
+#######################################################################################
+
+upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'false'
+upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'false'
+upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'false'
+upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'no'
+upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'
+
+# Remove jailbash app armour file if abi 4.0 is no installed
+if [ ! -f /etc/apparmor.d/abi/4.0 ]; then
+	rm -f /etc/apparmor.d/bwrap-userns-restrict
+fi