Merge pull request #1339 from aliaksei135/garmin-grafana
Garmin Grafana Updates
This commit is contained in:
commit
56625b1c76
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/raw/main/misc/build.func)
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||||
# Copyright (c) 2021-2026 community-scripts ORG
|
# Copyright (c) 2021-2026 community-scripts ORG
|
||||||
# Author: aliaksei135
|
# Author: aliaksei135
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
|||||||
@ -28,8 +28,8 @@ setup_uv
|
|||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Setting up InfluxDB Repository"
|
msg_info "Setting up InfluxDB Repository"
|
||||||
curl -fsSL "https://repos.influxdata.com/influxdata-archive_compat.key" | gpg --dearmor >/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg
|
curl -fsSL "https://repos.influxdata.com/influxdata-archive.key" | gpg --dearmor >/etc/apt/trusted.gpg.d/influxdata-archive.gpg
|
||||||
echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main" >/etc/apt/sources.list.d/influxdata.list
|
echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main" >/etc/apt/sources.list.d/influxdata.list
|
||||||
msg_ok "Set up InfluxDB Repository"
|
msg_ok "Set up InfluxDB Repository"
|
||||||
|
|
||||||
# garmin-grafana recommends influxdb v1
|
# garmin-grafana recommends influxdb v1
|
||||||
@ -37,8 +37,8 @@ msg_ok "Set up InfluxDB Repository"
|
|||||||
msg_info "Installing InfluxDB"
|
msg_info "Installing InfluxDB"
|
||||||
$STD apt-get update
|
$STD apt-get update
|
||||||
$STD apt-get install -y influxdb
|
$STD apt-get install -y influxdb
|
||||||
curl -fsSL "https://dl.influxdata.com/chronograf/releases/chronograf_1.10.7_amd64.deb" -o "$(basename "https://dl.influxdata.com/chronograf/releases/chronograf_1.10.7_amd64.deb")"
|
curl -fsSL "https://dl.influxdata.com/chronograf/releases/chronograf_1.10.9_amd64.deb" -o "$(basename "https://dl.influxdata.com/chronograf/releases/chronograf_1.10.9_amd64.deb")"
|
||||||
$STD dpkg -i chronograf_1.10.7_amd64.deb
|
$STD dpkg -i chronograf_1.10.9_amd64.deb
|
||||||
msg_ok "Installed InfluxDB"
|
msg_ok "Installed InfluxDB"
|
||||||
|
|
||||||
msg_info "Setting up InfluxDB"
|
msg_info "Setting up InfluxDB"
|
||||||
@ -110,7 +110,8 @@ msg_ok "Installed garmin-grafana"
|
|||||||
|
|
||||||
msg_info "Setting up garmin-grafana"
|
msg_info "Setting up garmin-grafana"
|
||||||
# Check if using Chinese garmin servers
|
# Check if using Chinese garmin servers
|
||||||
if prompt_confirm "Are you using Garmin in mainland China?" "n" 60; then
|
read -rp "Are you using Garmin in mainland China? (y/N): " prompt
|
||||||
|
if [[ "${prompt,,}" =~ ^(y|yes|Y)$ ]]; then
|
||||||
GARMIN_CN="True"
|
GARMIN_CN="True"
|
||||||
else
|
else
|
||||||
GARMIN_CN="False"
|
GARMIN_CN="False"
|
||||||
@ -130,9 +131,9 @@ EOF
|
|||||||
# garmin-grafana usually prompts the user for email and password (and MFA) on first run,
|
# garmin-grafana usually prompts the user for email and password (and MFA) on first run,
|
||||||
# then stores a refreshable token. We try to avoid storing user credentials in the env vars
|
# then stores a refreshable token. We try to avoid storing user credentials in the env vars
|
||||||
if [ -z "$(ls -A /opt/garmin-grafana/.garminconnect)" ]; then
|
if [ -z "$(ls -A /opt/garmin-grafana/.garminconnect)" ]; then
|
||||||
GARMIN_EMAIL=$(prompt_input "Please enter your Garmin Connect Email:" "" 120)
|
read -r -p "Please enter your Garmin Connect Email: " GARMIN_EMAIL
|
||||||
GARMIN_PASSWORD=$(prompt_password "Please enter your Garmin Connect Password (used to generate token, NOT stored):" "" 120)
|
read -r -p "Please enter your Garmin Connect Password (this is used to generate a token and NOT stored): " GARMIN_PASSWORD
|
||||||
GARMIN_MFA=$(prompt_input "Please enter your MFA Code (leave blank if not applicable):" "" 60)
|
read -r -p "Please enter your MFA Code (if applicable, leave blank if not): " GARMIN_MFA
|
||||||
# Run the script once to prompt for credential
|
# Run the script once to prompt for credential
|
||||||
msg_info "Creating Garmin credentials, this will timeout in 60 seconds"
|
msg_info "Creating Garmin credentials, this will timeout in 60 seconds"
|
||||||
timeout 60s uv run --env-file /opt/garmin-grafana/.env --project /opt/garmin-grafana/ /opt/garmin-grafana/src/garmin_grafana/garmin_fetch.py <<EOF
|
timeout 60s uv run --env-file /opt/garmin-grafana/.env --project /opt/garmin-grafana/ /opt/garmin-grafana/src/garmin_grafana/garmin_fetch.py <<EOF
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user