diff --git a/garmin-grafana/README.md b/garmin-grafana/README.md index 39bdbb3..65e81af 100644 --- a/garmin-grafana/README.md +++ b/garmin-grafana/README.md @@ -18,15 +18,18 @@ This directory contains the configuration for a set of services that fetches dat ``` 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: + > **Server Console (Komodo/Portainer) - Robust Method:** + > The fetcher requires a database connection to start. Use the provided [`server-token-setup.yml`](./server-token-setup.yml) file. + > + > 1. Copy `server-token-setup.yml` to your server. + > 2. Run: > ```bash - > docker run --rm -it -v /opt/garmin/tokens:/home/appuser/.garminconnect thisisarpanghosh/garmin-fetch-data:latest + > docker-compose -f server-token-setup.yml run --rm setup-fetcher > ``` - > 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. + > The script will interactively prompt you for your **Garmin Email**, **Password**, and **2FA Code**. + > The tokens will be generated in `/opt/garmin/tokens` (as defined in the yaml). + > + > Finally, in Komodo/Portainer, set the environment variable `GARMINCONNECT_TOKENS=/opt/garmin/tokens`. 4. Run `docker-compose up -d` to start the application. diff --git a/garmin-grafana/server-token-setup.yaml b/garmin-grafana/server-token-setup.yaml new file mode 100644 index 0000000..25df8c6 --- /dev/null +++ b/garmin-grafana/server-token-setup.yaml @@ -0,0 +1,15 @@ +services: + setup-fetcher: + image: thisisarpanghosh/garmin-fetch-data:latest + depends_on: + - temp-influxdb + volumes: + - /opt/garmin/tokens:/home/appuser/.garminconnect + environment: + - INFLUXDB_HOST=temp-influxdb + - INFLUXDB_PORT=8086 + - INFLUXDB_DATABASE=GarminStats + temp-influxdb: + image: influxdb:1.8 + environment: + - INFLUXDB_DB=GarminStats