diff --git a/ct/garmin-grafana.sh b/ct/garmin-grafana.sh index cdda1b605..ec6a430a5 100644 --- a/ct/garmin-grafana.sh +++ b/ct/garmin-grafana.sh @@ -1,5 +1,5 @@ #!/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 # Author: aliaksei135 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/install/garmin-grafana-install.sh b/install/garmin-grafana-install.sh index 12dc4f8d7..c1688a2e8 100644 --- a/install/garmin-grafana-install.sh +++ b/install/garmin-grafana-install.sh @@ -17,19 +17,19 @@ update_os # Installing Dependencies msg_info "Installing Dependencies" $STD apt-get install -y \ - apt-transport-https \ - software-properties-common \ - lsb-base \ - lsb-release \ - python3 \ - python3-requests \ - python3-dotenv + apt-transport-https \ + software-properties-common \ + lsb-base \ + lsb-release \ + python3 \ + python3-requests \ + python3-dotenv setup_uv msg_ok "Installed Dependencies" 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 -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 +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.gpg] https://repos.influxdata.com/debian stable main" >/etc/apt/sources.list.d/influxdata.list msg_ok "Set up InfluxDB Repository" # garmin-grafana recommends influxdb v1 @@ -37,8 +37,8 @@ msg_ok "Set up InfluxDB Repository" msg_info "Installing InfluxDB" $STD apt-get update $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")" -$STD dpkg -i 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.9_amd64.deb msg_ok "Installed InfluxDB" msg_info "Setting up InfluxDB" @@ -77,9 +77,9 @@ $STD grafana-cli plugins install marcusolsson-hourly-heatmap-panel $STD systemctl restart grafana-server # Output credentials to file { - echo "Grafana Credentials" - echo "Grafana User: ${GRAFANA_USER}" - echo "Grafana Password: ${GRAFANA_PASS}" + echo "Grafana Credentials" + echo "Grafana User: ${GRAFANA_USER}" + echo "Grafana Password: ${GRAFANA_PASS}" } >>~/garmin-grafana.creds msg_ok "Set up Grafana" @@ -90,7 +90,7 @@ curl -fsSL -o "${RELEASE}.zip" "https://github.com/arpanghosh8453/garmin-grafana unzip -q "${RELEASE}.zip" # Remove the v prefix to RELEASE if it exists if [[ "${RELEASE}" == v* ]]; then - RELEASE="${RELEASE:1}" + RELEASE="${RELEASE:1}" fi mv "garmin-grafana-${RELEASE}/" "/opt/garmin-grafana" mkdir -p /opt/garmin-grafana/.garminconnect @@ -110,10 +110,11 @@ msg_ok "Installed garmin-grafana" msg_info "Setting up garmin-grafana" # Check if using Chinese garmin servers -if prompt_confirm "Are you using Garmin in mainland China?" "n" 60; then - GARMIN_CN="True" +read -rp "Are you using Garmin in mainland China? (y/N): " prompt +if [[ "${prompt,,}" =~ ^(y|yes|Y)$ ]]; then + GARMIN_CN="True" else - GARMIN_CN="False" + GARMIN_CN="False" fi cat </opt/garmin-grafana/.env @@ -130,24 +131,24 @@ EOF # 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 if [ -z "$(ls -A /opt/garmin-grafana/.garminconnect)" ]; then - GARMIN_EMAIL=$(prompt_input "Please enter your Garmin Connect Email:" "" 120) - GARMIN_PASSWORD=$(prompt_password "Please enter your Garmin Connect Password (used to generate token, NOT stored):" "" 120) - GARMIN_MFA=$(prompt_input "Please enter your MFA Code (leave blank if not applicable):" "" 60) - # Run the script once to prompt for credential - 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 <