video-accessibility/.env.prod.example
Vadym Samoilenko ea21cace96 feat: replace SDK with direct HTTP integration to centralized cost tracker
- New services/cost_tracker.py: sync httpx preflight()/record() + async wrappers;
  BudgetExceeded exception; no-op when COST_TRACKER_BASE_URL is empty
- Preflight budget check added before ingestion (Gemini), per-language translation
  (video-native + traditional), and per-language TTS dispatch
- _record_gemini_usage and _record_tts_cost now call cost_tracker directly;
  removes broken asyncio.get_event_loop() hack from sync Celery worker
- Fix: _cost_ctx now threaded into extract_accessibility_targeted (video-native path)
- Fix: user_id/cost_project_id now propagated through dispatch_language_tts →
  synthesize_cue_task.s() and the rerender_accessible_video.py re-render path
- Remove oliver-cost-tracker SDK dependency (was commented-out/never installed)
- Drop cost_tracker_outbox_path setting and get_cost_tracker() factory
- Update COST_TRACKER_BASE_URL default to optical-dev.oliver.solutions in
  .env.prod.example, docker-compose.yml, and all Cloud Run service yamls
- Cloud Run yamls use Secret Manager ref (cost-tracker-api-key) for the API key

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 13:36:15 +01:00

40 lines
No EOL
1.3 KiB
Text

# Production Environment Variables
# Copy this file to .env.prod and update with your production values
# Database Configuration
MONGODB_ROOT_USER=admin
MONGODB_ROOT_PASSWORD=your-secure-mongodb-password
MONGODB_URL=mongodb://admin:your-secure-mongodb-password@mongodb:27017/accessible_video?authSource=admin&replicaSet=rs0
REDIS_URL=redis://redis:6379/0
# JWT Authentication
JWT_SECRET_KEY=your-production-jwt-secret-key-min-32-chars
JWT_REFRESH_SECRET_KEY=your-production-refresh-secret-key-min-32-chars
# AI Services
GEMINI_API_KEY=your-gemini-api-key
ELEVENLABS_API_KEY=your-elevenlabs-api-key
# Google Cloud Configuration
GCS_BUCKET_NAME=your-production-bucket-name
GOOGLE_CLOUD_PROJECT=your-gcp-project-id
# Email Service
SENDGRID_API_KEY=your-sendgrid-api-key
# Monitoring
SENTRY_DSN=your-sentry-dsn-url
# CORS Configuration for Apache-hosted frontend
CORS_ORIGINS=https://your-domain.com,https://www.your-domain.com
# Frontend Build Configuration (for reference)
VITE_API_URL=https://your-api-domain.com:8000
VITE_SENTRY_DSN=your-frontend-sentry-dsn
VITE_ENVIRONMENT=production
# AI Cost Tracker (direct HTTP — see backend/app/services/cost_tracker.py)
COST_TRACKER_BASE_URL=https://optical-dev.oliver.solutions/cost-tracker/v1
COST_TRACKER_API_KEY=ct_live_your-api-key-here
COST_TRACKER_SOURCE_APP=video-accessibility
COST_TRACKER_ENABLED=true