19 Commits

Author SHA1 Message Date
33ef444052 FIX: Localhost check replaced with IP and now should work 2025-08-28 12:40:36 +02:00
f8328ab96c FIX: Fixed env file 2025-08-28 12:40:36 +02:00
7524f5666c FIX: Dropped env_file from the compose. because it leads to conflicts 2025-08-28 12:40:36 +02:00
e117bd0180 ADD: .env example file 2025-08-28 12:40:04 +02:00
e5adc77c74 FIX: Added blank .env 2025-08-28 12:40:04 +02:00
7b1f93b654 FIX: Fixing broken rebase :D 2025-08-28 12:40:04 +02:00
f234d3846d ADD: Semaphore UI initial commit 2025-08-28 12:40:04 +02:00
ad3f7e1d8f ADD: Semaphore UI initial commit 2025-08-28 12:39:56 +02:00
81c22b7c7a FIX: Changed all .yml to .yaml in orded to have the same way 2025-08-28 12:35:48 +02:00
08f669a770 ADD: Agent compose file 2025-08-27 22:46:08 +02:00
4b81b5abec FIX: Incorrect indentation 2025-08-27 22:29:40 +02:00
e649a0f5de FIX: yaml: line 1: did not find expected key 2025-08-27 22:26:38 +02:00
08c28fc1ef CHANGE: Bind to named mounts 2025-08-27 22:24:55 +02:00
1f192652c4 FIX: Changed mongo version to 4.4.18 because of AVX support 2025-08-27 20:04:33 +02:00
10092050f2 FIX: Typo 2025-08-27 20:00:03 +02:00
15c8e50ca3 CHANGE: Added container names 2025-08-27 19:59:38 +02:00
8381ff9485 FIX: Replaced second compose.env :D 2025-08-27 19:54:49 +02:00
81d68696cf FIX: compose.env was replaced with .env 2025-08-27 19:54:08 +02:00
0e1ef8f63b ADD: Komodo 2025-08-27 19:07:30 +02:00
7 changed files with 29 additions and 127 deletions

View File

@@ -13,12 +13,3 @@ 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

@@ -11,82 +11,14 @@ This directory contains the configuration for a set of services that fetches dat
## How to start ## How to start
1. Create a `.env` file based on the `.env.example` file. 1. Create a `.env` file based on the `.env.example` file.
2. Set the `GARMINCONNECT_EMAIL` and `GARMINCONNECT_PASSWORD` (Base64 encoded) variables in the `.env` file. 2. Set the `GARMINCONNECT_EMAIL` and `GARMINCONNECT_PASSWORD` variables in the `.env` file.
3. **If you have 2FA enabled:** You must authenticate manually once to generate the session tokens. 3. Run `docker-compose up -d` to start the application.
```bash
docker-compose run --rm garmin-fetch-data
```
Enter your 2FA code when prompted. The tokens will be saved to the `./garminconnect_tokens` folder.
> **Server Console (Komodo/Portainer) - Robust Method:** ## Setup
> The fetcher requires a database connection to start. Use the provided [`server-token-setup.yaml`](./server-token-setup.yaml) file.
>
> 1. Copy `server-token-setup.yaml` to your server.
> 2. **Important:** Ensure the target folder exists and is writable by the container user (UID 1000):
> ```bash
> sudo mkdir -p /opt/docker/garmin-grafana/tokens
> sudo chown -R 1000:1000 /opt/docker/garmin-grafana/tokens
> ```
> 3. Run:
> ```bash
> docker-compose -f server-token-setup.yaml run --rm setup-fetcher
> ```
> The script will interactively prompt you for your **Garmin Email**, **Password (Plain Text)**, and **2FA Code**.
> The tokens will be generated in `/opt/docker/garmin-grafana/tokens` (as defined in the yaml).
>
> Finally, in Komodo/Portainer, set the environment variable `GARMINCONNECT_TOKENS=/opt/docker/garmin-grafana/tokens`.
4. Run `docker-compose up -d` to start the application. After starting the application, you can access the Grafana web interface at [http://localhost:3000](http://localhost:3000) and log in with the default credentials:
## Setup & Access
After starting the application, you can access the Grafana web interface at [http://localhost:3000](http://localhost:3000).
- **User**: `admin` - **User**: `admin`
- **Password**: `admin` - **Password**: `admin`
## Setup Data Source You can then configure a new data source for InfluxDB and create dashboards to visualize your Garmin Connect data.
Before importing the dashboard, you must connect Grafana to InfluxDB.
1. Go to **Connections -> Data Sources -> Add data source**.
2. Select **InfluxDB**.
3. Configure with these settings:
- **Query Language**: `InfluxQL` (default)
- **URL**: `http://influxdb:8086`
- **Database**: `GarminStats`
- **User**: `influxdb_user`
- **Password**: `influxdb_secret_password` (or whatever you set in `.env` for `INFLUXDB_PASSWORD`)
- **HTTP Method**: `GET`
4. Click **Save & Test**. You should see "Data source is working".
## Setup Dashboard
You need to manually import the dashboard into Grafana to visualize your data.
**Method 1: Import via ID (Recommended)**
1. Go to Grafana (`http://localhost:3000`).
2. Navigate to **Dashboards -> New -> Import**.
3. Enter the Dashboard ID: `23245` and click **Load**.
4. Select your InfluxDB data source and click **Import**.
**Method 2: Import via JSON File**
1. Download the dashboard JSON file:
[Garmin-Grafana-Dashboard.json](https://raw.githubusercontent.com/arpanghosh8453/garmin-grafana/main/Grafana_Dashboard/Garmin-Grafana-Dashboard.json)
2. Go to Grafana -> **Dashboards -> New -> Import**.
3. Upload the downloaded JSON file.
4. Select your InfluxDB data source and click **Import**.
## Historical Data Download (Bulk Import)
To download old history **without modifying your configuration files**, use the `docker-compose run` command with the `-e` flag. This starts a temporary container just for this task.
```bash
docker-compose run --rm -e MANUAL_START_DATE=2025-01-01 garmin-fetch-data
```
**Options:**
- `MANUAL_END_DATE=YYYY-MM-DD`: Optional end date (defaults to today).
- `FETCH_SELECTION=...`: Limit what data is fetched (e.g., `activity,sleep`).
*Note: Garmin archives intraday data older than 6 months, so very old detailed data (HR, sleep stages) might be missing unless manually refreshed in the Garmin Connect app.*

View File

@@ -7,7 +7,7 @@ services:
influxdb: influxdb:
condition: service_healthy condition: service_healthy
volumes: volumes:
- ${GARMINCONNECT_TOKENS}:/home/appuser/.garminconnect # Local folder for tokens - garminconnect_tokens:/home/appuser/.garminconnect # persisted tokens storage (named volume)
environment: environment:
- INFLUXDB_HOST=influxdb - INFLUXDB_HOST=influxdb
- INFLUXDB_PORT=8086 - INFLUXDB_PORT=8086
@@ -18,13 +18,6 @@ services:
- LOG_LEVEL=INFO - LOG_LEVEL=INFO
- GARMINCONNECT_EMAIL=${GARMINCONNECT_EMAIL} - GARMINCONNECT_EMAIL=${GARMINCONNECT_EMAIL}
- GARMINCONNECT_BASE64_PASSWORD=${GARMINCONNECT_PASSWORD} # (must be base64 encoded) - GARMINCONNECT_BASE64_PASSWORD=${GARMINCONNECT_PASSWORD} # (must be base64 encoded)
- GARMINCONNECT_IS_CN=False
# - USER_TIMEZONE=Europe/Paris # Optional: Override automatic timezone detection
# - FETCH_SELECTION=daily_avg,sleep,steps,heartrate,stress # Optional: Select specific data to fetch
# - KEEP_FIT_FILES=False
# - ALWAYS_PROCESS_FIT_FILES=False
# - MANUAL_START_DATE=2023-01-01 # For bulk import: set date and run with docker-compose run ...
# - MANUAL_END_DATE=2023-01-31 # For bulk import: defaults to today if unset
networks: networks:
- garmin-grafana-net - garmin-grafana-net
@@ -32,7 +25,7 @@ services:
restart: unless-stopped restart: unless-stopped
container_name: influxdb container_name: influxdb
hostname: influxdb hostname: influxdb
image: influxdb:1.8 image: influxdb:latest
environment: environment:
- INFLUXDB_DB=GarminStats - INFLUXDB_DB=GarminStats
- INFLUXDB_USER=influxdb_user - INFLUXDB_USER=influxdb_user
@@ -41,9 +34,9 @@ services:
ports: ports:
- '8086:8086' - '8086:8086'
volumes: volumes:
- influxdb_data:/var/lib/influxdb - influxdb_data:/var/lib/influxdb
healthcheck: healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8086/ping" ] test: ["CMD", "curl", "-f", "http://localhost:8086/ping"]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
@@ -63,7 +56,7 @@ services:
ports: ports:
- '3000:3000' - '3000:3000'
healthcheck: healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:3000/api/health" ] test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
@@ -75,6 +68,8 @@ 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:

View File

@@ -1,15 +0,0 @@
services:
setup-fetcher:
image: thisisarpanghosh/garmin-fetch-data:latest
depends_on:
- temp-influxdb
volumes:
- /opt/docker/garmin-grafana/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

View File

@@ -0,0 +1,17 @@
services:
semaphore:
ports:
- 3030:3000
image: semaphoreui/semaphore:v2.16.18
environment:
SEMAPHORE_DB_DIALECT: sqlite
SEMAPHORE_ADMIN: ${ADMIN_USER}
SEMAPHORE_ADMIN_PASSWORD: ${ADMIN_PASS}
SEMAPHORE_ADMIN_NAME: ${ADMIN_NAME}
SEMAPHORE_ADMIN_EMAIL: ${ADMIN_EMAIL}
volumes:
- semaphore-data:/var/lib/semaphore
- semaphore-config:/etc/semaphore
volumes:
semaphore-data:
semaphore-config:

View File

@@ -1,6 +0,0 @@
# SiYuan Note Configuration
SIYUAN_ACCESS_CODE=changeme123
SIYUAN_PORT=6800
SIYUAN_DATA_DIR=/mnt/media/siyuan
# Timezone
TZ=Etc/UTC

View File

@@ -1,12 +0,0 @@
services:
siyuan:
image: b3log/siyuan
container_name: siyuan
command: [ "--workspace=/siyuan/workspace", "--accessAuthCode=${SIYUAN_ACCESS_CODE}" ]
ports:
- "${SIYUAN_PORT:-6806}:6806"
volumes:
- "${SIYUAN_DATA_DIR}:/siyuan/workspace"
restart: unless-stopped
environment:
- TZ=${TZ}