diff --git a/README.md b/README.md
index ceab4eb..454509e 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,7 @@ BookWyrm is a social network for tracking your reading, talking about books, wri
* Official app website:
* Official admin documentation:
* Upstream app code repository:
+* YunoHost Store:
* Report a bug:
## Developer info
diff --git a/README_fr.md b/README_fr.md
index ecc7061..c58878d 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -32,6 +32,7 @@ BookWyrm est un réseau social pour garder la trace de vos lectures, parler de l
* Site officiel de l’app :
* Documentation officielle de l’admin :
* Dépôt de code officiel de l’app :
+* YunoHost Store:
* Signaler un bug :
## Informations pour les développeurs
diff --git a/conf/.env.production b/conf/.env.production
index c05bcbf..0aaf35e 100644
--- a/conf/.env.production
+++ b/conf/.env.production
@@ -47,11 +47,11 @@ FLOWER_PASSWORD=changeme
# Email config
EMAIL_HOST=localhost
EMAIL_PORT=587
-EMAIL_HOST_USER=__ADMIN_MAIL__
-EMAIL_HOST_PASSWORD=
+EMAIL_HOST_USER=__APP__
+EMAIL_HOST_PASSWORD=__MAIL_PWD__
EMAIL_USE_TLS=true
EMAIL_USE_SSL=false
-EMAIL_SENDER_NAME=__ADMIN_MAIL__
+EMAIL_SENDER_NAME=__APP__
# defaults to DOMAIN
#EMAIL_SENDER_DOMAIN=
diff --git a/manifest.toml b/manifest.toml
index 3962534..0daced5 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -57,6 +57,7 @@ ram.runtime = "50M"
[resources.system_user]
+ allow_email = true
[resources.install_dir]
diff --git a/scripts/install b/scripts/install
index 873e4e8..1255feb 100755
--- a/scripts/install
+++ b/scripts/install
@@ -9,9 +9,8 @@
source _common.sh
source /usr/share/yunohost/helpers
-
-admin_mail=$(ynh_user_get_info --username=$admin --key=username)
key=$(ynh_string_random --length=32)
+ynh_app_setting_set --app=$app --key=key --value=$key
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
diff --git a/scripts/upgrade b/scripts/upgrade
index f6ee5d6..a73deb4 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -13,7 +13,11 @@ source /usr/share/yunohost/helpers
# LOAD SETTINGS
#=================================================
-admin_mail=$(ynh_user_get_info --username=$admin --key=username)
+# uncomment me after some updates whenever the key variable is set in install for some times
+#key=$(ynh_app_setting_get --app=$app --key=key --value=$key)
+
+#remove me when key setting is uncommented (see above)
+key=$(ynh_string_random --length=32)
#=================================================
# CHECK VERSION
@@ -48,6 +52,17 @@ chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
+#=================================================
+# CONFIGURE THE INSTALL SCRIPT
+#=================================================
+ynh_script_progression --message="Upgrading .env file..." --weight=1
+
+ynh_add_config --template="../conf/.env.production" --destination="$install_dir/.env"
+chmod 600 $install_dir/.env
+chown $app: "$install_dir/.env"
+
+set -a; source "$install_dir/.env"; set +a
+
#=================================================
# CONFIGURE THEN INSTALL SCRIPT AND DEPENDENCIES