diff --git a/README.md b/README.md index 5da4e41..b225aa1 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.13~ynh1 +**Shipped version:** 0.7.14~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 554afba..4698e63 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,9 +16,9 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble - Traqueur d’activités extérieures auto-hébergé 🚴 +Traqueur d’activités extérieures auto-hébergé 🚴 -**Version incluse :** 0.7.13~ynh1 +**Version incluse :** 0.7.14~ynh1 ## Captures d’écran diff --git a/conf/.env.production b/conf/.env.production index f2acf34..1765397 100644 --- a/conf/.env.production +++ b/conf/.env.production @@ -23,18 +23,16 @@ REDIS_URL=redis:// # API_RATE_LIMITS="300 per 5 minutes" # Emails -UI_URL=__DOMAIN__ +# UI_URL=__DOMAIN__ # EMAIL_URL= # SENDER_EMAIL= # WORKERS_PROCESSES= # Workouts -## Change default maps as per https://github.com/SamR1/FitTrackee/issues/313 -TILE_SERVER_URL=https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png -# STATICMAP_SUBDOMAINS= -MAP_ATTRIBUTION='fond de carte par OpenStreetMap France, sous licence CC BY-SA' -# DEFAULT_STATICMAP=False -STATICMAP_SUBDOMAINS=a,b,c +TILE_SERVER_URL=https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png +MAP_ATTRIBUTION='© OpenStreetMap contributors' +DEFAULT_STATICMAP=False +STATICMAP_SUBDOMAINS='' # Weather # available weather API providers: darksky, visualcrossing diff --git a/conf/fittrackee.service b/conf/fittrackee.service index 275a2c3..b6857e4 100644 --- a/conf/fittrackee.service +++ b/conf/fittrackee.service @@ -29,8 +29,26 @@ 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__/__APP__.log +ExecStart=__INSTALL_DIR__/.venv/bin/gunicorn -b 127.0.0.1:__PORT__ "fittrackee:create_app()" --error-logfile /var/log/__APP__/gunicorn.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 +CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE +CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT +CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK +CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM +CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG +CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE +CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW +CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG + [Install] WantedBy=multi-user.target diff --git a/conf/fittrackee_workers.service b/conf/fittrackee_workers.service index 4bda900..152e933 100644 --- a/conf/fittrackee_workers.service +++ b/conf/fittrackee_workers.service @@ -12,7 +12,7 @@ Restart=always RestartSec=1 User=__APP__ Group=__APP__ -StandardOutput=append:/var/log/__APP__/__APP__.log +StandardOutput=append:/var/log/__APP__/__APP___workers.log StandardError=inherit SyslogIdentifier=__APP___workers EnvironmentFile=__INSTALL_DIR__/.env @@ -29,6 +29,9 @@ WorkingDirectory=__INSTALL_DIR__/ ExecStart=__INSTALL_DIR__/.venv/bin/flask worker --processes 2 + + + NoNewPrivileges=yes PrivateTmp=yes PrivateDevices=yes diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index e69de29..0000000 diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md deleted file mode 100644 index e69de29..0000000 diff --git a/manifest.toml b/manifest.toml index 472ee9c..97d4e67 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,10 +2,10 @@ packaging_format = 2 id = "fittrackee" name = "FitTrackee" -description.en = " Self-hosted outdoor activity tracker 🚴" -description.fr = " Traqueur d’activités extérieures auto-hébergé 🚴 " +description.en = "Self-hosted outdoor activity tracker 🚴" +description.fr = "Traqueur d’activités extérieures auto-hébergé 🚴" -version = "0.7.13~ynh1" +version = "0.7.14~ynh1" maintainers = ["Thovi98"] @@ -20,8 +20,8 @@ code = "https://github.com/SamR1/FitTrackee" yunohost = ">= 11.1.13" architectures = "all" multi_instance = true -ldap = "false" -sso = "false" +ldap = false +sso = false disk = "50M" ram.build = "50M" ram.runtime = "50M" @@ -30,8 +30,7 @@ ram.runtime = "50M" [install.domain] # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" - full_domain = true - + [install.init_main_permission] type = "group" default = "visitors" @@ -47,12 +46,14 @@ ram.runtime = "50M" help.fr = "Comme Darksky déprécie son API, il est suggéré d'opter pour Visual Crossing" type = "select" choices = ["", "darksky", "visualcrossing"] + default = "visualcrossing" optional = true [install.weather_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" + default = false optional = true [resources] diff --git a/scripts/_common.sh b/scripts/_common.sh index e5e7fb7..fbff5af 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -fittrackee_version="0.7.13" +fittrackee_version="0.7.14" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index e4e39ef..f251d6e 100755 --- a/scripts/install +++ b/scripts/install @@ -18,6 +18,8 @@ ynh_script_progression --message="Configuring logrotate to manage application lo # Use logrotate to manage application logfile(s) 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/ @@ -91,7 +93,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" -yunohost service add "${app}_workers" --description="Fittrackee task queue service" --log="var/log/$app/$app.log" +yunohost service add "${app}_workers" --description="Fittrackee task queue service" --log="var/log/$app/${app}_workers.log" #================================================= @@ -107,7 +109,7 @@ ynh_script_progression --message="Starting the systemd services..." --weight=15 # Start a systemd service ynh_systemd_action --service_name="${app}" --action="start" --log_path="/var/log/$app/$app.log" --line_match="Booting worker with pid" -ynh_systemd_action --service_name="${app}_workers" --action="start" --log_path="/var/log/$app/$app.log" --line_match="Started" +ynh_systemd_action --service_name="${app}_workers" --action="start" --log_path="/var/log/$app/${app}_workers.log" --line_match="Started" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index c80a419..d083c44 100644 --- a/scripts/restore +++ b/scripts/restore @@ -22,6 +22,8 @@ ynh_script_progression --message="Configuring logrotate to manage application lo # Use logrotate to manage application logfile(s) 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/ #================================================= @@ -65,8 +67,8 @@ systemctl enable "${app}_workers.service" --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "${app}" -yunohost service add "${app}_workers" +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" #================================================= # START SYSTEMD SERVICE @@ -74,7 +76,7 @@ yunohost service add "${app}_workers" ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name="${app}" --action="start" --log_path="/var/log/$app/$app.log" --line_match="Booting worker with pid" -ynh_systemd_action --service_name="${app}_workers" --action="start" --log_path="/var/log/$app/$app.log" --line_match="Started" +ynh_systemd_action --service_name="${app}_workers" --action="start" --log_path="/var/log/$app/${app}_workers.log" --line_match="Started" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 18e3866..2d07913 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,7 +29,7 @@ upgrade_type=$(ynh_check_app_version_changed) ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --action="stop" --service_name="${app}" --log_path="/var/log/$app/$app.log" --line_match="Stopped" -ynh_systemd_action --action="stop" --service_name="${app}_workers" --log_path="systemd" --line_match="Stopped" +ynh_systemd_action --action="stop" --service_name="${app}_workers" --log_path="/var/log/$app/${app}_workers.log" --line_match="Stopped" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -89,8 +89,8 @@ ynh_add_systemd_config --service="${app}_workers" --template="fittrackee_workers #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "${app}" -yunohost service add "${app}_workers" +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" #================================================= # START SYSTEMD SERVICE @@ -99,7 +99,7 @@ ynh_script_progression --message="Starting the systemd services..." --weight=15 # Start a systemd service ynh_systemd_action --service_name="${app}" --action="start" --log_path="/var/log/$app/$app.log" --line_match="Booting worker with pid" -ynh_systemd_action --service_name="${app}_workers" --action="start" --log_path="/var/log/$app/$app.log" --line_match="Started" +ynh_systemd_action --service_name="${app}_workers" --action="start" --log_path="/var/log/$app/${app}_workers.log" --line_match="Started" #================================================= # END OF SCRIPT diff --git a/tests.toml b/tests.toml index 1c7edcf..9fee290 100644 --- a/tests.toml +++ b/tests.toml @@ -11,8 +11,8 @@ test_format = 1.0 # ------------------------------- # Default args to use for install # ------------------------------- - - + + # ------------------------------- # Commits to test upgrade from # -------------------------------