From 41fc572227287258c6bce11be1470f1392429130 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:16:42 +0100 Subject: [PATCH 01/11] fix #44 (new try) --- scripts/change_url | 4 ++-- scripts/upgrade | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 63342db..5aaba14 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -13,8 +13,8 @@ source /usr/share/yunohost/helpers # LOAD SETTINGS #================================================= -admin=$(ynh_user_get_info --username=$admin --key=username) -admin_mail=$(ynh_user_get_info --username=$admin --key=mail) +weather_provider=$(ynh_app_setting_get --app=$app --key=$weather_provider) +weather_key=$(ynh_app_setting_get --app=$app --key=$weather_key) #================================================= # STANDARD UPGRADE STEPS diff --git a/scripts/upgrade b/scripts/upgrade index e5367b2..8b3f4de 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,9 +16,8 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -ynh_app_setting_set --app=$app --key=weather_provider --value=$weather_provider -ynh_app_setting_set --app=$app --key=weather_key --value=$weather_key - +weather_provider=$(ynh_app_setting_get --app=$app --key=$weather_provider) +weather_key=$(ynh_app_setting_get --app=$app --key=$weather_key) #================================================= # CHECK VERSION From 501af4cf29bd27b025d71b07fc07f5499af75738 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Dec 2023 20:18:22 +0100 Subject: [PATCH 02/11] fix commit --- scripts/change_url | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 5aaba14..fedb9ea 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -13,6 +13,9 @@ source /usr/share/yunohost/helpers # LOAD SETTINGS #================================================= +admin=$(ynh_user_get_info --username=$admin --key=username) +admin_mail=$(ynh_user_get_info --username=$admin --key=mail) + weather_provider=$(ynh_app_setting_get --app=$app --key=$weather_provider) weather_key=$(ynh_app_setting_get --app=$app --key=$weather_key) From e2fd53ce0f7b243b12e94e43971758ed15cbbfd8 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 17 Dec 2023 16:52:22 +0100 Subject: [PATCH 03/11] make config_panel consistent to prevent issues --- conf/.env.production | 4 ++-- config_panel.toml | 4 ++-- manifest.toml | 4 ++-- scripts/change_url | 3 --- scripts/install | 4 ++-- scripts/upgrade | 20 ++++++++++++++++++-- tests.toml | 3 ++- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/conf/.env.production b/conf/.env.production index bf31765..7d4cb0f 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -36,6 +36,6 @@ STATICMAP_SUBDOMAINS='' # Weather # available weather API providers: darksky, visualcrossing -WEATHER_API_PROVIDER=__WEATHER_PROVIDER__ -WEATHER_API_KEY=__WEATHER_KEY__ +WEATHER_API_PROVIDER=__WEATHER_API_PROVIDER__ +WEATHER_API_KEY=__WEATHER_API_KEY__ diff --git a/config_panel.toml b/config_panel.toml index 738ab0a..e42af69 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -26,7 +26,7 @@ services = ["__APP__", "__APP___workers"] help.fr = "Change le répertoire de données où sont stockés tous les fichiers .gpx téléversés et les photos de profil" bind = "UPLOAD_FOLDER:/var/www/__APP__/.env" - [main.config.weather_provider] + [main.config.weather_api_provider] ask.en = "Change weather provider" ask.fr = "Changer le fournisseur météo" type = "select" @@ -36,7 +36,7 @@ services = ["__APP__", "__APP___workers"] help.fr = "Changer votre fournisseur météo en choisissant un de ceux qui vous sont proposés" bind = "WEATHER_API_PROVIDER:/var/www/__APP__/.env" - [main.config.WEATHER_API_KEY] + [main.config.weather_api_key] ask.en = "Change weather api key" ask.fr = "Changer la clé api pour la météo" type = "string" diff --git a/manifest.toml b/manifest.toml index 6fcd57e..d2af7c5 100644 --- a/manifest.toml +++ b/manifest.toml @@ -47,7 +47,7 @@ ram.runtime = "50M" help.fr = "Choisissez un mot de passe pour l’utilisateur admin ici." type = "password" - [install.weather_provider] + [install.weather_api_provider] ask.en = "(Optional) Choose your weather provider between Darksky and Visual Crossing" ask.fr = "(Optionnel) Choisissez votre fournisseur météo entre Darksky et Visual Crossing" help.en = "Since Fittrackee 0.7.15, only Visual Crossing is supported" @@ -57,7 +57,7 @@ ram.runtime = "50M" default = "visualcrossing" optional = true - [install.weather_key] + [install.weather_api_key] ask.en = "(Optional) Insert here the api key from the chosen weather provider" ask.fr = "(Optionnel) Insérez ici la clé API du fournisseur de météo choisi" type = "string" diff --git a/scripts/change_url b/scripts/change_url index fedb9ea..63342db 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -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) -weather_provider=$(ynh_app_setting_get --app=$app --key=$weather_provider) -weather_key=$(ynh_app_setting_get --app=$app --key=$weather_key) - #================================================= # STANDARD UPGRADE STEPS #================================================= diff --git a/scripts/install b/scripts/install index 62248ef..834cfd3 100755 --- a/scripts/install +++ b/scripts/install @@ -11,8 +11,8 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -ynh_app_setting_set --app=$app --key=weather_provider --value=$weather_provider -ynh_app_setting_set --app=$app --key=weather_key --value=$weather_key +ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider +ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8b3f4de..48abda0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,8 +16,24 @@ source /usr/share/yunohost/helpers admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -weather_provider=$(ynh_app_setting_get --app=$app --key=$weather_provider) -weather_key=$(ynh_app_setting_get --app=$app --key=$weather_key) +ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider +ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key + +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +if [ -z "${weather_api_provider:-}" ]; then + weather_api_provider=$weather_provider + ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider +fi + +if [ -z "${weather_api_key:-}" ]; then + weather_api_key=$weather_key + ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key +fi + #================================================= # CHECK VERSION diff --git a/tests.toml b/tests.toml index bc1e91f..ec891a5 100644 --- a/tests.toml +++ b/tests.toml @@ -21,4 +21,5 @@ test_format = 1.0 test_upgrade_from.e49294c.name = "0.7.22" test_upgrade_from.a446e8c.name = "0.7.23" test_upgrade_from.316dea4.name = "0.7.24" - test_upgrade_from.d682f12.name = "0.7.25~ynh3" \ No newline at end of file + test_upgrade_from.d682f12.name = "0.7.25~ynh3" + test_upgrade_from.e48197d.name = "0.7.26" \ No newline at end of file From 3065ea9c1843b6113ab8ae628b915bba101ab890 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 17 Dec 2023 17:06:42 +0100 Subject: [PATCH 04/11] Update upgrade --- scripts/upgrade | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 48abda0..6128bb6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,16 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= - -admin=$(ynh_user_get_info --username=$admin --key=username) -admin_mail=$(ynh_user_get_info --username=$admin --key=mail) - -ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider -ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -34,6 +24,15 @@ if [ -z "${weather_api_key:-}" ]; then ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key fi +#================================================= +# LOAD SETTINGS +#================================================= + +admin=$(ynh_user_get_info --username=$admin --key=username) +admin_mail=$(ynh_user_get_info --username=$admin --key=mail) + +ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider +ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key #================================================= # CHECK VERSION From 8d7bfcfcdcc01f08fc599e961a7491b6cabb0d0c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 17 Dec 2023 17:50:39 +0100 Subject: [PATCH 05/11] Remove unused stuff --- scripts/upgrade | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6128bb6..d3c285e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,9 +31,6 @@ fi admin=$(ynh_user_get_info --username=$admin --key=username) admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider -ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key - #================================================= # CHECK VERSION #================================================= From 0bd01b5389ca5c92aed407553eb15c69c8c0885c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 20 Dec 2023 21:52:34 +0100 Subject: [PATCH 06/11] upgrade to 0.7.27 --- manifest.toml | 2 +- scripts/_common.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index d2af7c5..ce08c42 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.26~ynh1" +version = "0.7.27~ynh1" maintainers = ["Thovi98"] diff --git a/scripts/_common.sh b/scripts/_common.sh index 34a494f..47a2191 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -fittrackee_version="0.7.26" +fittrackee_version="0.7.27" #================================================= # PERSONAL HELPERS From bbe48741b9dc1723b80cb367ea2ccb6cab00c2e9 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 20 Dec 2023 20:52:37 +0000 Subject: [PATCH 07/11] 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 770479c..7758d68 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.26~ynh1 +**Shipped version:** 0.7.27~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 29fa597..942c162 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.26~ynh1 +**Version incluse :** 0.7.27~ynh1 ## Captures d’écran From e6bf36eb3981b97954fc65c95dc8c9962cf1ff18 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 21 Dec 2023 08:57:41 +0100 Subject: [PATCH 08/11] Create 0.7.27~ynh1.md pre__upgrade notification --- doc/PRE_UPGRADE.d/0.7.27~ynh1.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/PRE_UPGRADE.d/0.7.27~ynh1.md diff --git a/doc/PRE_UPGRADE.d/0.7.27~ynh1.md b/doc/PRE_UPGRADE.d/0.7.27~ynh1.md new file mode 100644 index 0000000..d310ae3 --- /dev/null +++ b/doc/PRE_UPGRADE.d/0.7.27~ynh1.md @@ -0,0 +1,12 @@ +### Features and enhancements + - add a dark mode + - update user preferences display + - add new sport: "Cycling (Trekking)" +### Bugs Fixed + - change UI display only on login ou user preferences update + - fix redirection when resetting password + +A packaging bug is also fixed, where the weather api key was removed on upgrade for poeple who didn't set it during installation but only after, via the config panel. +If you are in this situation, your api key will be removed one last time during this upgrade (which fixes the issue). The following ones should not have this bug anymore 🥳 + +Thanks to @microniko for reporting this bug and to @alexAubin for helping resolving it. From ccf57f1f18bcba9b7ef76d7dcf74a72602f2a799 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 21 Dec 2023 09:16:06 +0100 Subject: [PATCH 09/11] Rename 0.7.27~ynh1.md to 0.7.26~ynh1.md Fix wrong name number --- doc/PRE_UPGRADE.d/{0.7.27~ynh1.md => 0.7.26~ynh1.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/PRE_UPGRADE.d/{0.7.27~ynh1.md => 0.7.26~ynh1.md} (100%) diff --git a/doc/PRE_UPGRADE.d/0.7.27~ynh1.md b/doc/PRE_UPGRADE.d/0.7.26~ynh1.md similarity index 100% rename from doc/PRE_UPGRADE.d/0.7.27~ynh1.md rename to doc/PRE_UPGRADE.d/0.7.26~ynh1.md From 630930a67dc7ab0927aac03e20b1accd916999a9 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 21 Dec 2023 09:32:28 +0100 Subject: [PATCH 10/11] Rename 0.7.26~ynh1.md to 0.7.27~ynh1.md Seems it was correct --- doc/PRE_UPGRADE.d/{0.7.26~ynh1.md => 0.7.27~ynh1.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/PRE_UPGRADE.d/{0.7.26~ynh1.md => 0.7.27~ynh1.md} (100%) diff --git a/doc/PRE_UPGRADE.d/0.7.26~ynh1.md b/doc/PRE_UPGRADE.d/0.7.27~ynh1.md similarity index 100% rename from doc/PRE_UPGRADE.d/0.7.26~ynh1.md rename to doc/PRE_UPGRADE.d/0.7.27~ynh1.md From cdd3b5103aef9862a23688f6eca74f51348016b7 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 21 Dec 2023 09:52:21 +0100 Subject: [PATCH 11/11] fix variables in admin.md --- doc/ADMIN.md | 6 +++--- doc/ADMIN_fr.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 26ca4d5..43c563e 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -3,9 +3,9 @@ After the installation, you can login with the user and password you choose befo If you have to use the [command line interface (cli)](https://samr1.github.io/FitTrackee/cli.html), you can go like this: ``` - pushd $install_dir/ - source $install_dir/venv/bin/activate + pushd __INSTALL_DIR__/ + source __INSTALL_DIR__/venv/bin/activate ftcli [OPTIONS] COMMAND [ARGS]... + popd ``` -`$install_dir` has to be changed with the actual FitTrackee installed directory. Most of the time it will be `/var/www/fittrackee/`. \ No newline at end of file diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index b623e45..353cc82 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -3,9 +3,9 @@ Après l’installation, vous pouvez vous connecter avec les nom d’utilisateur Si vous avez besoin d’utiliser la [ligne de commande](https://samr1.github.io/FitTrackee/cli.html) vous pouvez suivre ces étapes : ``` - pushd $install_dir/ - source $install_dir/venv/bin/activate + pushd __INSTALL_DIR__/ + source __INSTALL_DIR__/venv/bin/activate ftcli [OPTIONS] COMMAND [ARGS]... + popd ``` -`$install_dir` doit être modifié en l’adresse du répertoire où FitTrackee est installé. La majorité du temps ce sera `/var/www/fittrackee/`. \ No newline at end of file