Compare commits
11 Commits
main
...
81c22b7c7a
| Author | SHA1 | Date | |
|---|---|---|---|
| 81c22b7c7a | |||
| 08f669a770 | |||
| 4b81b5abec | |||
| e649a0f5de | |||
| 08c28fc1ef | |||
| 1f192652c4 | |||
| 10092050f2 | |||
| 15c8e50ca3 | |||
| 8381ff9485 | |||
| 81d68696cf | |||
| 0e1ef8f63b |
@@ -13,12 +13,3 @@ GARMINCONNECT_PASSWORD=your_garmin_password_base64_encoded
|
||||
GARMINCONNECT_TOKENS=./garminconnect-tokens
|
||||
PATH_TO_INFLUXDB_DATA=./influxdb_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
|
||||
|
||||
@@ -11,82 +11,14 @@ This directory contains the configuration for a set of services that fetches dat
|
||||
## How to start
|
||||
|
||||
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.
|
||||
3. **If you have 2FA enabled:** You must authenticate manually once to generate the session tokens.
|
||||
```bash
|
||||
docker-compose run --rm garmin-fetch-data
|
||||
```
|
||||
Enter your 2FA code when prompted. The tokens will be saved to the `./garminconnect_tokens` folder.
|
||||
2. Set the `GARMINCONNECT_EMAIL` and `GARMINCONNECT_PASSWORD` variables in the `.env` file.
|
||||
3. Run `docker-compose up -d` to start the application.
|
||||
|
||||
> **Server Console (Komodo/Portainer) - Robust Method:**
|
||||
> 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`.
|
||||
## Setup
|
||||
|
||||
4. Run `docker-compose up -d` to start the application.
|
||||
|
||||
## Setup & Access
|
||||
|
||||
After starting the application, you can access the Grafana web interface at [http://localhost:3000](http://localhost:3000).
|
||||
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:
|
||||
|
||||
- **User**: `admin`
|
||||
- **Password**: `admin`
|
||||
|
||||
## Setup Data Source
|
||||
|
||||
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.*
|
||||
You can then configure a new data source for InfluxDB and create dashboards to visualize your Garmin Connect data.
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
influxdb:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- ${GARMINCONNECT_TOKENS}:/home/appuser/.garminconnect # Local folder for tokens
|
||||
- garminconnect_tokens:/home/appuser/.garminconnect # persisted tokens storage (named volume)
|
||||
environment:
|
||||
- INFLUXDB_HOST=influxdb
|
||||
- INFLUXDB_PORT=8086
|
||||
@@ -18,13 +18,6 @@ services:
|
||||
- LOG_LEVEL=INFO
|
||||
- GARMINCONNECT_EMAIL=${GARMINCONNECT_EMAIL}
|
||||
- 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:
|
||||
- garmin-grafana-net
|
||||
|
||||
@@ -32,7 +25,7 @@ services:
|
||||
restart: unless-stopped
|
||||
container_name: influxdb
|
||||
hostname: influxdb
|
||||
image: influxdb:1.8
|
||||
image: influxdb:latest
|
||||
environment:
|
||||
- INFLUXDB_DB=GarminStats
|
||||
- INFLUXDB_USER=influxdb_user
|
||||
@@ -41,9 +34,9 @@ services:
|
||||
ports:
|
||||
- '8086:8086'
|
||||
volumes:
|
||||
- influxdb_data:/var/lib/influxdb
|
||||
- influxdb_data:/var/lib/influxdb
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:8086/ping" ]
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8086/ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -63,7 +56,7 @@ services:
|
||||
ports:
|
||||
- '3000:3000'
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:3000/api/health" ]
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -75,6 +68,8 @@ networks:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
garminconnect_tokens:
|
||||
name: garminconnect_tokens
|
||||
influxdb_data:
|
||||
name: influxdb_data
|
||||
grafana_data:
|
||||
|
||||
@@ -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
|
||||
@@ -1,27 +1,3 @@
|
||||
HOMEPAGE_VAR_PROXMOX_URL=https://proxmox.example.com:8006
|
||||
HOMEPAGE_VAR_PROXMOX_PAM=root@pam
|
||||
HOMEPAGE_VAR_PROXMOX_SECRET='your_proxmox_api_token'
|
||||
HOMEPAGE_VAR_PORTAINER_URL=https://portainer.example.com
|
||||
HOMEPAGE_VAR_PORTAINER_KEY='your_portainer_api_token'
|
||||
HOMEPAGE_VAR_TRUENAS_URL=http://truenas.example.com
|
||||
HOMEPAGE_VAR_TRUENAS_KEY='your_truenas_api_token'
|
||||
HOMEPAGE_VAR_TRANSMISSION_URL=http://transmission.example.com:9091
|
||||
HOMEPAGE_VAR_IMMICH_URL=http://immich.example.com
|
||||
HOMEPAGE_VAR_IMMICH_KEY='your_immich_api_token'
|
||||
HOMEPAGE_VAR_SEAFILE_URL=https://seafile.example.com/
|
||||
HOMEPAGE_VAR_NPM_URL=http://npm.example.com:81
|
||||
HOMEPAGE_VAR_NPM_USER=user@example.com
|
||||
HOMEPAGE_VAR_NPM_PASS='your_npm_password'
|
||||
HOMEPAGE_VAR_ADGUARD_URL=http://adguard.example.com
|
||||
HOMEPAGE_VAR_ADGUARD_USER='your_adguard_username'
|
||||
HOMEPAGE_VAR_ADGUARD_PASS='your_adguard_password'
|
||||
HOMEPAGE_VAR_GUACAMOLE_URL=http://guacamole.example.com
|
||||
HOMEPAGE_VAR_WEBTOP_URL=http://webtop.example.com
|
||||
HOMEPAGE_VAR_LENOVO_AMT_URL=http://amt.example.com:16992
|
||||
HOMEPAGE_VAR_ZABBIX_URL=https://zabbix.example.com
|
||||
HOMEPAGE_VAR_ZABBIX_KEY='your_zabbix_api_token'
|
||||
HOMEPAGE_VAR_GRAFANA_URL=https://grafana.example.com
|
||||
HOMEPAGE_VAR_IT_TOOLS_URL=http://it-tools.example.com
|
||||
HOMEPAGE_VAR_VAULTWARDEN_URL=https://vaultwarden.example.com
|
||||
HOMEPAGE_VAR_GITEA_URL=http://gitea.example.com:3000
|
||||
HOMEPAGE_VAR_GITEA_KEY='your_gitea_api_token'
|
||||
# Authentication parameters for Proxmox API
|
||||
HOMEPAGE_VAR_PROXMOX_PAM=${HOMEPAGE_VAR_PROXMOX_PAM}
|
||||
HOMEPAGE_VAR_PROXMOX_SECRET=${HOMEPAGE_VAR_PROXMOX_SECRET}
|
||||
@@ -4,14 +4,14 @@ services:
|
||||
container_name: homepage
|
||||
ports:
|
||||
- "3001:3000"
|
||||
env_file:
|
||||
- .env # Make sure this file exists and contains necessary environment variables (chek .env.example)
|
||||
volumes:
|
||||
- ${PATH_TO_CONFIG}:/app/config # Make sure your local config directory exists
|
||||
- /var/run/docker.sock:/var/run/docker.sock # (optional) For docker integrations
|
||||
env_file:
|
||||
- .env
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:3000"]
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
SEMAPHORE_ADMIN=admin
|
||||
SEMAPHORE_ADMIN_PASSWORD=changeme
|
||||
SEMAPHORE_ADMIN_NAME=Admin
|
||||
SEMAPHORE_ADMIN_EMAIL=admin@example.com
|
||||
=======
|
||||
ADMIN_USER=admin
|
||||
ADMIN_PASS=changeme
|
||||
ADMIN_NAME=Admin
|
||||
ADMIN_EMAIL=admin@example.com
|
||||
>>>>>>> ab90593 (ADD: Semaphore UI initial commit)
|
||||
SEMAPHORE_ADMIN_EMAIL=admin@example.com
|
||||
@@ -1,6 +0,0 @@
|
||||
# SiYuan Note Configuration
|
||||
SIYUAN_ACCESS_CODE=changeme123
|
||||
SIYUAN_PORT=6800
|
||||
SIYUAN_DATA_DIR=/mnt/media/siyuan
|
||||
# Timezone
|
||||
TZ=Etc/UTC
|
||||
@@ -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}
|
||||
Reference in New Issue
Block a user