From 3a54a4d4b83c22940ca976799898ca99f8687c6c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 3 Sep 2023 15:15:14 +0200 Subject: [PATCH 01/34] add email --- conf/.env.production | 6 +++--- manifest.toml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index 1765397..797a773 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -23,9 +23,9 @@ REDIS_URL=redis:// # API_RATE_LIMITS="300 per 5 minutes" # Emails -# UI_URL=__DOMAIN__ -# EMAIL_URL= -# SENDER_EMAIL= +UI_URL=__DOMAIN__ +EMAIL_URL=smtp://__APP__:__MAIL_PWD__@127.0.0.1:25 +SENDER_EMAIL=__APP__@__DOMAIN__ # WORKERS_PROCESSES= # Workouts diff --git a/manifest.toml b/manifest.toml index 9d3a986..149ad42 100644 --- a/manifest.toml +++ b/manifest.toml @@ -63,6 +63,7 @@ ram.runtime = "50M" [resources] [resources.system_user] + allow_email = true [resources.install_dir] From 023e38af24eec30716596b225e86085b20ce47ff Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:57:15 +0200 Subject: [PATCH 02/34] Update .env.production --- conf/.env.production | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env.production b/conf/.env.production index 797a773..ea9fa1e 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,7 +24,7 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__APP__:__MAIL_PWD__@127.0.0.1:25 +EMAIL_URL=smtp://__APP__:__MAIL_PWD__@__DOMAIN__:587/?tls=True SENDER_EMAIL=__APP__@__DOMAIN__ # WORKERS_PROCESSES= From ed10c510b1b2fb96abf9771887b9ec2830c41587 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 16:13:56 +0200 Subject: [PATCH 03/34] Update .env.production --- conf/.env.production | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index ea9fa1e..5990646 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,8 +24,8 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__APP__:__MAIL_PWD__@__DOMAIN__:587/?tls=True -SENDER_EMAIL=__APP__@__DOMAIN__ +EMAIL_URL=smtp://__ADMIN__:__PASSWORD__@__MAIN_DOMAIN__:587/?tls=True +SENDER_EMAIL=__ADMIN__@__MAIN_DOMAIN__ # WORKERS_PROCESSES= # Workouts From 15d00cef4995997e389f2195134568ab5cf03a6c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 16:57:10 +0200 Subject: [PATCH 04/34] Update install --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index b82298b..abc2a10 100755 --- a/scripts/install +++ b/scripts/install @@ -12,6 +12,9 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) +// Retrieve YunoHost main domain +$main_domain = exec('cat /etc/yunohost/current_host'); + #================================================= # LOGROTATE ynh_script_progression --message="Configuring logrotate to manage application logfiles" --weight=1 From 912088bffc3884f9132aa361a0dab20241921098 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 17:33:13 +0200 Subject: [PATCH 05/34] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index abc2a10..7aa253b 100755 --- a/scripts/install +++ b/scripts/install @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -// Retrieve YunoHost main domain +# Retrieve YunoHost main domain $main_domain = exec('cat /etc/yunohost/current_host'); #================================================= From 08ce7bdb243a548c929d4a7913b72c3c0aeeb5d3 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 17:53:14 +0200 Subject: [PATCH 06/34] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 7aa253b..3183095 100755 --- a/scripts/install +++ b/scripts/install @@ -13,7 +13,7 @@ admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) # Retrieve YunoHost main domain -$main_domain = exec('cat /etc/yunohost/current_host'); +main_domain=$(cat /etc/yunohost/current_host) #================================================= # LOGROTATE From ca3c8fd77355f05323d7e3850c38dd390a0a14d0 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:26:59 +0200 Subject: [PATCH 07/34] Update .env.production --- conf/.env.production | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index 5990646..839494e 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,8 +24,8 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__ADMIN__:__PASSWORD__@__MAIN_DOMAIN__:587/?tls=True -SENDER_EMAIL=__ADMIN__@__MAIN_DOMAIN__ +EMAIL_URL=smtp://__ADMIN__:__PASSWORD__@__MDOMAIN__:587/?tls=True +SENDER_EMAIL=__ADMIN__@__DOMAIN__ # WORKERS_PROCESSES= # Workouts From c5ebde400b611ac43d0a679d2acd2ee42b4faed1 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:27:17 +0200 Subject: [PATCH 08/34] Update .env.production --- conf/.env.production | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env.production b/conf/.env.production index 839494e..3a5a23d 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,7 +24,7 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__ADMIN__:__PASSWORD__@__MDOMAIN__:587/?tls=True +EMAIL_URL=smtp://__ADMIN__:__PASSWORD__@__DOMAIN__:587/?tls=True SENDER_EMAIL=__ADMIN__@__DOMAIN__ # WORKERS_PROCESSES= From aa3a43bcbc9f2b61409b9233a37b9019821456b0 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:37:52 +0200 Subject: [PATCH 09/34] Update .env.production --- conf/.env.production | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index 3a5a23d..8f7ff71 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,8 +24,8 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__ADMIN__:__PASSWORD__@__DOMAIN__:587/?tls=True -SENDER_EMAIL=__ADMIN__@__DOMAIN__ +EMAIL_URL=smtp://__APP__:__MAIL_PWD__@__MAIN_DOMAIN__:587/?tls=True +SENDER_EMAIL=__APP__@__MAIN_DOMAIN__ # WORKERS_PROCESSES= # Workouts From 22567ec8bf0185ba9fefc412465bdc217f0d16a3 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 20:06:23 +0200 Subject: [PATCH 10/34] Update upgrade --- scripts/upgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 4cfe6f1..054866d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,6 +16,9 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) +# Retrieve YunoHost main domain +main_domain=$(cat /etc/yunohost/current_host) + #================================================= # CHECK VERSION #================================================= From 9c8347672fd0b523fe567b86e935a06713fa4d2e Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 20:14:01 +0200 Subject: [PATCH 11/34] fix logs --- conf/fittrackee.service | 2 +- scripts/install | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/fittrackee.service b/conf/fittrackee.service index 205b26c..5cab9e3 100644 --- a/conf/fittrackee.service +++ b/conf/fittrackee.service @@ -29,7 +29,7 @@ Environment="STATICMAP_SUBDOMAINS=" Environment="MAP_ATTRIBUTION=" Environment="WEATHER_API_KEY=" WorkingDirectory=__INSTALL_DIR__/ -ExecStart=__INSTALL_DIR__/venv/bin/gunicorn -b 127.0.0.1:__PORT__ "fittrackee:create_app()" --error-logfile /var/log/__APP__/gunicorn.log +ExecStart=__INSTALL_DIR__/venv/bin/gunicorn -b 127.0.0.1:__PORT__ "fittrackee:create_app()" --error-logfile /var/log/__APP__/__APP__.log diff --git a/scripts/install b/scripts/install index 3183095..7a65281 100755 --- a/scripts/install +++ b/scripts/install @@ -107,7 +107,7 @@ ynh_add_systemd_config --service="${app}_workers" --template="fittrackee_workers # INTEGRATE SERVICE IN YUNOHOST ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "${app}" --description="Fittrackee main service" --log="/var/log/$app/$app.log" --log="/var/log/$app/gunicorn.log" +yunohost service add "${app}" --description="Fittrackee main service" --log="/var/log/$app/$app.log" yunohost service add "${app}_workers" --description="Fittrackee task queue service" --log="var/log/$app/${app}_workers.log" diff --git a/scripts/upgrade b/scripts/upgrade index 054866d..ced38d6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,7 +120,7 @@ ynh_add_systemd_config --service="${app}_workers" --template="fittrackee_workers #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "${app}" --description="Fittrackee main service" --log="/var/log/$app/$app.log" --log="/var/log/$app/gunicorn.log" +yunohost service add "${app}" --description="Fittrackee main service" --log="/var/log/$app/$app.log" yunohost service add "${app}_workers" --description="Fittrackee task queue service" --log="var/log/$app/${app}_workers.log" #================================================= From d4b1f5b5b854bb1fd28d989a86a44120d8744b77 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Sep 2023 20:14:34 +0200 Subject: [PATCH 12/34] fix logs --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 458f492..be9370f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -67,7 +67,7 @@ systemctl enable "${app}_workers.service" --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "${app}" --description="Fittrackee main service" --log="/var/log/$app/$app.log" --log="/var/log/$app/gunicorn.log" +yunohost service add "${app}" --description="Fittrackee main service" --log="/var/log/$app/$app.log" yunohost service add "${app}_workers" --description="Fittrackee task queue service" --log="var/log/$app/${app}_workers.log" #================================================= From 1865f2f4967936b5b6449106418387f3ad46036a Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 08:39:35 +0200 Subject: [PATCH 13/34] Update .env.production --- conf/.env.production | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index 8f7ff71..5990646 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,8 +24,8 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__APP__:__MAIL_PWD__@__MAIN_DOMAIN__:587/?tls=True -SENDER_EMAIL=__APP__@__MAIN_DOMAIN__ +EMAIL_URL=smtp://__ADMIN__:__PASSWORD__@__MAIN_DOMAIN__:587/?tls=True +SENDER_EMAIL=__ADMIN__@__MAIN_DOMAIN__ # WORKERS_PROCESSES= # Workouts From f8b40179a514f8621232c099627c27f0028b7467 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:53:50 +0200 Subject: [PATCH 14/34] refactor to use config_panel --- conf/.env.production | 4 ++-- config_panel.toml | 24 ++++++++++++++++++++++++ scripts/install | 6 +++--- scripts/upgrade | 3 --- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index 5990646..1d9dca1 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,8 +24,8 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__ADMIN__:__PASSWORD__@__MAIN_DOMAIN__:587/?tls=True -SENDER_EMAIL=__ADMIN__@__MAIN_DOMAIN__ +EMAIL_URL=smtp://__USER_MAIL__:__MAIL_PASSWORD__@__MAIL_DOMAIN__:587/?tls=True +SENDER_EMAIL=__USER_MAIL__@__MAIL_DOMAIN__ # WORKERS_PROCESSES= # Workouts diff --git a/config_panel.toml b/config_panel.toml index b9ad4bc..11fef63 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -44,4 +44,28 @@ services = ["__APP__", "__APP___workers"] help.fr = "Insérer la clé api donnée par le fournisseur météo choisi" bind = "WEATHER_API_KEY:/var/www/__APP__/.env" + [main.config.USER_MAIL] + ask.en = "Configure the user mail" + ask.fr = "Configurer le courriel utilisateur" + type = "string" + bind = "USER_MAIL:/var/www/__APP__/.env" + + [main.config.MAIL_PASSWORD] + ask.en = "Configure the password of the determined mail user" + ask.fr = "Configurer le mot de passe de l’utilisateur mail choisi" + type = "string" + bind = "MAIL_PASSWORD:/var/www/__APP__/.env" + + [main.config.MAIL_DOMAIN] + ask.en = "Configure the server address" + ask.fr = "Configurer l’adresse du serveur" + type = "string" + help.en = "e.g. mydomain.com" + help.fr = "ex. : mondomain.com" + bind = "MAIL_DOMAIN:/var/www/__APP__/.env" + + + + + \ No newline at end of file diff --git a/scripts/install b/scripts/install index 7a65281..b64e986 100755 --- a/scripts/install +++ b/scripts/install @@ -11,9 +11,9 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) - -# Retrieve YunoHost main domain -main_domain=$(cat /etc/yunohost/current_host) +user_mail=$($app) +mail_password=$($mail_pwd) +mail_domain=$($domain) #================================================= # LOGROTATE diff --git a/scripts/upgrade b/scripts/upgrade index ced38d6..c4b7b25 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,9 +16,6 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -# Retrieve YunoHost main domain -main_domain=$(cat /etc/yunohost/current_host) - #================================================= # CHECK VERSION #================================================= From c773210b6a2f7a1ecbe1338f33ddd6b4e8584bc7 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:07:45 +0200 Subject: [PATCH 15/34] fix --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index c4b7b25..795355e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,6 +15,10 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) +user_mail=$($app) +mail_password=$($mail_pwd) +mail_domain=$($domain) + #================================================= # CHECK VERSION From f3227345957484ec7913f476597273b300c7e43c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:20:19 +0200 Subject: [PATCH 16/34] Update upgrade --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 795355e..b2f3985 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,9 +15,9 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -user_mail=$($app) -mail_password=$($mail_pwd) -mail_domain=$($domain) +user_mail=$app +mail_password=$mail_pwd +mail_domain=$domain #================================================= From fb9b0d4f8767e4f566c7d509110e5acc88c03d7e Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:26:02 +0200 Subject: [PATCH 17/34] Update install --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index b64e986..a4325c3 100755 --- a/scripts/install +++ b/scripts/install @@ -11,9 +11,9 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -user_mail=$($app) -mail_password=$($mail_pwd) -mail_domain=$($domain) +user_mail=$app +mail_password=$mail_pwd +mail_domain=$domain #================================================= # LOGROTATE From 75de3654f966b181dd5a57832b66f8c8b60dae98 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:33:02 +0200 Subject: [PATCH 18/34] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index b2f3985..08a91c4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -user_mail=$app +mail_user=$app mail_password=$mail_pwd mail_domain=$domain From 26ebe4fc58e8fa7636c9c42ff13307e79f394210 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:33:23 +0200 Subject: [PATCH 19/34] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index a4325c3..22fb4b2 100755 --- a/scripts/install +++ b/scripts/install @@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -user_mail=$app +mail_user=$app mail_password=$mail_pwd mail_domain=$domain From 64c9c08ab144e2e6a88206afb49b75c9d7b71cb1 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:34:24 +0200 Subject: [PATCH 20/34] Update config_panel.toml --- config_panel.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 11fef63..e60e868 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -44,11 +44,11 @@ services = ["__APP__", "__APP___workers"] help.fr = "Insérer la clé api donnée par le fournisseur météo choisi" bind = "WEATHER_API_KEY:/var/www/__APP__/.env" - [main.config.USER_MAIL] + [main.config.mail_user] ask.en = "Configure the user mail" ask.fr = "Configurer le courriel utilisateur" type = "string" - bind = "USER_MAIL:/var/www/__APP__/.env" + bind = "MAIL_USER:/var/www/__APP__/.env" [main.config.MAIL_PASSWORD] ask.en = "Configure the password of the determined mail user" @@ -68,4 +68,4 @@ services = ["__APP__", "__APP___workers"] - \ No newline at end of file + From 1aabe77158b5545ed5f4d2bda86757a04c595d0c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:35:02 +0200 Subject: [PATCH 21/34] Update .env.production --- conf/.env.production | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index 1d9dca1..4d62c30 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,8 +24,8 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__USER_MAIL__:__MAIL_PASSWORD__@__MAIL_DOMAIN__:587/?tls=True -SENDER_EMAIL=__USER_MAIL__@__MAIL_DOMAIN__ +EMAIL_URL=smtp://__MAIL_USER__:__MAIL_PASSWORD__@__MAIL_DOMAIN__:587/?tls=True +SENDER_EMAIL=__MAIL_USER__@__MAIL_DOMAIN__ # WORKERS_PROCESSES= # Workouts From 288552b74714c4bf1365018712116816b1b2397d Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:48:24 +0200 Subject: [PATCH 22/34] Update install --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 22fb4b2..b4b4cf1 100755 --- a/scripts/install +++ b/scripts/install @@ -11,9 +11,9 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -mail_user=$app -mail_password=$mail_pwd -mail_domain=$domain +mail_user="$app" +mail_password="$mail_pwd" +mail_domain="$domain" #================================================= # LOGROTATE From 32c65d50d3f6e97f2501f6825bac22e0d960bd44 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:49:04 +0200 Subject: [PATCH 23/34] Update upgrade --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 08a91c4..008df5d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,9 +15,9 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -mail_user=$app -mail_password=$mail_pwd -mail_domain=$domain +mail_user="$app" +mail_password="$mail_pwd" +mail_domain="$domain" #================================================= From 924fbec70c04a3f57ad31f854ece7ebc0a62074a Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 19:26:59 +0200 Subject: [PATCH 24/34] test --- conf/.env.production | 4 ++-- config_panel.toml | 24 +----------------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index 4d62c30..90d6176 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,8 +24,8 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__MAIL_USER__:__MAIL_PASSWORD__@__MAIL_DOMAIN__:587/?tls=True -SENDER_EMAIL=__MAIL_USER__@__MAIL_DOMAIN__ +EMAIL_URL=smtp://__APP__:__MAIL_PWD__@__DOMAIN__:465/?ssl=True +SENDER_EMAIL=__APP__@__DOMAIN__ # WORKERS_PROCESSES= # Workouts diff --git a/config_panel.toml b/config_panel.toml index e60e868..75e9748 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -44,28 +44,6 @@ services = ["__APP__", "__APP___workers"] help.fr = "Insérer la clé api donnée par le fournisseur météo choisi" bind = "WEATHER_API_KEY:/var/www/__APP__/.env" - [main.config.mail_user] - ask.en = "Configure the user mail" - ask.fr = "Configurer le courriel utilisateur" - type = "string" - bind = "MAIL_USER:/var/www/__APP__/.env" - - [main.config.MAIL_PASSWORD] - ask.en = "Configure the password of the determined mail user" - ask.fr = "Configurer le mot de passe de l’utilisateur mail choisi" - type = "string" - bind = "MAIL_PASSWORD:/var/www/__APP__/.env" - - [main.config.MAIL_DOMAIN] - ask.en = "Configure the server address" - ask.fr = "Configurer l’adresse du serveur" - type = "string" - help.en = "e.g. mydomain.com" - help.fr = "ex. : mondomain.com" - bind = "MAIL_DOMAIN:/var/www/__APP__/.env" - - - - + From 515cf3e378792cd187cdc224798e933ae50e8c39 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:51:09 +0200 Subject: [PATCH 25/34] fix --- scripts/install | 3 --- scripts/upgrade | 4 ---- 2 files changed, 7 deletions(-) diff --git a/scripts/install b/scripts/install index b4b4cf1..a900e26 100755 --- a/scripts/install +++ b/scripts/install @@ -11,9 +11,6 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -mail_user="$app" -mail_password="$mail_pwd" -mail_domain="$domain" #================================================= # LOGROTATE diff --git a/scripts/upgrade b/scripts/upgrade index 008df5d..c4b7b25 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,10 +15,6 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -mail_user="$app" -mail_password="$mail_pwd" -mail_domain="$domain" - #================================================= # CHECK VERSION From c9a576d15e7c90332b98ce8bcf88acf515b337ba Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:52:12 +0200 Subject: [PATCH 26/34] revert to 587 --- conf/.env.production | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env.production b/conf/.env.production index 90d6176..ea9fa1e 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -24,7 +24,7 @@ REDIS_URL=redis:// # Emails UI_URL=__DOMAIN__ -EMAIL_URL=smtp://__APP__:__MAIL_PWD__@__DOMAIN__:465/?ssl=True +EMAIL_URL=smtp://__APP__:__MAIL_PWD__@__DOMAIN__:587/?tls=True SENDER_EMAIL=__APP__@__DOMAIN__ # WORKERS_PROCESSES= From 42f0a476bc85a523c075ef38bb10b4cba1a474b9 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Fri, 15 Sep 2023 20:25:51 +0200 Subject: [PATCH 27/34] add config --- config_panel.toml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config_panel.toml b/config_panel.toml index 75e9748..00f6e9d 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -44,6 +44,20 @@ services = ["__APP__", "__APP___workers"] help.fr = "Insérer la clé api donnée par le fournisseur météo choisi" bind = "WEATHER_API_KEY:/var/www/__APP__/.env" + [main.config.email_url] + ask.en = "Change SMTP mail address" + ask.fr = "Changer l’adresse courriel SMTP" + type = "string" + help.en = "Has to be like this: smtp://username:password@example.com:587/?tls=True" + help.fr = "Doit avoir la forme suivante : smtp://username:password@example.com:587/?tls=True" + bind = "email_url:/var/www/__APP__/.env" + + [main.config.sender_email] + ask.en = "Change sender email" + ask.fr = "Changer l’adresse courriel d’envoi" + type = "email" + bind = "sender_email:/var/www/__APP__/.env" + From 701435941b6e3cf6e92b43fe39b5aca7ac4dc2eb Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 10 Oct 2023 13:55:52 +0200 Subject: [PATCH 28/34] Update config_panel.toml --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 00f6e9d..3f93a3d 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -48,8 +48,8 @@ services = ["__APP__", "__APP___workers"] ask.en = "Change SMTP mail address" ask.fr = "Changer l’adresse courriel SMTP" type = "string" - help.en = "Has to be like this: smtp://username:password@example.com:587/?tls=True" - help.fr = "Doit avoir la forme suivante : smtp://username:password@example.com:587/?tls=True" + help.en = "Has to be like this: smtp://username:password@example.com:587/?tls=True. /!\ Please backup your original credentials for the case you want to reset it. " + help.fr = "Doit avoir la forme suivante : smtp://username:password@example.com:587/?tls=True. /!\ Veuillez sauvegarder vos coordonnées initiales au cas où vous voudriez les réinitialiser." bind = "email_url:/var/www/__APP__/.env" [main.config.sender_email] From ab6ce58ff2164c7b2ea877ab38aa38646852e4bd Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 10 Oct 2023 11:55:57 +0000 Subject: [PATCH 29/34] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index b784d67..410f3aa 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ No mobile app has been developed yet, but several existing mobile apps can store * Official app website: * Official admin documentation: * Upstream app code repository: -* YunoHost documentation for this app: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 3797282..74d6ce1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -30,7 +30,6 @@ Aucune application mobile n'a encore été développée, mais plusieurs applicat * Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : * Signaler un bug : ## Informations pour les développeurs From 1d8fef0a326cdd218d7b8b1530d233b004315e6e Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 10 Oct 2023 13:57:34 +0200 Subject: [PATCH 30/34] Fix formatting issue --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 3f93a3d..738ab0a 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -48,8 +48,8 @@ services = ["__APP__", "__APP___workers"] ask.en = "Change SMTP mail address" ask.fr = "Changer l’adresse courriel SMTP" type = "string" - help.en = "Has to be like this: smtp://username:password@example.com:587/?tls=True. /!\ Please backup your original credentials for the case you want to reset it. " - help.fr = "Doit avoir la forme suivante : smtp://username:password@example.com:587/?tls=True. /!\ Veuillez sauvegarder vos coordonnées initiales au cas où vous voudriez les réinitialiser." + help.en = "Has to be like this: smtp://username:password@example.com:587/?tls=True. ❗ Please backup your original credentials for the case you want to reset it. " + help.fr = "Doit avoir la forme suivante : smtp://username:password@example.com:587/?tls=True. ❗ Veuillez sauvegarder vos coordonnées initiales au cas où vous voudriez les réinitialiser." bind = "email_url:/var/www/__APP__/.env" [main.config.sender_email] From 44ca253bd2c4afcd6d868c987ed99d314986a9b6 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:04:16 +0200 Subject: [PATCH 31/34] some cleaning --- conf/fittrackee.service | 6 ------ manifest.toml | 2 +- scripts/install | 4 ---- scripts/restore | 1 - tests.toml | 3 ++- 5 files changed, 3 insertions(+), 13 deletions(-) diff --git a/conf/fittrackee.service b/conf/fittrackee.service index 5cab9e3..91b859a 100644 --- a/conf/fittrackee.service +++ b/conf/fittrackee.service @@ -32,12 +32,6 @@ WorkingDirectory=__INSTALL_DIR__/ ExecStart=__INSTALL_DIR__/venv/bin/gunicorn -b 127.0.0.1:__PORT__ "fittrackee:create_app()" --error-logfile /var/log/__APP__/__APP__.log - - - - - - # Denying access to capabilities that should not be relevant for webapps # Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD diff --git a/manifest.toml b/manifest.toml index f953b67..1ba8475 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "FitTrackee" description.en = "Self-hosted outdoor activity tracker 🚴" description.fr = "Traqueur d’activités extérieures auto-hébergé 🚴" -version = "0.7.25~ynh1" +version = "0.7.25~ynh2" maintainers = ["Thovi98"] diff --git a/scripts/install b/scripts/install index b49e7f1..b73c55f 100755 --- a/scripts/install +++ b/scripts/install @@ -20,7 +20,6 @@ ynh_script_progression --message="Configuring logrotate to manage application lo ynh_use_logrotate --specific_user=$app touch /var/log/$app/$app.log touch /var/log/$app/${app}_workers.log -touch /var/log/$app/gunicorn.log chown -R $app:www-data /var/log/$app/ #================================================= @@ -115,9 +114,6 @@ yunohost service add "${app}_workers" --description="Fittrackee task queue servi #================================================= # GENERIC FINALIZATION #================================================= - - - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/restore b/scripts/restore index be9370f..cdb059f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -23,7 +23,6 @@ ynh_script_progression --message="Configuring logrotate to manage application lo ynh_use_logrotate --specific_user=$app touch /var/log/$app/$app.log touch /var/log/$app/${app}_workers.log -touch /var/log/$app/gunicorn.log chown -R $app:www-data /var/log/$app/ #================================================= diff --git a/tests.toml b/tests.toml index 78078a6..dabba6b 100644 --- a/tests.toml +++ b/tests.toml @@ -20,4 +20,5 @@ test_format = 1.0 test_upgrade_from.9c094f9.name = "0.7.21" test_upgrade_from.e49294c.name = "0.7.22" test_upgrade_from.a446e8c.name = "0.7.23" - test_upgrade_from.316dea4.name = "0.7.24" \ No newline at end of file + test_upgrade_from.316dea4.name = "0.7.24" + test_upgrade_from.ea68daf.name = "0.7.25~ynh1" \ No newline at end of file From e1f7ddef68485dd37f3a4aa97a521643db91f20b Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 10 Oct 2023 12:04:21 +0000 Subject: [PATCH 32/34] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9017816..5b741c5 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ FitTrackee allows you to track your outdoor activities (workouts) from gpx files No mobile app has been developed yet, but several existing mobile apps can store workouts data locally and export them into a gpx file. -**Shipped version:** 0.7.25~ynh1 +**Shipped version:** 0.7.25~ynh2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index f711949..cc54c3e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po FitTrackee vous permet de suivre vos activités de plein air (séances d'entraînement) à partir de fichiers gpx et de conserver vos données sur votre propre serveur. Aucune application mobile n'a encore été développée, mais plusieurs applications mobiles existantes peuvent stocker localement les données des séances d'entraînement et les exporter dans un fichier gpx. -**Version incluse :** 0.7.25~ynh1 +**Version incluse :** 0.7.25~ynh2 ## Captures d’écran From 5a86ce12df198c5c19b53aabcb5eaa95cb9bb090 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 10 Oct 2023 19:11:03 +0200 Subject: [PATCH 33/34] add a pre_upgrade.d about emails --- doc/ADMIN.md | 2 +- doc/ADMIN_fr.md | 2 +- doc/PRE_UPGRADE.d/0.7.25~ynh2.md | 13 +++++++++++++ manifest.toml | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 doc/PRE_UPGRADE.d/0.7.25~ynh2.md diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 56c7941..26ca4d5 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -4,7 +4,7 @@ If you have to use the [command line interface (cli)](https://samr1.github.io/Fi ``` pushd $install_dir/ - pipenv shell + source $install_dir/venv/bin/activate ftcli [OPTIONS] COMMAND [ARGS]... ``` diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index b4614bb..b623e45 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -4,7 +4,7 @@ Si vous avez besoin d’utiliser la [ligne de commande](https://samr1.github.io/ ``` pushd $install_dir/ - pipenv shell + source $install_dir/venv/bin/activate ftcli [OPTIONS] COMMAND [ARGS]... ``` diff --git a/doc/PRE_UPGRADE.d/0.7.25~ynh2.md b/doc/PRE_UPGRADE.d/0.7.25~ynh2.md new file mode 100644 index 0000000..fe54c7f --- /dev/null +++ b/doc/PRE_UPGRADE.d/0.7.25~ynh2.md @@ -0,0 +1,13 @@ +Great news! +Since latest Yunohost version 11.2.5, it’s now possible for FitTrackee to send mails 🥳 + +By default, your mail credentials are automatically set with the __DOMAIN__ where your installed FitTrackee. +You can change it in the config_panel (but be sure to save the initial data, in case you want revert your changes). + +NB: nohost.me/noho.st/ynh.fr domains are special domains handled by Yunohost. If you installed FitTrackee on a subdomain such as fittrackee.mydomain.nohost.me, emails will be blocked. You will have either to + 1. install FitTrackee on a "real" domain; + 2. change your mail credentials in the config_panel. + +Don’t hesitate to raise an issue on the [forum](https://forum.yunohost.org/t/fittrackee-self-hosted-outdoor-activity-tracker/24141) or on [Github](https://github.com/YunoHost-Apps/fittrackee_ynh). + +Enjoy this app and thanks to @SamR1 for creating it! \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 1ba8475..0cf4160 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ admindoc = "https://samr1.github.io/FitTrackee" code = "https://github.com/SamR1/FitTrackee" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.5" architectures = "all" multi_instance = true ldap = false From 4ebb1d2a1dbf00ac005165b882527ff6c268b647 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 10 Oct 2023 19:22:39 +0200 Subject: [PATCH 34/34] clean pre_upgrade message --- doc/PRE_UPGRADE.d/0.7.25~ynh2.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/PRE_UPGRADE.d/0.7.25~ynh2.md b/doc/PRE_UPGRADE.d/0.7.25~ynh2.md index fe54c7f..db32199 100644 --- a/doc/PRE_UPGRADE.d/0.7.25~ynh2.md +++ b/doc/PRE_UPGRADE.d/0.7.25~ynh2.md @@ -4,10 +4,10 @@ Since latest Yunohost version 11.2.5, it’s now possible for FitTrackee to send By default, your mail credentials are automatically set with the __DOMAIN__ where your installed FitTrackee. You can change it in the config_panel (but be sure to save the initial data, in case you want revert your changes). -NB: nohost.me/noho.st/ynh.fr domains are special domains handled by Yunohost. If you installed FitTrackee on a subdomain such as fittrackee.mydomain.nohost.me, emails will be blocked. You will have either to - 1. install FitTrackee on a "real" domain; +NB: `nohost.me`/`noho.st`/`ynh.fr` domains are special domains handled by Yunohost. If you installed FitTrackee on a subdomain such as fittrackee.mydomain.nohost.me, emails will be blocked. You will have either to: + 1. install FitTrackee on a "real" domain; or 2. change your mail credentials in the config_panel. Don’t hesitate to raise an issue on the [forum](https://forum.yunohost.org/t/fittrackee-self-hosted-outdoor-activity-tracker/24141) or on [Github](https://github.com/YunoHost-Apps/fittrackee_ynh). -Enjoy this app and thanks to @SamR1 for creating it! \ No newline at end of file +Enjoy this app and thanks to @SamR1 for creating it!