1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fittrackee_ynh.git synced 2024-09-03 18:36:16 +02:00

Merge pull request #2 from YunoHost-Apps/testing

Clean up thanks to CI
This commit is contained in:
Thomas 2023-03-09 07:34:25 +01:00 committed by GitHub
commit e68ac219f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 55 additions and 31 deletions

View file

@ -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. 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 ## Screenshots

View file

@ -18,7 +18,7 @@ Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
Traqueur dactivités extérieures auto-hébergé 🚴 Traqueur dactivités extérieures auto-hébergé 🚴
**Version incluse :** 0.7.13~ynh1 **Version incluse :** 0.7.14~ynh1
## Captures décran ## Captures décran

View file

@ -23,18 +23,16 @@ REDIS_URL=redis://
# API_RATE_LIMITS="300 per 5 minutes" # API_RATE_LIMITS="300 per 5 minutes"
# Emails # Emails
UI_URL=__DOMAIN__ # UI_URL=__DOMAIN__
# EMAIL_URL= # EMAIL_URL=
# SENDER_EMAIL= # SENDER_EMAIL=
# WORKERS_PROCESSES= # WORKERS_PROCESSES=
# Workouts # Workouts
## Change default maps as per https://github.com/SamR1/FitTrackee/issues/313 TILE_SERVER_URL=https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
TILE_SERVER_URL=https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png MAP_ATTRIBUTION='&copy; <a href="http://www.openstreetmap.org/copyright" target="_blank" rel="noopener noreferrer">OpenStreetMap</a> contributors'
# STATICMAP_SUBDOMAINS= DEFAULT_STATICMAP=False
MAP_ATTRIBUTION='fond de carte par <a href="http://www.openstreetmap.fr/mentions-legales/" target="_blank" rel="nofollow noopener">OpenStreetMap France</a>, sous&nbsp;<a href="http://creativecommons.org/licenses/by-sa/2.0/fr/" target="_blank" rel="nofollow noopener">licence CC BY-SA</a>' STATICMAP_SUBDOMAINS=''
# DEFAULT_STATICMAP=False
STATICMAP_SUBDOMAINS=a,b,c
# Weather # Weather
# available weather API providers: darksky, visualcrossing # available weather API providers: darksky, visualcrossing

View file

@ -29,8 +29,26 @@ Environment="STATICMAP_SUBDOMAINS="
Environment="MAP_ATTRIBUTION=" Environment="MAP_ATTRIBUTION="
Environment="WEATHER_API_KEY=" Environment="WEATHER_API_KEY="
WorkingDirectory=__INSTALL_DIR__/ 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] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -12,7 +12,7 @@ Restart=always
RestartSec=1 RestartSec=1
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
StandardOutput=append:/var/log/__APP__/__APP__.log StandardOutput=append:/var/log/__APP__/__APP___workers.log
StandardError=inherit StandardError=inherit
SyslogIdentifier=__APP___workers SyslogIdentifier=__APP___workers
EnvironmentFile=__INSTALL_DIR__/.env EnvironmentFile=__INSTALL_DIR__/.env
@ -29,6 +29,9 @@ WorkingDirectory=__INSTALL_DIR__/
ExecStart=__INSTALL_DIR__/.venv/bin/flask worker --processes 2 ExecStart=__INSTALL_DIR__/.venv/bin/flask worker --processes 2
NoNewPrivileges=yes NoNewPrivileges=yes
PrivateTmp=yes PrivateTmp=yes
PrivateDevices=yes PrivateDevices=yes

View file

View file

View file

@ -5,7 +5,7 @@ name = "FitTrackee"
description.en = "Self-hosted outdoor activity tracker 🚴" description.en = "Self-hosted outdoor activity tracker 🚴"
description.fr = "Traqueur dactivités extérieures auto-hébergé 🚴" description.fr = "Traqueur dactivités extérieures auto-hébergé 🚴"
version = "0.7.13~ynh1" version = "0.7.14~ynh1"
maintainers = ["Thovi98"] maintainers = ["Thovi98"]
@ -20,8 +20,8 @@ code = "https://github.com/SamR1/FitTrackee"
yunohost = ">= 11.1.13" yunohost = ">= 11.1.13"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true
ldap = "false" ldap = false
sso = "false" sso = false
disk = "50M" disk = "50M"
ram.build = "50M" ram.build = "50M"
ram.runtime = "50M" ram.runtime = "50M"
@ -30,7 +30,6 @@ ram.runtime = "50M"
[install.domain] [install.domain]
# this is a generic question - ask strings are automatically handled by Yunohost's core # this is a generic question - ask strings are automatically handled by Yunohost's core
type = "domain" type = "domain"
full_domain = true
[install.init_main_permission] [install.init_main_permission]
type = "group" type = "group"
@ -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" help.fr = "Comme Darksky déprécie son API, il est suggéré d'opter pour Visual Crossing"
type = "select" type = "select"
choices = ["", "darksky", "visualcrossing"] choices = ["", "darksky", "visualcrossing"]
default = "visualcrossing"
optional = true optional = true
[install.weather_key] [install.weather_key]
ask.en = "(Optional) Insert here the api key from the chosen weather provider" 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" ask.fr = "(Optionnel) Insérez ici la clé API du fournisseur de météo choisi"
type = "string" type = "string"
default = false
optional = true optional = true
[resources] [resources]

View file

@ -4,7 +4,7 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
fittrackee_version="0.7.13" fittrackee_version="0.7.14"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -18,6 +18,8 @@ ynh_script_progression --message="Configuring logrotate to manage application lo
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate --specific_user=$app ynh_use_logrotate --specific_user=$app
touch /var/log/$app/$app.log 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/ 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 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}" --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 # 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}" --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 # END OF SCRIPT

View file

@ -22,6 +22,8 @@ ynh_script_progression --message="Configuring logrotate to manage application lo
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate --specific_user=$app ynh_use_logrotate --specific_user=$app
touch /var/log/$app/$app.log 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/ 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 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add "${app}" yunohost service add "${app}" --description="Fittrackee main service" --log="/var/log/$app/$app.log"
yunohost service add "${app}_workers" yunohost service add "${app}_workers" --description="Fittrackee task queue service" --log="var/log/$app/${app}_workers.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -74,7 +76,7 @@ yunohost service add "${app}_workers"
ynh_script_progression --message="Starting a systemd service..." --weight=1 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}" --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 # GENERIC FINALIZATION

View file

@ -29,7 +29,7 @@ upgrade_type=$(ynh_check_app_version_changed)
ynh_script_progression --message="Stopping a systemd service..." --weight=1 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}" --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 # 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 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add "${app}" yunohost service add "${app}" --description="Fittrackee main service" --log="/var/log/$app/$app.log"
yunohost service add "${app}_workers" yunohost service add "${app}_workers" --description="Fittrackee task queue service" --log="var/log/$app/${app}_workers.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -99,7 +99,7 @@ ynh_script_progression --message="Starting the systemd services..." --weight=15
# Start a systemd service # 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}" --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 # END OF SCRIPT