Arag / .env.example
AuthorBot
Add GOOGLE_BOOKS_API_KEY for authenticated Books API lookups.
02b30d1
Raw
History Blame Contribute Delete
4.41 kB
# ============================================================
# Author RAG Chatbot SaaS β€” .env.example
# Copy to .env and fill all values before running.
# DO NOT commit .env to source control.
# ============================================================
# ── Application ───────────────────────────────────────────────
APP_NAME="AuthorBot RAG"
APP_ENV=development # development | staging | production
DEBUG=false
LOG_LEVEL=info
SAAS_CDN_URL=https://cdn.authorbot.io
TRUSTED_PROXY_COUNT=1 # R-164: X-Forwarded-For trusted hop count
# ── Security ──────────────────────────────────────────────────
# Generate: python -c "import secrets; print(secrets.token_hex(32))"
SECRET_KEY=REPLACE_WITH_64_CHAR_HEX_STRING
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=480
REFRESH_TOKEN_EXPIRE_DAYS=7
# HMAC secret for subscription tokens (min 32 chars)
SUBSCRIPTION_SECRET=REPLACE_WITH_32_CHAR_SECRET
SUPERADMIN_TOTP_SECRET=REPLACE_WITH_BASE32_SECRET
# ── Database ──────────────────────────────────────────────────
# Async PostgreSQL URL
DATABASE_URL=postgresql+asyncpg://authorbot:authorbot@localhost:5432/authorbot
# ── Redis ─────────────────────────────────────────────────────
REDIS_URL=redis://localhost:6379/0
# ── ChromaDB ─────────────────────────────────────────────────
CHROMA_HOST=localhost
CHROMA_PORT=8000
# ── OpenAI ───────────────────────────────────────────────────
OPENAI_API_KEY=sk-REPLACE_WITH_YOUR_KEY
OPENAI_MODEL=gpt-4o
OPENAI_EMBEDDING_MODEL=text-embedding-3-small
OPENAI_MAX_TOKENS=1024
OPENAI_TEMPERATURE=0.3
# ── Google Books API (platform presence + metadata) ───────────
# Create at console.cloud.google.com β†’ Books API β†’ Credentials
GOOGLE_BOOKS_API_KEY=
# ── Email (Gmail SMTP) ────────────────────────────────────────
# >>> ENTER CREDENTIALS IN: email_credentials.env (not here) <<<
# Copy email_credentials.env.example β†’ email_credentials.env if needed.
# ── Plans & Limits ────────────────────────────────────────────
# Token budgets per plan (in tokens)
PLAN_MONTHLY_TOKENS=1000000
PLAN_QUARTERLY_TOKENS=3200000
PLAN_SEMI_ANNUAL_TOKENS=7000000
PLAN_ANNUAL_TOKENS=15000000
# File upload
MAX_UPLOAD_MB=50
# Rate limiting
RATE_LIMIT_REQUESTS=60 # requests per minute per IP
RATE_LIMIT_WINDOW_SECONDS=60
# ── Analytics ─────────────────────────────────────────────────
# MaxMind GeoLite2 β€” get free license at maxmind.com
MAXMIND_LICENSE_KEY=REPLACE_WITH_LICENSE_KEY
GEO_DB_PATH=/app/data/geo/GeoLite2-City.mmdb
# ── Storage ───────────────────────────────────────────────────
UPLOAD_DIR=/app/uploads
CHROMA_PERSIST_DIR=/app/data/chroma
# ── CORS ─────────────────────────────────────────────────────
# Comma-separated list of allowed origins (no wildcard in production)
ALLOWED_ORIGINS=http://localhost:3000,https://yourdashboard.vercel.app
# ── Observability (R-159) ────────────────────────────────────
SENTRY_DSN=
STRIPE_WEBHOOK_SECRET=
# ── Celery ───────────────────────────────────────────────────
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/1