yalh76 4 лет назад
Родитель
Сommit
07b3839c76
3 измененных файлов с 26 добавлено и 2 удалено
  1. 4 0
      scripts/install
  2. 6 2
      scripts/restore
  3. 16 0
      scripts/upgrade

+ 4 - 0
scripts/install

@@ -99,6 +99,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
 # Download, check integrity, uncompress and patch the source from app.src
 # Download, check integrity, uncompress and patch the source from app.src
 ln -s /usr/share/zabbix "$final_path"
 ln -s /usr/share/zabbix "$final_path"
 
 
+chmod 750 "$final_path"
+chmod -R o-rwx "$final_path"
+chown -R $app:www-data "$final_path"
+
 #=================================================
 #=================================================
 # NGINX CONFIGURATION
 # NGINX CONFIGURATION
 #=================================================
 #=================================================

+ 6 - 2
scripts/restore

@@ -36,7 +36,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
 #=================================================
 #=================================================
 ynh_script_progression --message="Validating restoration parameters..."
 ynh_script_progression --message="Validating restoration parameters..."
 
 
-ynh_secure_remove $final_path
+ynh_secure_remove --file="$final_path"
 
 
 #=================================================
 #=================================================
 # STANDARD RESTORATION STEPS
 # STANDARD RESTORATION STEPS
@@ -52,7 +52,11 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
 #=================================================
 #=================================================
 ynh_script_progression --message="Restoring the app main directory..."
 ynh_script_progression --message="Restoring the app main directory..."
 
 
-ln -s /usr/share/zabbix /var/www/zabbix
+ln -s /usr/share/zabbix "$final_path"
+
+chmod 750 "$final_path"
+chmod -R o-rwx "$final_path"
+chown -R $app:www-data "$final_path"
 
 
 #=================================================
 #=================================================
 # RESTORE THE PHP-FPM CONFIGURATION
 # RESTORE THE PHP-FPM CONFIGURATION

+ 16 - 0
scripts/upgrade

@@ -74,6 +74,22 @@ if ynh_legacy_permissions_exists; then
 	ynh_legacy_permissions_delete_all
 	ynh_legacy_permissions_delete_all
 fi
 fi
 
 
+#=================================================
+# DOWNLOAD, CHECK AND UNPACK SOURCE
+#=================================================
+
+if [ "$upgrade_type" == "UPGRADE_APP" ]
+then
+	ynh_script_progression --message="Upgrading source files..."
+
+	# Download, check integrity, uncompress and patch the source from app.src
+	ln -s /usr/share/zabbix "$final_path"
+fi
+
+chmod 750 "$final_path"
+chmod -R o-rwx "$final_path"
+chown -R $app:www-data "$final_path"
+
 #=================================================
 #=================================================
 # NGINX CONFIGURATION
 # NGINX CONFIGURATION
 #=================================================
 #=================================================