Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
services:obsolete:fittrackee [2024/08/06 13:42] – created - external edit 127.0.0.1 | services:obsolete:fittrackee [2025/05/21 08:21] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== | ====== | ||
- | [[https:// | + | [[https:// |
+ | |||
+ | The main factor that made me abandon FitTrackee in favor of [[services: | ||
===== Installation ===== | ===== Installation ===== | ||
- | Detailed instructions can be found [[https:// | + | Detailed instructions can be found [[https:// |
+ | For historical reasons, i will keep the original non containerized installation instructions too for reference, but keep in mind they might be outdated. | ||
+ | |||
+ | As usual, create the dedicated user: | ||
<code bash> | <code bash> | ||
useradd -d / | useradd -d / | ||
+ | mkdir / | ||
+ | chown fittrackee: | ||
</ | </ | ||
- | FitTrackee uses Python, so check out [[gentoo: | + | uploads will be stored under **/ |
+ | === Using containers === | ||
+ | |||
+ | Download the example docker-compose.yml from [[https:// | ||
+ | <file - docker-compose.yaml> | ||
+ | services: | ||
+ | fittrackee-db: | ||
+ | container_name: | ||
+ | image: postgres: | ||
+ | env_file: | ||
+ | - .env | ||
+ | volumes: | ||
+ | - ${DATABASE_DIR: | ||
+ | networks: | ||
+ | - fittrackee-network | ||
+ | |||
+ | fittrackee: | ||
+ | container_name: | ||
+ | env_file: | ||
+ | - .env | ||
+ | image: fittrackee/ | ||
+ | volumes: | ||
+ | - ${UPLOAD_DIR: | ||
+ | - ${LOG_DIR: | ||
+ | post_start: | ||
+ | - command: chown -R fittrackee: | ||
+ | user: root | ||
+ | ports: | ||
+ | - " | ||
+ | command: 'sh docker-entrypoint.sh' | ||
+ | depends_on: | ||
+ | fittrackee-db: | ||
+ | networks: | ||
+ | - fittrackee-network | ||
+ | |||
+ | networks: | ||
+ | fittrackee-network: | ||
+ | </ | ||
+ | |||
+ | Populate the env file (/ | ||
+ | <file - .env> | ||
+ | # Docker volumes | ||
+ | export UPLOAD_DIR=/ | ||
+ | export LOG_DIR=/ | ||
+ | export DATABASE_DIR=/ | ||
+ | |||
+ | # Application | ||
+ | export FLASK_APP=fittrackee | ||
+ | export FLASK_SKIP_DOTENV=1 | ||
+ | export APP_PORT=5123 | ||
+ | export APP_SECRET_KEY=<< | ||
+ | export APP_LOG=/ | ||
+ | export UPLOAD_FOLDER=/ | ||
+ | export UI_URL=https:// | ||
+ | |||
+ | # PostgreSQL | ||
+ | export POSTGRES_USER=fittrackee | ||
+ | export POSTGRES_PASSWORD=<< | ||
+ | export POSTGRES_DB=fittrackee | ||
+ | export DATABASE_URL=postgresql:// | ||
+ | </ | ||
+ | |||
+ | Now start the stuff: | ||
<code bash> | <code bash> | ||
- | python -m venv venv_ft | + | podman compose up |
- | source venv_ft/ | + | |
- | pip install fittrackee | + | |
</ | </ | ||
- | Now, FitTrackee requires PostgreSQL, so you need to install | + | you might have to stop and start again, since the first start of the database takes some time and the main app might crash. Just wait for the database to be up and running, then restart. |
- | From now on i assume PostgreSQL is installed | + | === Without using containers === |
+ | |||
+ | FitTrackee uses Python, so check out [[gentoo: | ||
- | Now access your postgres as admin user and create the database: | ||
<code bash> | <code bash> | ||
- | psql -U postgres | + | python |
- | </code> | + | source venv_ft/bin/ |
- | + | pip install | |
- | type in the following SQL statements: | + | |
- | <code sql> | + | |
- | CREATE USER fittrackee WITH PASSWORD '< | + | |
- | CREATE SCHEMA fittrackee AUTHORIZATION fittrackee; | + | |
- | CREATE DATABASE fittrackee OWNER fittrackee; | + | |
</ | </ | ||
+ | Populate the following **/ | ||
<file - .env> | <file - .env> | ||
export PORT=5123 | export PORT=5123 | ||
export APP_SECRET_KEY=< | export APP_SECRET_KEY=< | ||
- | export APP_LOG=/data/daemons/ | + | export APP_LOG=/va/log/ |
- | export UPLOAD_FOLDER=/ | + | export UPLOAD_FOLDER=/ |
export DATABASE_URL=postgresql:// | export DATABASE_URL=postgresql:// | ||
export UI_URL=https:// | export UI_URL=https:// | ||
- | export EMAIL_URL=smtp:// | ||
- | export SENDER_EMAIL=xxx@mydomain.com | ||
export FLASK_APP=fittrackee | export FLASK_APP=fittrackee | ||
</ | </ | ||
- | Ensure this **.env** file is sourced in your **~/ | + | Ensure this **.env** file is sourced in your **~/ |
As a reference: | As a reference: | ||
Line 56: | Line 118: | ||
source .env | source .env | ||
</ | </ | ||
+ | |||
+ | Now, FitTrackee requires PostgreSQL, so you need to install and start it. For reference, and [[https:// | ||
+ | |||
+ | From now on i assume PostgreSQL is installed and ready. | ||
+ | |||
+ | Now access your postgres as admin user and create the database: | ||
+ | <code bash> | ||
+ | psql -U postgres | ||
+ | </ | ||
+ | |||
+ | type in the following SQL statements: | ||
+ | <code sql> | ||
+ | CREATE USER fittrackee WITH PASSWORD '< | ||
+ | CREATE SCHEMA fittrackee AUTHORIZATION fittrackee; | ||
+ | CREATE DATABASE fittrackee OWNER fittrackee; | ||
+ | </ | ||
Now, initialize the database: | Now, initialize the database: | ||
Line 69: | Line 147: | ||
<file - fittrackee.conf> | <file - fittrackee.conf> | ||
server { | server { | ||
- | server_name train.gardiol.org; | + | server_name train.mydomain.com; |
listen 443 ssl; | listen 443 ssl; | ||
listen 8443 ssl; | listen 8443 ssl; | ||
- | access_log / | + | access_log / |
- | error_log / | + | error_log / |
location / { | location / { | ||
Line 87: | Line 165: | ||
client_max_body_size 100M; | client_max_body_size 100M; | ||
- | include | + | include |
} | } | ||
</ | </ | ||
- | ===== Autostart ===== | + | ===== Autostart |
+ | |||
+ | To start it, and set it up on boot, as usual follow my indications [[gentoo: | ||
+ | < | ||
+ | ln -s / | ||
+ | </ | ||
+ | |||
+ | and create the following config file: | ||
+ | <file - / | ||
+ | USER=fittrackee | ||
+ | DESCRIPTION=" | ||
+ | </ | ||
+ | |||
+ | Add the service to the default runlevel and start it now: | ||
+ | <code bash> | ||
+ | rc-update add user-containers.fittrackee default | ||
+ | rc-service user-containers.fittrackee start | ||
+ | </ | ||
+ | |||
+ | ===== Autostart without containers | ||
Since i use OpenRC, simply drop the following script to / | Since i use OpenRC, simply drop the following script to / | ||
Line 132: | Line 229: | ||
===== User management ===== | ===== User management ===== | ||
- | If you do not require generating | + | You can create users from the web UI, but users will be disabled. I suggest |
+ | |||
+ | To run the CLI (container installation): | ||
+ | <code bash> | ||
+ | podman compose exec fittrackee ftcli users update < | ||
+ | </ | ||
+ | |||
+ | To run the CLI (without container installation): | ||
+ | <code bash> | ||
+ | ftcli users update < | ||
+ | </ | ||
+ | |||
+ | To create | ||
<code bash> | <code bash> | ||
ftcli users create --password < | ftcli users create --password < | ||
+ | </ | ||
+ | |||
+ | To set an user as admin: | ||
+ | <code bash> | ||
ftcli users update myuser --set-admin true | ftcli users update myuser --set-admin true | ||
</ | </ | ||
- | and then disable user registration from the admin panel in theweb | + | You can also disable user registration from the admin panel in the web GUI, set the number of active users to a fixed quantity instead of zero. |
===== Log rotation ===== | ===== Log rotation ===== | ||
Line 144: | Line 257: | ||
If you use **logrotate** (you should), create a new file under **/ | If you use **logrotate** (you should), create a new file under **/ | ||
<file - fittrackee> | <file - fittrackee> | ||
- | /data/daemons/ | + | /var/log/ |
missingok | missingok | ||
notifempty | notifempty | ||
Line 154: | Line 267: | ||
Work in progress. | Work in progress. | ||
- | ===== Updates ===== | + | ===== Updates |
Stop the service, then run, as **fitrackee** user: | Stop the service, then run, as **fitrackee** user: | ||
Line 165: | Line 278: | ||
Also note, if you installed the Garmin bridge, that you might want to run again that installation command as well. | Also note, if you installed the Garmin bridge, that you might want to run again that installation command as well. | ||
+ | |||
===== Garmin Integration ===== | ===== Garmin Integration ===== | ||
A Garmin bridge for FitTrackee exist [[https:// | A Garmin bridge for FitTrackee exist [[https:// | ||
+ | |||
+ | There is no containerized version, so you need to install on bare metal. | ||
+ | |||
+ | ===== setup for container-based Fittrackee installation | ||
+ | |||
+ | Garmin integration uses Python, so check out [[gentoo: | ||
+ | |||
+ | Only if you have done a Fittrackee containerized installation, | ||
+ | <code bash> | ||
+ | python -m venv venv_ft | ||
+ | source venv_ft/ | ||
+ | </ | ||
+ | |||
+ | and enable it in fittrackee' | ||
+ | <file - .bashrc> | ||
+ | (only last lines shown) | ||
+ | export PATH=$PATH: | ||
+ | source venv_ft/ | ||
+ | source .env | ||
+ | </ | ||
+ | |||
+ | ===== bridge installation | ||
First of all, as the same **fittrackee** user, install the bridge: | First of all, as the same **fittrackee** user, install the bridge: | ||
Line 175: | Line 311: | ||
</ | </ | ||
- | Now, citing the documentation in the above link, y ou need to create an application in your Fittrackee instance so go to you're fittrackee account, then go to " | + | Now, citing the documentation in the above link, you need to create an application in your Fittrackee instance so go to you're fittrackee account, then go to " |
In the "Add a new OAuth2 application" | In the "Add a new OAuth2 application" | ||
As " | As " | ||
Line 184: | Line 320: | ||
At this point, setup the link to Garmin, from your fittrackee user terminal: | At this point, setup the link to Garmin, from your fittrackee user terminal: | ||
<code bash> | <code bash> | ||
- | .garmin2fittrackee setup config-tool | + | garmin2fittrackee setup config-tool |
</ | </ | ||
+ | Link to Garmin: | ||
+ | <code bash> | ||
+ | | ||
+ | </ | ||
You will need to provide your garmin credentials for login. | You will need to provide your garmin credentials for login. | ||