diff --git a/README.md b/README.md
index a4354ce..c8d1681 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# Mindmaps for YunoHost
-[![Integration level](https://dash.yunohost.org/integration/mindmaps.svg)](https://dash.yunohost.org/appci/app/mindmaps) ![Working status](https://ci-apps.yunohost.org/ci/badges/mindmaps.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mindmaps.maintain.svg)
+[![Integration level](https://dash.yunohost.org/integration/mindmaps.svg)](https://dash.yunohost.org/appci/app/mindmaps) ![Working status](https://ci-apps.yunohost.org/ci/badges/mindmaps.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mindmaps.maintain.svg)
[![Install Mindmaps with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mindmaps)
*[Lire ce readme en français.](./README_fr.md)*
@@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Mindmaps is a HTML5 based mind mapping application. It lets you create neat looking mind maps in the browser.
-**Shipped version:** 0.0.20201010~ynh2
+**Shipped version:** 0.0.20201010~ynh3
**Demo:** https://www.mindmaps.app/
diff --git a/README_fr.md b/README_fr.md
index 64ee8b3..9378083 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -5,30 +5,30 @@ It shall NOT be edited by hand.
# Mindmaps pour YunoHost
-[![Niveau d'intégration](https://dash.yunohost.org/integration/mindmaps.svg)](https://dash.yunohost.org/appci/app/mindmaps) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mindmaps.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mindmaps.maintain.svg)
+[![Niveau d’intégration](https://dash.yunohost.org/integration/mindmaps.svg)](https://dash.yunohost.org/appci/app/mindmaps) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mindmaps.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mindmaps.maintain.svg)
[![Installer Mindmaps avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mindmaps)
*[Read this readme in english.](./README.md)*
-> *Ce package vous permet d'installer Mindmaps rapidement et simplement sur un serveur YunoHost.
-Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
+> *Ce package vous permet d’installer Mindmaps rapidement et simplement sur un serveur YunoHost.
+Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.*
-## Vue d'ensemble
+## Vue d’ensemble
Mindmaps est une application de mind mapping basée sur HTML5. Il vous permet de créer des cartes mentales soignées dans le navigateur.
-**Version incluse :** 0.0.20201010~ynh2
+**Version incluse :** 0.0.20201010~ynh3
**Démo :** https://www.mindmaps.app/
-## Captures d'écran
+## Captures d’écran
-![Capture d'écran de Mindmaps](./doc/screenshots/mindmaps-screenshot.jpg)
+![Capture d’écran de Mindmaps](./doc/screenshots/mindmaps-screenshot.jpg)
## Documentations et ressources
-* Site officiel de l'app :
-* Dépôt de code officiel de l'app :
+* Site officiel de l’app :
+* Dépôt de code officiel de l’app :
* Documentation YunoHost pour cette app :
* Signaler un bug :
@@ -44,4 +44,4 @@ ou
sudo yunohost app upgrade mindmaps -u https://github.com/YunoHost-Apps/mindmaps_ynh/tree/testing --debug
```
-**Plus d'infos sur le packaging d'applications :**
+**Plus d’infos sur le packaging d’applications :**
\ No newline at end of file
diff --git a/conf/nginx.conf b/conf/nginx.conf
index 508fc0a..9782b91 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -2,7 +2,7 @@
location __PATH__/ {
# Path to source
- alias __FINALPATH__/ ;
+ alias __FINALPATH__/;
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
diff --git a/manifest.json b/manifest.json
index 905053f..7bc3fc4 100644
--- a/manifest.json
+++ b/manifest.json
@@ -6,7 +6,7 @@
"en": "Tool for making mind maps",
"fr": "Outil de creation de cartes mentales"
},
- "version": "0.0.20201010~ynh2",
+ "version": "0.0.20201010~ynh3",
"url": "https://www.mindmaps.app/",
"upstream": {
"license": "AGPL-3.0",
diff --git a/scripts/install b/scripts/install
index bdb3caf..e92514b 100755
--- a/scripts/install
+++ b/scripts/install
@@ -45,6 +45,14 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
+#=================================================
+# CREATE DEDICATED USER
+#=================================================
+ynh_script_progression --message="Configuring system user..." --weight=1
+
+# Create a system user
+ynh_system_user_create --username=$app --home_dir="$final_path"
+
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@@ -56,7 +64,7 @@ mv ../sources/dist "$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
-chown -R root:www-data "$final_path"
+chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
diff --git a/scripts/remove b/scripts/remove
index 6ddb24d..ca77eea 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -35,6 +35,16 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
# Remove the dedicated NGINX config
ynh_remove_nginx_config
+#=================================================
+# GENERIC FINALIZATION
+#=================================================
+# REMOVE DEDICATED USER
+#=================================================
+ynh_script_progression --message="Removing the dedicated system user..." --weight=1
+
+# Delete a system user
+ynh_system_user_delete --username=$app
+
#=================================================
# END OF SCRIPT
#=================================================
diff --git a/scripts/restore b/scripts/restore
index 3fbf90b..12cdf29 100755
--- a/scripts/restore
+++ b/scripts/restore
@@ -33,7 +33,18 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=2
-test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
+test ! -d $final_path \
+ || ynh_die --message="There is already a directory: $final_path "
+
+#=================================================
+# STANDARD RESTORATION STEPS
+#=================================================
+# RECREATE THE DEDICATED USER
+#=================================================
+ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
+
+# Create the dedicated user (if not existing)
+ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# STANDARD RESTORATION STEPS
@@ -53,7 +64,7 @@ ynh_restore_file "$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
-chown -R root:www-data "$final_path"
+chown -R $app:www-data "$final_path"
#=================================================
# GENERIC FINALIZATION
diff --git a/scripts/upgrade b/scripts/upgrade
index 7576cdc..2efdde2 100755
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -60,6 +60,14 @@ if ynh_legacy_permissions_exists; then
ynh_app_setting_delete --app=$app --key=is_public
fi
+#=================================================
+# CREATE DEDICATED USER
+#=================================================
+ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
+
+# Create a dedicated user (if not existing)
+ynh_system_user_create --username=$app --home_dir="$final_path"
+
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@@ -76,7 +84,7 @@ fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
-chown -R root:www-data "$final_path"
+chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION