Environment variables

Warning

Since FitTrackee 0.4.0, Makefile.custom.config is replaced by .env

General variables

The following environment variables are used by FitTrackee web application or the task processing library. They are not all mandatory depending on deployment method.

API_RATE_LIMITS

Added in version 0.7.0.

Changed in version 1.0.4: remove default value

API rate limits set for Flask-Limiter see API rate limits.

APP_LOG

Added in version 0.4.0.

Path to log file

Changed in version 1.0.4.

If the value is not set, logging output is displayed only on the console.

APP_SECRET_KEY

FitTrackee secret key, must be initialized in production environment.

Warning

Use a strong secret key. This key is used in JWT generation.

APP_SETTINGS

FitTrackee configuration.

Default:

fittrackee.config.ProductionConfig

APP_TIMEOUT

Added in version 0.9.3.

Timeout (in seconds) for workers spawned by Gunicorn (when starting application with FitTrackee entry point or with Docker image), see Gunicorn documentation).

Default:

30

APP_WORKERS

Changed in version 0.9.3: used by the Docker image entry point script

Number of workers spawned by Gunicorn (when starting application with FitTrackee entry point or with Docker image), see Gunicorn documentation.

Default:

1

DATABASE_DISABLE_POOLING

Added in version 0.4.0.

Removed in version 0.9.3.

Disable pooling if needed (when starting application with FitTrackee entry point and not directly with Gunicorn), see SqlAlchemy documentation.

Default:

false

DATABASE_URL
Database URL with username and password, must be initialized in production environment.
For example in dev environment : postgresql://fittrackee:fittrackee@localhost:5432/fittrackee

Warning

Since SQLAlchemy update (1.4+), engine URL should begin with postgresql://.
DEFAULT_STATICMAP

Added in version 0.4.9.

If True, it keeps using Static Map 3 default tile server to generate static maps (OSM tile server).
Otherwise, it uses the tile server set in TILE_SERVER_URL.

Changed in version 0.6.10.

This variable is now case-insensitive.
If False, depending on tile server, subdomains may be mandatory.
Default:

False

DRAMATIQ_LOG

Added in version 0.9.5.

Path to Dramatiq log file.

EMAIL_URL

Added in version 0.3.0.

Email URL with credentials, see Email.

Changed in version 0.6.5.

Default:

empty string

Danger

If the email URL is empty, email sending will be disabled.

Warning

If the email URL is invalid, the application may not start.

ENABLE_GEOSPATIAL_FEATURES

Added in version 1.0.0.

Removed in version 1.1.0.

Enables geospatial features on User Interface.
Keep the value set to False until all workouts have been updated to add geometries (see Workouts CLI command).
This variable is case-insensitive.
Default:

False

Warning

This is a temporary flag. It will be removed in the next version, which will require all workouts to be updated.

FLASK_APP
Name of the module to import at flask run.
FLASK_APP should contain $(PWD)/fittrackee/__main__.py with installation from sources, else fittrackee.
HOST

FitTrackee host.

Default:

127.0.0.1

LOG_LEVEL

Added in version 1.0.4.

Log level for Gunicorn (when starting application with FitTrackee entry point or with Docker image), see Gunicorn documentation).

Default:

info

MAP_ATTRIBUTION

Added in version 0.4.0.

Map attribution (if using another tile server), see Map tile server.

Default:

&copy; <a href="http://www.openstreetmap.org/copyright" target="_blank" rel="noopener noreferrer">OpenStreetMap</a> contributors

NOMINATIM_URL

Added in version 1.0.0.

URL of Nominatim server, used to get location coordinates from user input

Default:

https://nominatim.openstreetmap.org

OPEN_ELEVATION_API_URL

Added in version 1.1.0.

URL of OpenElevation service (public API or self-hosted instance).

PORT

FitTrackee port.

Default:

5000

REDIS_URL

Added in version 0.3.0.

Redis instance used by Dramatiq and Flask-Limiter.

Default:

local Redis instance (redis://)

SENDER_EMAIL

Added in version 0.3.0.

FitTrackee sender email address.

STATICMAP_CACHE_DIR

Added in version 0.10.0.

Directory for Static Map 3 cache

Default:

.staticmap_cache

Warning

This is the library’s default variable, to be modified to set another directory.

STATICMAP_SUBDOMAINS

Added in version 0.6.10.

Some tile servers require a subdomain, see Map tile server.
For instance: “a,b,c” for OSM France.
Default:

empty string

TASKS_TIME_LIMIT

Added in version 0.10.0.

Timeout in seconds for Dramatiq task execution to avoid long-running tasks.

Default:

1800

TILE_SERVER_URL

Added in version 0.4.0.

Tile server URL (with api key if needed), see Map tile server.
Since 0.4.9, it’s also used to generate static maps (to keep default server, see DEFAULT_STATICMAP)

Changed in version 0.7.23.

The default URL is updated: OpenStreetMap’s tile server no longer requires subdomains.
Default:

https://tile.openstreetmap.org/{z}/{x}/{y}.png

UI_URL

FitTrackee URL, needed for links in emails and mentions on interface.

Warning

UI_URL must contains url scheme (https://).

UPLOAD_FOLDER

Added in version 0.4.0.

Absolute path to the directory where uploads folder will be created.

Default:

<application_directory>/fittrackee

Danger

With installation from PyPI, the directory will be located in virtualenv directory if the variable is not initialized.
VALHALLA_API_URL

Added in version 1.1.0.

URL of Valhalla service (public API or self-hosted instance).

VITE_APP_API_URL

Changed in version 0.7.26: ⚠️ replaces VUE_APP_API_URL

FitTrackee API URL, only needed in dev environment.

WEATHER_API_KEY

Changed in version 0.4.0: ⚠️ replaces WEATHER_API

Weather API key (not mandatory), see WEATHER_API_PROVIDER.

WEATHER_API_PROVIDER

Added in version 0.7.11.

Provider for weather data (not mandatory), see Weather data.

WORKERS_PROCESSES

Added in version 0.3.0.

Number of processes used by Dramatiq.

Docker Compose

Added in version 0.8.13.

Changed in version 0.11.2: Rename variables and add HOST_STATICMAP_CACHE_DIR

HOST_APP_PORT

Application container port

HOST_DATABASE_DIR

Host directory for PostgreSQL data volume

POSTGRES_USER

User for PostgreSQL database

POSTGRES_PASSWORD

Password for PostgreSQL user

POSTGRES_DB

Database name for FitTrackee application

HOST_REDIS_DIR

Host directory for redis data volume

HOST_LOG_DIR

Host directory for logs volume

HOST_UPLOAD_DIR

Host directory for uploaded files volume

HOST_STATICMAP_CACHE_DIR

Host directory for Static Map 3 cache volume