DocuGardenerDocs

Environment Variables

Complete reference of every configuration option available in DocuGardener.

Tip: Copy .env.example to .env and fill in the values. Variables marked “Yes (prod)” are only required in production deployments — development mode uses safe fallback defaults.

Application

VariableRequiredDefaultDescription
ENVIRONMENTNodevelopmentSet to "production" for production deployments. Affects logging level and error detail.
DEBUGNofalseEnable debug-level logging across all services.
SECRET_KEYYes (prod)dev-fallbackEncryption key for stored secrets (e.g. GitHub tokens). Minimum 32 characters in production.
SINGLE_TENANT_IDYes (self-hosted)Tenant UUID for single-tenant mode. All data is scoped to this tenant.
DEPLOYMENT_MODENoclient-installed"saas" or "client-installed". Controls billing UI visibility and feature gating source.
QUOTA_OVERRIDENoSet to "unlimited" to disable all plan-based quotas. Recommended for self-hosted installs.

GitHub App

VariableRequiredDefaultDescription
GITHUB_APP_IDYesNumeric App ID from your GitHub App's developer settings page.
GITHUB_WEBHOOK_SECRETYesWebhook secret configured in your GitHub App. Used to verify webhook payloads.
GITHUB_PRIVATE_KEY_PATHYes./secrets/github-app.pemPath to the .pem private key file generated when creating the GitHub App.
GITHUB_IDYesGitHub OAuth App client ID, used by NextAuth for user authentication.
GITHUB_SECRETYesGitHub OAuth App client secret, used by NextAuth for user authentication.

LLM Providers

Set LLM_PROVIDER to choose your default provider. Each tenant can override this via the BYOK settings in the dashboard.

VariableRequiredDefaultDescription
LLM_PROVIDERYesgeminiDefault LLM provider: "gemini", "openai", "anthropic", or "ollama".
GEMINI_API_KEYIf geminiGoogle AI Studio API key for the Gemini provider.
GEMINI_MODELNogemini-2.0-flashGemini model name to use for analysis.
OPENAI_API_KEYIf openaiOpenAI API key.
OPENAI_MODELNogpt-4oOpenAI model name to use for analysis.
ANTHROPIC_API_KEYIf anthropicAnthropic API key.
ANTHROPIC_MODELNoclaude-sonnet-4-6Claude model name to use for analysis.
OLLAMA_BASE_URLIf ollamahttp://localhost:11434Ollama API endpoint. Use http://host.docker.internal:11434 when running the worker in Docker.
OLLAMA_MODELNollama3.2Ollama model to use for analysis.
Docker + Ollama: If the analysis worker runs inside Docker but Ollama runs on the host, use http://host.docker.internal:11434 as the Ollama base URL. The worker cannot reach localhost from inside a container.

Database

VariableRequiredDefaultDescription
DATABASE_URLYesPostgreSQL connection string for the analysis plane (FastAPI). Example: postgresql://user:pass@localhost:5433/docugardener
POSTGRES_PASSWORDYesPassword for the PostgreSQL superuser. Shared between the postgres container and PgBouncer. Must match the password in SQL_DATABASE_URL. New in SCAL-01 — add this to your .env if upgrading from an earlier release.
SQL_DATABASE_URLYesPostgreSQL connection string used by the Python backend. Must route through PgBouncer (pgbouncer:5432) in Docker Compose, not directly to postgres:5432. PgBouncer runs as a sidecar in the same Docker network and enforces transaction-mode connection pooling.
REDIS_URLNoredis://localhost:6379Redis connection string used by RQ for job queuing.
WEAVIATE_URLNohttp://weaviate:8080Weaviate vector database endpoint for document embeddings.

Web / NextAuth

VariableRequiredDefaultDescription
NEXTAUTH_URLYesFull URL of the web application (e.g. https://your-domain.com). Used for OAuth callback URLs.
NEXTAUTH_SECRETYesRandom string (32+ characters) used for JWT signing. Generate with: openssl rand -base64 32
NEXT_PUBLIC_APP_URLNoNEXTAUTH_URLPublic-facing app URL used for OAuth callbacks. Defaults to NEXTAUTH_URL if not set.
NEXT_PUBLIC_DEPLOYMENT_MODENoclient-installed"saas" or "client-installed". Baked into the frontend at build time — controls client-side UI branching.

Analysis

VariableRequiredDefaultDescription
DRIFT_SCORE_THRESHOLDNo30Drift score (0-100) above which a finding is flagged. Lower values mean stricter enforcement.
MAX_PROCESSING_TIMENo120Maximum seconds a worker job can run before being considered timed out.
MAX_CHANGED_FILESNo50Maximum number of changed files per PR to analyse. PRs exceeding this are partially analysed.

Stripe (SaaS Only)

These variables are only needed if you are running DocuGardener in SaaS mode (DEPLOYMENT_MODE=saas). Self-hosted installations can ignore this section entirely.
VariableRequiredDefaultDescription
STRIPE_SECRET_KEYSaaS onlyStripe secret key for server-side billing operations.
STRIPE_PUBLISHABLE_KEYSaaS onlyStripe publishable key for client-side Checkout embeds.
STRIPE_WEBHOOK_SECRETSaaS onlyStripe webhook signing secret for verifying webhook payloads.
STRIPE_PRICE_PROSaaS onlyStripe Price ID for the PRO monthly plan.
STRIPE_PRICE_TEAMSaaS onlyStripe Price ID for the TEAM monthly plan.