From 28e8b871ddf8c6bd3c39823553005536fb016e71 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 11 Jun 2023 23:14:27 +0200 Subject: [PATCH 01/12] refactor virtualenv --- conf/fittrackee.service | 2 +- conf/fittrackee_workers.service | 2 +- manifest.toml | 2 +- scripts/install | 33 +++++++++++++-------------------- scripts/upgrade | 29 +++++++++++++---------------- tests.toml | 3 ++- 6 files changed, 31 insertions(+), 40 deletions(-) diff --git a/conf/fittrackee.service b/conf/fittrackee.service index b6857e4..205b26c 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__/gunicorn.log diff --git a/conf/fittrackee_workers.service b/conf/fittrackee_workers.service index 152e933..8b10cb9 100644 --- a/conf/fittrackee_workers.service +++ b/conf/fittrackee_workers.service @@ -26,7 +26,7 @@ Environment="EMAIL_URL=" Environment="SENDER_EMAIL=" Environment="REDIS_URL=" WorkingDirectory=__INSTALL_DIR__/ -ExecStart=__INSTALL_DIR__/.venv/bin/flask worker --processes 2 +ExecStart=__INSTALL_DIR__/venv/bin/flask worker --processes 2 diff --git a/manifest.toml b/manifest.toml index d748c3e..a489b61 100644 --- a/manifest.toml +++ b/manifest.toml @@ -77,7 +77,7 @@ ram.runtime = "50M" main.default = 5000 [resources.apt] - packages = "postgresql, postgresql-contrib, python3-venv libopenjp2-7" + packages = "postgresql, postgresql-contrib, python3-venv libopenjp2-7 python3-venv" [resources.database] type = "postgresql" diff --git a/scripts/install b/scripts/install index 888bbf8..70e5ec2 100755 --- a/scripts/install +++ b/scripts/install @@ -23,16 +23,6 @@ touch /var/log/$app/${app}_workers.log touch /var/log/$app/gunicorn.log chown -R $app:www-data /var/log/$app/ - - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=23 - -ynh_exec_warn_less python3 -m pip install pipenv - - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -49,29 +39,32 @@ ynh_script_progression --message="Setting up source files..." --weight=64 ynh_add_config --template="../conf/.env.production" --destination="$install_dir/.env" chmod 600 $install_dir/.env - - chown -R $app:www-data "$install_dir" - set -a; source "$install_dir/.env"; set +a -pushd $install_dir - mkdir -p .venv - PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true ynh_exec_warn_less python3 -m pipenv install fittrackee==$fittrackee_version python-dotenv -popd +#================================================= +# INSTALL PYTHON DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing Python dependencies..." --weight=3 + +pushd $install_dir + python3 -m venv $install_dir/venv + source $install_dir/venv/bin/activate + ynh_exec_warn_less pip install fittrackee==$fittrackee_version +popd #================================================= # INITIALIZE DATABASE #================================================= ynh_script_progression --message="Initializing database..." --weight=1 -ynh_exec_warn_less $install_dir/.venv/bin/ftcli db upgrade +ynh_exec_warn_less $install_dir/venv/bin/ftcli db upgrade -ynh_exec_warn_less $install_dir/.venv/bin/ftcli users create $admin --email $admin_mail --password $password +ynh_exec_warn_less $install_dir/venv/bin/ftcli users create $admin --email $admin_mail --password $password -ynh_exec_warn_less $install_dir/.venv/bin/ftcli users update $admin --set-admin true +ynh_exec_warn_less $install_dir/venv/bin/ftcli users update $admin --set-admin true #================================================= # System Configuration diff --git a/scripts/upgrade b/scripts/upgrade index b5b9081..ebb38b7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,25 +40,11 @@ ynh_script_progression --message="Installing dependencies..." --weight=23 ynh_exec_warn_less python3 -m pip install pipenv - - - -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= - - -mkdir -p "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app: "$install_dir" -pushd $install_dir - mkdir -p .venv - PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true ynh_exec_warn_less python3 -m pipenv install fittrackee==$fittrackee_version python-dotenv -popd - #================================================= -# CONFIGURE THEN INSTALL SCRIPT AND DEPENDENCIES +# CONFIGURE THE INSTALL SCRIPT #================================================= ynh_script_progression --message="Installing service script..." --weight=1 @@ -68,12 +54,23 @@ chown $app: "$install_dir/.env" set -a; source "$install_dir/.env"; set +a +#================================================= +# INSTALL PYTHON DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing Python dependencies..." --weight=3 + +pushd $install_dir + python3 -m venv $install_dir/venv + source $install_dir/venv/bin/activate + ynh_exec_warn_less pip install fittrackee==$fittrackee_version +popd + #================================================= # Update DATABASE #================================================= ynh_script_progression --message="Upgrading database..." --weight=1 -ynh_exec_warn_less $install_dir/.venv/bin/ftcli db upgrade +ynh_exec_warn_less $install_dir/venv/bin/ftcli db upgrade #================================================= diff --git a/tests.toml b/tests.toml index a6ac7bc..768e05d 100644 --- a/tests.toml +++ b/tests.toml @@ -16,4 +16,5 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.852bf0d.name = "Upgrade from 0.7.14" + test_upgrade_from.852bf0d.name = "0.7.14" + test_upgrade_from.0b20803.name = "0.7.17" From d9b457c65833cb6d724c0b05d42703da6888d818 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 11 Jun 2023 23:21:35 +0200 Subject: [PATCH 02/12] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 70e5ec2..d038bde 100755 --- a/scripts/install +++ b/scripts/install @@ -52,7 +52,7 @@ ynh_script_progression --message="Installing Python dependencies..." --weight=3 pushd $install_dir python3 -m venv $install_dir/venv source $install_dir/venv/bin/activate - ynh_exec_warn_less pip install fittrackee==$fittrackee_version + ynh_exec_warn_less pip install fittrackee==$fittrackee_version toml yaml popd #================================================= From 3f9db8b955f8f2328d4e7041d3afad7f173a3cdf Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 11 Jun 2023 23:29:27 +0200 Subject: [PATCH 03/12] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d038bde..703951b 100755 --- a/scripts/install +++ b/scripts/install @@ -52,7 +52,7 @@ ynh_script_progression --message="Installing Python dependencies..." --weight=3 pushd $install_dir python3 -m venv $install_dir/venv source $install_dir/venv/bin/activate - ynh_exec_warn_less pip install fittrackee==$fittrackee_version toml yaml + ynh_exec_warn_less pip install fittrackee==$fittrackee_version toml popd #================================================= From 8a0249ff201e9c74f6f626c0fc6266a68becbb11 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 11 Jun 2023 23:36:29 +0200 Subject: [PATCH 04/12] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 703951b..c4cea10 100755 --- a/scripts/install +++ b/scripts/install @@ -52,7 +52,7 @@ ynh_script_progression --message="Installing Python dependencies..." --weight=3 pushd $install_dir python3 -m venv $install_dir/venv source $install_dir/venv/bin/activate - ynh_exec_warn_less pip install fittrackee==$fittrackee_version toml + ynh_exec_warn_less pip install fittrackee==$fittrackee_version toml pyyaml popd #================================================= From 7a9c2375ee0c2c027cafc4b81881b08edd6d1002 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 12 Jun 2023 08:24:20 +0200 Subject: [PATCH 05/12] Update upgrade --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ebb38b7..95446e0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,7 +62,8 @@ ynh_script_progression --message="Installing Python dependencies..." --weight=3 pushd $install_dir python3 -m venv $install_dir/venv source $install_dir/venv/bin/activate - ynh_exec_warn_less pip install fittrackee==$fittrackee_version + ynh_exec_warn_less pip install fittrackee==$fittrackee_version toml pyyaml +popd popd #================================================= From 01f0a367333968f6fffee0968af9a728a2e58d52 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 12 Jun 2023 08:49:41 +0200 Subject: [PATCH 06/12] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 95446e0..4c0281b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -64,7 +64,7 @@ pushd $install_dir source $install_dir/venv/bin/activate ynh_exec_warn_less pip install fittrackee==$fittrackee_version toml pyyaml popd -popd + #================================================= # Update DATABASE From c651373a9f1a0a152efae3d7b5d3cc67f3f25148 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 12 Jun 2023 09:54:07 +0200 Subject: [PATCH 07/12] Update upgrade --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4c0281b..0098afd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,7 +38,6 @@ ynh_systemd_action --action="stop" --service_name="${app}_workers" #================================================= ynh_script_progression --message="Installing dependencies..." --weight=23 -ynh_exec_warn_less python3 -m pip install pipenv chmod -R o-rwx "$install_dir" chown -R $app: "$install_dir" @@ -59,6 +58,8 @@ set -a; source "$install_dir/.env"; set +a #================================================= ynh_script_progression --message="Installing Python dependencies..." --weight=3 +ynh_secure_remove $install_dir/.venv + pushd $install_dir python3 -m venv $install_dir/venv source $install_dir/venv/bin/activate From 5031488f25f8afe75056092f6abc12d2ef93fee2 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 13 Jun 2023 21:16:44 +0200 Subject: [PATCH 08/12] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index a489b61..471c09c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -77,7 +77,7 @@ ram.runtime = "50M" main.default = 5000 [resources.apt] - packages = "postgresql, postgresql-contrib, python3-venv libopenjp2-7 python3-venv" + packages = "postgresql, postgresql-contrib, python3-venv, libopenjp2-7" [resources.database] type = "postgresql" From 399e656f16d17b7a2b24213e1c8f68f8dd9810f9 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 13 Jun 2023 21:17:02 +0200 Subject: [PATCH 09/12] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 471c09c..d82f39b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -77,7 +77,7 @@ ram.runtime = "50M" main.default = 5000 [resources.apt] - packages = "postgresql, postgresql-contrib, python3-venv, libopenjp2-7" + packages = "postgresql, postgresql-contrib, python3, python3-venv, libopenjp2-7" [resources.database] type = "postgresql" From a789b1b3c3ab3a29c7ba2c44bc386d7e6ec91907 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 26 Jun 2023 08:39:02 +0200 Subject: [PATCH 10/12] Update FiTrackee --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index d82f39b..4f437f9 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.17~ynh1" +version = "0.7.18~ynh1" maintainers = ["Thovi98"] From 3ec5b5f898c0d6ac74ba03038df734e0da5acc14 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 26 Jun 2023 06:39:05 +0000 Subject: [PATCH 11/12] 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 c021eab..ada966e 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.17~ynh1 +**Shipped version:** 0.7.18~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 52a79a2..fcf04ee 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.17~ynh1 +**Version incluse :** 0.7.18~ynh1 ## Captures d’écran From 25107de1ebba883773f5dd9724020aaf0e4f5595 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 26 Jun 2023 08:39:35 +0200 Subject: [PATCH 12/12] Update FitTrackee --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8e262cb..4dca0c5 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -fittrackee_version="0.7.17" +fittrackee_version="0.7.18" #================================================= # PERSONAL HELPERS