Spaces:
Sleeping
Sleeping
Setup Scripts
Utilities for initial setup and configuration validation.
Environment Configuration
check_env_config.py β
Validate your entire environment configuration before running the app.
# Check configuration and show warnings
python scripts/setup/check_env_config.py
# Strict mode - exit with error if any issues found
python scripts/setup/check_env_config.py --strict
What it checks:
- β Required variables (JWT_SECRET, CORS_ORIGINS, Google OAuth)
- β οΈ Recommended variables (Gemini API, Razorpay, etc.)
- βοΈ Configuration values (token expiry, rate limits)
- π Security issues (production CORS, HTTPS)
Run this before:
- First time setup
- Deploying to production
- After changing .env file
Secret Generation
generate_jwt_secret.py
Generate cryptographically secure JWT secret keys.
# Basic usage
python scripts/setup/generate_jwt_secret.py
# Custom length
python scripts/setup/generate_jwt_secret.py --length 128
# Different output formats
python scripts/setup/generate_jwt_secret.py --format docker
python scripts/setup/generate_jwt_secret.py --format export
python scripts/setup/generate_jwt_secret.py --format raw
Add the generated secret to your .env file as JWT_SECRET.
OAuth Setup
get_google_token.py
Generate Google OAuth refresh tokens for Gmail and Drive services.
python scripts/setup/get_google_token.py
Prerequisites:
- Download OAuth 2.0 credentials from Google Cloud Console
- Save as
client_secret.jsonin project root - Run the script and follow browser authentication flow
Outputs:
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGOOGLE_REFRESH_TOKEN
Add these to your .env file.