Kay0u 4 лет назад
Родитель
Сommit
5efb292a9a
3 измененных файлов с 31 добавлено и 24 удалено
  1. 11 8
      scripts/actions/reset_default_app
  2. 10 8
      scripts/install
  3. 10 8
      scripts/upgrade

+ 11 - 8
scripts/actions/reset_default_app

@@ -42,6 +42,14 @@ ynh_script_progression --message="Activating maintenance mode..." --time --weigh
 
 
 ynh_maintenance_mode_ON
 ynh_maintenance_mode_ON
 
 
+#=================================================
+# CREATE DEDICATED USER
+#=================================================
+ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1
+
+# Create a dedicated user (if not existing)
+ynh_system_user_create --username=$app
+
 #=================================================
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
 #=================================================
@@ -62,6 +70,9 @@ else
     # Overwrite admin dashboard
     # Overwrite admin dashboard
     YNH_CWD=$PWD ynh_setup_source --dest_dir="$final_path" --source_id=admin_dashboard_last
     YNH_CWD=$PWD ynh_setup_source --dest_dir="$final_path" --source_id=admin_dashboard_last
 fi
 fi
+
+chown -R $app:www-data "$final_path"
+
 )
 )
 
 
 #=================================================
 #=================================================
@@ -72,14 +83,6 @@ ynh_script_progression --message="Resetting nginx web server configuration..." -
 # Create a dedicated nginx config
 # Create a dedicated nginx config
 yunohost app action run $app reset_default_nginx
 yunohost app action run $app reset_default_nginx
 
 
-#=================================================
-# CREATE DEDICATED USER
-#=================================================
-ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1
-
-# Create a dedicated user (if not existing)
-ynh_system_user_create --username=$app
-
 #=================================================
 #=================================================
 # PHP-FPM CONFIGURATION
 # PHP-FPM CONFIGURATION
 #=================================================
 #=================================================

+ 10 - 8
scripts/install

@@ -90,6 +90,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=12
 
 
 ynh_install_app_dependencies $app_depencencies
 ynh_install_app_dependencies $app_depencencies
 
 
+#=================================================
+# CREATE DEDICATED USER
+#=================================================
+ynh_script_progression --message="Configuring system user..." --weight=2
+
+# Create a dedicated system user
+ynh_system_user_create --username=$app
+
 #=================================================
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
 #=================================================
@@ -111,6 +119,8 @@ else
     ynh_setup_source --dest_dir="$final_path" --source_id=admin_dashboard_last
     ynh_setup_source --dest_dir="$final_path" --source_id=admin_dashboard_last
 fi
 fi
 
 
+chown -R $app:www-data "$final_path"
+
 #=================================================
 #=================================================
 # NGINX CONFIGURATION
 # NGINX CONFIGURATION
 #=================================================
 #=================================================
@@ -119,14 +129,6 @@ ynh_script_progression --message="Configuring nginx web server..." --weight=2
 # Create a dedicated nginx config
 # Create a dedicated nginx config
 ynh_add_nginx_config
 ynh_add_nginx_config
 
 
-#=================================================
-# CREATE DEDICATED USER
-#=================================================
-ynh_script_progression --message="Configuring system user..." --weight=2
-
-# Create a dedicated system user
-ynh_system_user_create --username=$app
-
 #=================================================
 #=================================================
 # PHP-FPM CONFIGURATION
 # PHP-FPM CONFIGURATION
 #=================================================
 #=================================================

+ 10 - 8
scripts/upgrade

@@ -133,6 +133,14 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=6
 
 
 ynh_install_app_dependencies $app_depencencies
 ynh_install_app_dependencies $app_depencencies
 
 
+#=================================================
+# CREATE DEDICATED USER
+#=================================================
+ynh_script_progression --message="Making sure dedicated system user exists..."
+
+# Create a dedicated user (if not existing)
+ynh_system_user_create --username=$app
+
 #=================================================
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
 #=================================================
@@ -155,6 +163,8 @@ then
     fi
     fi
 fi
 fi
 
 
+chown -R $app:www-data "$final_path"
+
 #=================================================
 #=================================================
 # NGINX CONFIGURATION
 # NGINX CONFIGURATION
 #=================================================
 #=================================================
@@ -167,14 +177,6 @@ then
     ynh_add_nginx_config
     ynh_add_nginx_config
 fi
 fi
 
 
-#=================================================
-# CREATE DEDICATED USER
-#=================================================
-ynh_script_progression --message="Making sure dedicated system user exists..."
-
-# Create a dedicated user (if not existing)
-ynh_system_user_create --username=$app
-
 #=================================================
 #=================================================
 # PHP-FPM CONFIGURATION
 # PHP-FPM CONFIGURATION
 #=================================================
 #=================================================