Updated docs & updated env default values

[docs] updated docs for single docker image
[docker] updated some default env variables values
[docker] updated docker compose file
This commit is contained in:
João Vitória Silva
2024-12-23 22:58:21 +00:00
parent 0e43bf1a09
commit 96d3e63991
6 changed files with 28 additions and 37 deletions

View File

@@ -7,13 +7,14 @@ services:
- DB_TYPE=postgres # mariadb or postgres
- DB_HOST=postgres # mariadb or postgres
- DB_PORT=5432 # 3306 or 5432
- DB_PASSWORD=123Testes@
- SECRET_KEY=179bc27a49f9ec0775cd768e423a1dccf6ed1877765e238e80012770981604c0 # openssl rand -hex 32
- DB_PASSWORD=changeme
- SECRET_KEY=chnageme # openssl rand -hex 32
#- STRAVA_CLIENT_ID=changeme
#- STRAVA_CLIENT_SECRET=changeme
#- STRAVA_AUTH_CODE=changeme
- GEOCODES_MAPS_API=65a54b5900160666737054pmy223029
- ENDURAIN_HOST=http://localhost:8080 # host or local ip (example: 192.168.1.10:8080), default is http://localhost:8080
- GEOCODES_MAPS_API=changeme
- ENDURAIN_HOST=http://localhost:8080 # host or local ip (example: http://192.168.1.10:8080 or https://endurain.com), default is http://localhost:8080
- BEHIND_PROXY=false # default value is false. Change to true if behind reverse proxy
volumes:
# - <local_path>/endurain/backend/app:/app # Configure volume if you want to edit the code locally by cloning the repo
- <local_path>/endurain/backend/user_images:/app/user_images # necessary for user image persistence on container image updates

View File

@@ -34,15 +34,15 @@ FROM python:3.12
# Define environment variables
ENV TZ="UTC" \
DB_TYPE="mariadb" \
DB_HOST="mariadb" \
DB_PORT=3306 \
DB_TYPE="postgres" \
DB_HOST="postgres" \
DB_PORT=5432 \
DB_USER="endurain" \
DB_PASSWORD="changeme" \
DB_DATABASE="endurain" \
SECRET_KEY="changeme" \
ALGORITHM="HS256" \
ACCESS_TOKEN_EXPIRE_MINUTES=30 \
ACCESS_TOKEN_EXPIRE_MINUTES=15 \
REFRESH_TOKEN_EXPIRE_DAYS=7 \
STRAVA_CLIENT_ID="changeme" \
STRAVA_CLIENT_SECRET="changeme" \

View File

