E-Raksha uses environment variables to keep sensitive information secure. Never commit API keys or secrets to the repository.
-
Copy the example environment file:
cp .env.example .env
-
Edit
.envwith your actual credentials:# Supabase Configuration (Optional - for database features) SUPABASE_URL=https://your-project.supabase.co SUPABASE_ANON_KEY=your_anon_key_here # API Configuration API_HOST=0.0.0.0 API_PORT=8000 FRONTEND_PORT=3001
- Supabase credentials - Database access keys
- API keys - External service authentication
- Secret keys - Application security tokens
- Database URLs - Connection strings
- Kaggle credentials - Model training access
The Docker setup automatically loads environment variables from .env file:
# Create your .env file first
cp .env.example .env
# Edit .env with your credentials
# Then deploy
docker-compose up --buildFor production deployments, set environment variables in your hosting platform:
# Set via Railway dashboard or CLI
railway variables set SUPABASE_URL=your_url
railway variables set SUPABASE_ANON_KEY=your_key# Set in Render dashboard under Environment Variables
SUPABASE_URL=your_url
SUPABASE_ANON_KEY=your_key# Set via environment variables in container
docker run -e SUPABASE_URL=your_url -e SUPABASE_ANON_KEY=your_key eraksha:latestDatabase features are optional. If you don't set Supabase credentials:
- Core deepfake detection still works
- Web interface functions normally
- No inference logging to database
- No user feedback storage
- No usage statistics
- Never commit
.envfiles - They're in.gitignore - Use different keys for development/production
- Rotate keys regularly
- Use least-privilege access - Only grant necessary permissions
- Monitor access logs - Check for unauthorized usage
"Supabase credentials not found"
- This is normal if you haven't set up database features
- Core functionality works without database
- Set
SUPABASE_URLandSUPABASE_ANON_KEYto enable database features
"Environment variables not loading"
- Ensure
.envfile exists in project root - Check file permissions (should be readable)
- Verify no extra spaces in variable assignments
- Go to supabase.com
- Create a free account and project
- Go to Settings > API
- Copy your Project URL and anon/public key
- Add to your
.envfile
Note: Database features are optional. E-Raksha works perfectly without them!