Initial commit

Signed-off-by: Thomas Klaehn <thomas.klaehn@perinet.io>
This commit is contained in:
Thomas Klaehn
2026-02-10 11:47:49 +01:00
commit c54fa58c35
17 changed files with 1834 additions and 0 deletions

33
run-local.sh Normal file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
# Script to run Zwift monitor locally with proper configuration
# Check if credentials are set
if [ -z "$ZWIFT_USERNAME" ] || [ -z "$ZWIFT_PASSWORD" ]; then
echo "Error: ZWIFT_USERNAME and ZWIFT_PASSWORD must be set"
echo ""
echo "Usage:"
echo " export ZWIFT_USERNAME=your@email.com"
echo " export ZWIFT_PASSWORD=yourpassword"
echo " ./run-local.sh"
exit 1
fi
# Set local paths (relative to current directory)
export ZWIFT_OUTPUT_DIR="$(pwd)/data/activities"
export ZWIFT_STATE_FILE="$(pwd)/data/zwift-state.json"
export ZWIFT_TOKEN_CACHE="$(pwd)/data/.zwift-token.json"
export ZWIFT_LOG_LEVEL="${ZWIFT_LOG_LEVEL:-info}"
export ZWIFT_POLL_INTERVAL="${ZWIFT_POLL_INTERVAL:-5m}"
# Create data directory if it doesn't exist
mkdir -p "$ZWIFT_OUTPUT_DIR"
echo "Starting Zwift Activity Monitor..."
echo "Output directory: $ZWIFT_OUTPUT_DIR"
echo "State file: $ZWIFT_STATE_FILE"
echo "Log level: $ZWIFT_LOG_LEVEL"
echo "Poll interval: $ZWIFT_POLL_INTERVAL"
echo ""
# Run the monitor
./zwift-monitor