Change: Added persistent path to store OAuth tokens.

This commit is contained in:
2025-12-24 15:48:06 +01:00
parent 068f5e2d6f
commit ab324ed97b
3 changed files with 22 additions and 4 deletions

View File

@@ -13,3 +13,12 @@ GARMINCONNECT_PASSWORD=your_garmin_password_base64_encoded
GARMINCONNECT_TOKENS=./garminconnect-tokens GARMINCONNECT_TOKENS=./garminconnect-tokens
PATH_TO_INFLUXDB_DATA=./influxdb_data PATH_TO_INFLUXDB_DATA=./influxdb_data
PATH_TO_GRAFANA_DATA=./grafana_data PATH_TO_GRAFANA_DATA=./grafana_data
# Advanced Configuration
GARMINCONNECT_IS_CN=False
# USER_TIMEZONE=Europe/Paris
# FETCH_SELECTION=daily_avg,sleep,steps,heartrate,stress
# KEEP_FIT_FILES=False
# ALWAYS_PROCESS_FIT_FILES=False
# MANUAL_START_DATE=2024-01-01
# MANUAL_END_DATE=2024-01-31

View File

@@ -16,7 +16,18 @@ This directory contains the configuration for a set of services that fetches dat
```bash ```bash
docker-compose run --rm garmin-fetch-data docker-compose run --rm garmin-fetch-data
``` ```
Enter your 2FA code when prompted. The tokens will be saved to the `garminconnect_tokens` volume. Enter your 2FA code when prompted. The tokens will be saved to the `./garminconnect_tokens` folder.
> **Server Console (Komodo/Portainer):**
> If you can SSH into your server but don't know where Komodo stores the stack files:
> 1. Create a permanent directory for tokens: `mkdir -p /opt/garmin/tokens`
> 2. Run the generator manually, mounting this directory:
> ```bash
> docker run --rm -it -v /opt/garmin/tokens:/home/appuser/.garminconnect thisisarpanghosh/garmin-fetch-data:latest
> ```
> 3. Enter your 2FA code.
> 4. In Komodo/Portainer, configure your stack's "Environment Variables" to set the `GARMINCONNECT_TOKENS` variable to the path of the tokens folder.
4. Run `docker-compose up -d` to start the application. 4. Run `docker-compose up -d` to start the application.
## Setup & Access ## Setup & Access

View File

@@ -7,7 +7,7 @@ services:
influxdb: influxdb:
condition: service_healthy condition: service_healthy
volumes: volumes:
- garminconnect_tokens:/home/appuser/.garminconnect # persisted tokens storage (named volume) - ${GARMINCONNECT_TOKENS}:/home/appuser/.garminconnect # Local folder for tokens
environment: environment:
- INFLUXDB_HOST=influxdb - INFLUXDB_HOST=influxdb
- INFLUXDB_PORT=8086 - INFLUXDB_PORT=8086
@@ -75,8 +75,6 @@ networks:
driver: bridge driver: bridge
volumes: volumes:
garminconnect_tokens:
name: garminconnect_tokens
influxdb_data: influxdb_data:
name: influxdb_data name: influxdb_data
grafana_data: grafana_data: