release-tracker

Environment Variables Reference

This document provides a comprehensive reference for all environment variables supported by the Release Tracker project, including their purposes, usage examples, and default values.

📋 Table of Contents

🔧 Core Configuration

CONFIG_SOURCE

🔐 Authentication Tokens

GH_TOKEN

GITLAB_TOKEN

DOCKER_TOKEN

APKMIRROR_TOKEN

☁️ AWS/S3 Configuration

Used when loading configuration from S3 buckets or CloudFlare R2.

AWS_ACCESS_KEY_ID

AWS_SECRET_ACCESS_KEY

AWS_REGION

S3_ENDPOINT_URL

🗄️ Redis Configuration

Used for persistent state storage to track last seen releases.

REDIS_HOST

REDIS_PORT

REDIS_DB

REDIS_PASSWORD

🔔 Notification Configuration

APPRISE_URL

🎛️ Runtime Control

FORCE_NOTIFY

💡 Usage Examples

Development Environment

# Basic setup for development
export CONFIG_SOURCE="config.yaml"
export GH_TOKEN="ghp_your_development_token"
export APPRISE_URL="discord://your_webhook"

# Local Redis
export REDIS_HOST="localhost"
export REDIS_PORT="6379"
export REDIS_DB="0"

Production Environment

# Production setup with S3 config
export CONFIG_SOURCE="s3://prod-configs/release-tracker/config.yaml"
export AWS_ACCESS_KEY_ID="AKIA..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_REGION="us-east-1"

# Authentication tokens
export GH_TOKEN="ghp_production_token"
export GITLAB_TOKEN="glpat_production_token"
export DOCKER_TOKEN="dckr_pat_production_token"

# Production Redis (managed service)
export REDIS_HOST="prod-redis.cache.amazonaws.com"
export REDIS_PORT="6379"
export REDIS_PASSWORD="your_redis_password"
export REDIS_DB="0"

# Production notifications
export APPRISE_URL="tgram://bot_token/chat_id,slack://webhook_token"

Docker Environment

# Docker Compose with environment variables
version: '3.8'
services:
  release-tracker:
    image: release-tracker
    environment:
      - CONFIG_SOURCE=config.yaml
      - GH_TOKEN=${GH_TOKEN}
      - GITLAB_TOKEN=${GITLAB_TOKEN}
      - APPRISE_URL=${APPRISE_URL}
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - REDIS_DB=0
    depends_on:
      - redis
      
  redis:
    image: redis:7-alpine

Testing Environment

# Testing with force notifications
export CONFIG_SOURCE="test-config.yaml"
export FORCE_NOTIFY="1"
export APPRISE_URL="mailto://[email protected]"

# Test Redis
export REDIS_HOST="localhost"
export REDIS_DB="15"  # Use separate test database

🛡️ Best Practices

Security

Configuration Management

Redis Security

Example .env File

# .env file for local development (DO NOT COMMIT)
CONFIG_SOURCE=config.yaml
GH_TOKEN=ghp_your_github_token_here
GITLAB_TOKEN=glpat_your_gitlab_token_here
APPRISE_URL=discord://your_webhook_id/your_webhook_token
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0

Loading .env File

# Load .env file in bash
set -a && source .env && set +a

# Then run the application
python main.py

Note: Environment variables in YAML configuration files use the ${VARIABLE_NAME} syntax and support default values with ${VARIABLE_NAME:-default_value}.