Fix TTS server status errors and startup warnings

- Fixed 'app is not defined' errors by using current_app
- Improved TTS health check to handle missing /health endpoint
- Fixed database trigger creation to be idempotent
- Added .env.example with all configuration options
- Updated README with security configuration instructions
This commit is contained in:
2025-06-03 20:08:19 -06:00
parent c97d025acb
commit e5a274d191
5 changed files with 120 additions and 25 deletions

View File

@@ -1,22 +1,73 @@
# Example environment configuration for Talk2Me
# Copy this file to .env and update with your actual values
# Talk2Me Environment Configuration
# Copy this file to .env and fill in your values
# Flask Configuration
SECRET_KEY=your-secret-key-here-change-this
FLASK_ENV=development
FLASK_SECRET_KEY=your-secret-key-here-change-in-production
FLASK_DEBUG=False
# Upload Configuration
UPLOAD_FOLDER=/path/to/secure/upload/folder
# Server Configuration
HOST=0.0.0.0
PORT=5005
# TTS Server Configuration
TTS_SERVER_URL=http://localhost:5050/v1/audio/speech
# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/talk2me
REDIS_URL=redis://localhost:6379/0
# Ollama Configuration
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=gemma2:9b
OLLAMA_LARGE_MODEL=gemma3:27b
# TTS Configuration
TTS_SERVER_URL=http://localhost:8000
TTS_API_KEY=your-tts-api-key-here
# CORS Configuration (for production)
CORS_ORIGINS=https://yourdomain.com,https://app.yourdomain.com
ADMIN_CORS_ORIGINS=https://admin.yourdomain.com
# Security Configuration
JWT_SECRET_KEY=your-jwt-secret-key-here
JWT_ACCESS_TOKEN_EXPIRES=3600
JWT_REFRESH_TOKEN_EXPIRES=2592000
# Admin Token (for admin endpoints)
ADMIN_TOKEN=your-secure-admin-token-here
# Admin Configuration
ADMIN_USERNAME=admin
ADMIN_PASSWORD=change-this-password
ADMIN_EMAIL=admin@example.com
# Optional: GPU Configuration
# CUDA_VISIBLE_DEVICES=0
# Rate Limiting
RATE_LIMIT_PER_MINUTE=60
RATE_LIMIT_PER_HOUR=1000
# Session Configuration
SESSION_LIFETIME=86400
SESSION_CLEANUP_INTERVAL=3600
# Logging
LOG_LEVEL=INFO
LOG_FORMAT=json
# CORS Configuration
CORS_ORIGINS=http://localhost:3000,http://localhost:5005
# Feature Flags
ENABLE_ANALYTICS=true
ENABLE_RATE_LIMITING=true
ENABLE_SESSION_MANAGEMENT=true
ENABLE_ERROR_TRACKING=true
# Performance Settings
MAX_CONTENT_LENGTH=16777216
REQUEST_TIMEOUT=300
WHISPER_MODEL=base
WHISPER_DEVICE=auto
# Email Configuration (Optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@example.com
SMTP_PASSWORD=your-email-password
SMTP_FROM=noreply@example.com
# External Services (Optional)
SENTRY_DSN=
DATADOG_API_KEY=
NEWRELIC_LICENSE_KEY=