diff --git a/scripts/actions/reset_default_app b/scripts/actions/reset_default_app index 5cc74fc..3f44058 100755 --- a/scripts/actions/reset_default_app +++ b/scripts/actions/reset_default_app @@ -42,6 +42,14 @@ ynh_script_progression --message="Activating maintenance mode..." --time --weigh 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 #================================================= @@ -62,6 +70,9 @@ else # Overwrite admin dashboard YNH_CWD=$PWD ynh_setup_source --dest_dir="$final_path" --source_id=admin_dashboard_last 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 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 #================================================= diff --git a/scripts/install b/scripts/install index 159716d..0e2725b 100644 --- a/scripts/install +++ b/scripts/install @@ -90,6 +90,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=12 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 #================================================= @@ -111,6 +119,8 @@ else ynh_setup_source --dest_dir="$final_path" --source_id=admin_dashboard_last fi +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -119,14 +129,6 @@ ynh_script_progression --message="Configuring nginx web server..." --weight=2 # Create a dedicated 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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 20a9d1b..83ca487 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -133,6 +133,14 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=6 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 #================================================= @@ -155,6 +163,8 @@ then fi fi +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -167,14 +177,6 @@ then ynh_add_nginx_config 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 #=================================================