Update config paths and docs for environment variables

Changed DATA_DIR to use BACKEND_DIR for consistency in config.py and removed unused import in fit/utils.py. Added documentation for FRONTEND_DIR, BACKEND_DIR, DATA_DIR, and LOGS_DIR environment variables in advanced-started.md to clarify their usage.
This commit is contained in:
João Vitória Silva
2025-12-03 16:18:13 +00:00
parent 0bc50fefff
commit a6a53e513a
3 changed files with 5 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ ROOT_PATH = "/api/v1"
ENDURAIN_HOST = os.getenv("ENDURAIN_HOST", "http://localhost:8080")
FRONTEND_DIR = os.getenv("FRONTEND_DIR", "/app/frontend/dist")
BACKEND_DIR = os.getenv("BACKEND_DIR", "/app/backend")
DATA_DIR = os.getenv("DATA_DIR", "/app/backend/data")
DATA_DIR = os.getenv("DATA_DIR", f"{BACKEND_DIR}/data")
LOGS_DIR = os.getenv("LOGS_DIR", f"{BACKEND_DIR}/logs")
USER_IMAGES_URL_PATH = "user_images"
USER_IMAGES_DIR = f"{DATA_DIR}/{USER_IMAGES_URL_PATH}"

View File

@@ -3,7 +3,6 @@ from enum import Enum
from fastapi import HTTPException, status
from datetime import datetime, timedelta
import time as timelib
from sqlalchemy.orm import Session
from timezonefinder import TimezoneFinder
from zoneinfo import ZoneInfo, available_timezones

View File

@@ -19,6 +19,10 @@ Table below shows supported environment variables. Variables marked with optiona
| UID | 1000 | Yes | User ID for mounted volumes. Default is 1000 |
| GID | 1000 | Yes | Group ID for mounted volumes. Default is 1000 |
| TZ | UTC | Yes | Timezone definition. Useful for TZ calculation for activities that do not have coordinates associated, like indoor swim or weight training. If not specified UTC will be used. List of available time zones [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Format `Europe/Lisbon` expected |
| FRONTEND_DIR | `/app/frontend/dist` | Yes | You will only need to change this value if installing using bare metal method |
| BACKEND_DIR | `/app/backend` | Yes | You will only need to change this value if installing using bare metal method |
| DATA_DIR | `/app/backend/data` | Yes | You will only need to change this value if installing using bare metal method |
| LOGS_DIR | `/app/backend/logs` | Yes | You will only need to change this value if installing using bare metal method |
| ENDURAIN_HOST | No default set | `No` | Required for internal communication and Strava. For Strava https must be used. Host or local ip (example: http://192.168.1.10:8080 or https://endurain.com) |
| REVERSE_GEO_PROVIDER | nominatim | Yes | Defines reverse geo provider. Expects <a href="https://geocode.maps.co/">geocode</a>, photon or nominatim. photon can be the <a href="https://photon.komoot.io">SaaS by komoot</a> or a self hosted version like a <a href="https://github.com/rtuszik/photon-docker">self hosted version</a>. Like photon, Nominatim can be the <a href="https://nominatim.openstreetmap.org/">SaaS</a> or a self hosted version |
| PHOTON_API_HOST | photon.komoot.io | Yes | API host for photon. By default it uses the <a href="https://photon.komoot.io">SaaS by komoot</a> |