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 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..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"] @@ -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" 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 diff --git a/scripts/install b/scripts/install index 888bbf8..c4cea10 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 toml pyyaml +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..0098afd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,27 +38,12 @@ 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 - - - -#================================================= -# 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 +53,26 @@ 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 + +ynh_secure_remove $install_dir/.venv + +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 pyyaml +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"