@@ -9,37 +9,22 @@
## Docker Deployment
Endurain provides Docker images for simplified deployment. To get started, check out the `docker-compose.yml.example` file in the project repository and adjust it according to your setup.
Endurain provides a Docker image for simplified deployment. To get started, check out the `docker-compose.yml.example` file in the project repository and adjust it according to your setup.
Supported tags are:
- **latest:** contains the latest released version;
- **version, example "v0.3.0":** contains the app state available at the time of the version specified;
- **development version, example "dev_06092024":** contains a development version of the app at the date specified. This is not a stable released and may contain issues and bugs. Please do not open issues if using a version like this unless asked by me.
## Frontend Environment Variables
Table below shows supported environment variables. Variables marked with optional "No" should be set to avoid errors.
| Environment variable | Default value | Optional | Notes |
| --- | --- | --- | --- |
| MY_APP_BACKEND_PROTOCOL | http | Yes | Needs to be `https` if you want to enable Strava integration. Strava callback relies on this. You may need to update this variable based on docker image spin up (api host or local ip (example: http://192.168.1.10:98)) |
| MY_APP_BACKEND_HOST | localhost:98 | Yes | Needs to be set and be Internet faced/resolved if you want to enable Strava integration. Strava callback relies on this. You may need to update this variable based on docker image spin up (api host or local ip (example: http://192.168.1.10:98)) |
| MY_APP_STRAVA_CLIENT_ID | changeme | Yes | Needs to be set with your Strava API Client ID if you want to enable Strava integration. |
Frontend dependencies:
- To check npm dependencies used, use npm file (package.json)
- User avatars create using DiceBear (https://www.dicebear.com) avataaars style.
- Logo created on Canva
## Backend Environment Variables
## Supported Environment Variables
Table below shows supported environment variables. Variables marked with optional "No" should be set to avoid errors.
Environment variable | Default value | Optional | Notes |
| --- | --- | --- | --- |
| 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 |
| DB_TYPE | mariadb | Yes | mariadb or postgres |
| DB_HOST | mariadb | Yes | mariadb or postgres |
| DB_PORT | 3306 | Yes | 3306 or 5432 |
| DB_TYPE | postgres | Yes | mariadb or postgres |
| DB_HOST | postgres | Yes | mariadb or postgres |
| DB_PORT | 5432 | Yes | 3306 or 5432 |
| DB_USER | endurain | Yes | N/A |
| DB_PASSWORD | changeme | `No` | N/A |
| DB_DATABASE | endurain | Yes | N/A |
@@ -47,16 +32,16 @@ Environment variable | Default value | Optional | Notes |
| ALGORITHM | HS256 | Yes | Currently only HS256 is supported |
| ACCESS_TOKEN_EXPIRE_MINUTES | 15 | Yes | Time in minutes |
| REFRESH_TOKEN_EXPIRE_DAYS | 7 | Yes | Time in days |
| STRAVA_CLIENT_ID | changeme | `No` | Needed if you want to enable the Strava integration |
| STRAVA_CLIENT_SECRET | changeme | `No` | Needed if you want to enable the Strava integration |
| STRAVA_AUTH_CODE | changeme | `No` | Needed if you want to enable the Strava integration |
| STRAVA_CLIENT_ID | changeme | Yes | Needed if you want to enable the Strava integration |
| STRAVA_CLIENT_SECRET | changeme | Yes | Needed if you want to enable the Strava integration |
| STRAVA_AUTH_CODE | changeme | Yes | Needed if you want to enable the Strava integration |
| JAEGER_ENABLED | false | Yes | N/A |
| JAEGER_PROTOCOL | http | Yes | N/A |
| JAEGER_HOST | jaeger | Yes | N/A |
| JAGGER_PORT | 4317 | Yes | N/A |
| FRONTEND_PROTOCOL | http | Yes | Needs to be set if you want to enable Strava integration. You may need to update this variable based on docker image spin up (frontend host or local ip (example: http://192.168.1.10:8080)) |
| ENDURAIN_HOST | http://frontend:8080 | Yes | Required for internal communication and Strava. For Strava https must be used |
| ENDURAIN_HOST | http://frontend:8080 | `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) |
| GEOCODES_MAPS_API | changeme | `No` | <a href="https://geocode.maps.co/">Geocode maps</a> offers a free plan consisting of 1 Request/Second. Registration necessary. |
| BEHIND_PROXY | false | Yes | Change to true if behind reverse proxy |
Table below shows the obligatory environment variables for mariadb container. You should set them based on what was also set for backend container.
@@ -76,7 +61,13 @@ Table below shows the obligatory environment variables for postgres container. Y
| POSTGRES_USER | endurain | `No` | N/A |
| PGDATA | /var/lib/postgresql/data/pgdata | `No` | N/A |
To check Python backend dependencies used, use poetry file (pyproject.toml)
To check Python backend dependencies used, use poetry file (pyproject.toml).
Frontend dependencies:
- To check npm dependencies used, use npm file (package.json)
- User avatars create using DiceBear (https://www.dicebear.com) avataaars style.
- Logo created on Canva
## Volumes

View File

@@ -33,7 +33,7 @@ Endurain is a self-hosted fitness tracking service designed to give users full c
- **Database:** MariaDB or PostgreSQL for efficient user data management
- **Observability:** Jaeger for basic tracing and monitoring
To deploy Endurain, Docker images are available, and a comprehensive example can be found in the "docker-compose.yml.example" file provided in the project repository. Configuration is facilitated through environment variables, ensuring flexibility and ease of customization. More details bellow.
To deploy Endurain, a Docker image is available, and a comprehensive example can be found in the "docker-compose.yml.example" file provided in the project repository. Configuration is facilitated through environment variables, ensuring flexibility and ease of customization. More details bellow.
## Developer's Note
@@ -64,7 +64,6 @@ Endurain currently supports:
Upcoming features (in no particular order):
- Simplified Docker images
- Live tracking
- Default gear for activity types
- Gear component tracking (e.g., track when components like bike chains need replacing)

View File

@@ -4,7 +4,7 @@
## Strava Integration
> [!WARNING]
> ⚠️ **Warning**
> Due to recent Strava API changes, expect changes in the Strava integration in a following release.
To enable Strava integration, ensure your API endpoint is accessible from the internet and follow Strava's [API setup guide](https://developers.strava.com/docs/getting-started/). After the integration is successful the access and refresh tokens are stored in the DB. Each user will have his/hers own pair.