Skip to content

Environment Variables Reference

Complete reference for all S5 Slidefactory configuration options.


Overview

S5 Slidefactory uses environment variables for all configuration. Variables can be provided via:

  • .env file (local development)
  • .env.local file (Docker Compose)
  • Environment variables (production)
  • GitHub Secrets (CI/CD)

Core Application Settings

VERSION

  • Type: String
  • Default: 1.0.0
  • Description: Application version
  • Example: VERSION=1.2.3

DEBUG_MODE

  • Type: Boolean
  • Default: false
  • Description: Enable debug logging and detailed error messages
  • Example: DEBUG_MODE=true
  • ⚠️ Warning: Never enable in production

ENFORCE_HTTPS

  • Type: Boolean
  • Default: true
  • Description: Force HTTPS redirects
  • Example: ENFORCE_HTTPS=true
  • Required for: Production deployments

PORT

  • Type: Integer
  • Default: 8080
  • Description: Application port (local development only)
  • Example: PORT=8000

Database Configuration

DATABASE_URL

  • Type: String
  • Required: Yes
  • Description: PostgreSQL connection string
  • Format: postgresql+psycopg2://user:pass@host:port/database
  • Example:
    # Docker
    DATABASE_URL=postgresql+psycopg2://postgres:postgres@postgres:5432/slidefactory
    
    # Local
    DATABASE_URL=postgresql+psycopg2://postgres:postgres@localhost:5432/slidefactory
    
  • ⚠️ Important: Use postgresql://, not postgres://

DB_POOL_SIZE

  • Type: Integer
  • Default: 10
  • Description: Database connection pool size
  • Example: DB_POOL_SIZE=20

DB_MAX_OVERFLOW

  • Type: Integer
  • Default: 20
  • Description: Max overflow connections beyond pool size
  • Example: DB_MAX_OVERFLOW=30

DB_POOL_RECYCLE

  • Type: Integer
  • Default: 3600
  • Description: Recycle connections after N seconds
  • Example: DB_POOL_RECYCLE=7200

AI Provider Configuration

AI_PROVIDER

  • Type: String
  • Default: openai
  • Options: openai, azure_openai, anthropic, mistral, ollama, openrouter
  • Description: Default AI provider
  • Example: AI_PROVIDER=openai

AI_MODEL

  • Type: String
  • Default: gpt-4
  • Description: Default AI model
  • Example: AI_MODEL=gpt-4-turbo

OpenAI

OPENAI_API_KEY

  • Type: String
  • Required: If using OpenAI provider
  • Description: OpenAI API key
  • Example: OPENAI_API_KEY=sk-...
  • 🔒 Security: Keep secret

OPENAI_ORGANIZATION

  • Type: String
  • Required: No
  • Description: OpenAI organization ID
  • Example: OPENAI_ORGANIZATION=org-...

Azure OpenAI

AZURE_OPENAI_API_KEY

  • Type: String
  • Required: If using Azure OpenAI provider
  • Description: Azure OpenAI API key
  • Example: AZURE_OPENAI_API_KEY=...
  • 🔒 Security: Keep secret

AZURE_OPENAI_ENDPOINT

  • Type: String
  • Required: If using Azure OpenAI provider
  • Description: Azure OpenAI endpoint URL
  • Example: AZURE_OPENAI_ENDPOINT=https://your-instance.openai.azure.com

AZURE_OPENAI_API_VERSION

  • Type: String
  • Default: 2024-02-15-preview
  • Description: Azure OpenAI API version
  • Example: AZURE_OPENAI_API_VERSION=2024-02-15-preview

AZURE_OPENAI_DEPLOYMENT_NAME

  • Type: String
  • Required: If using Azure OpenAI provider
  • Description: Azure OpenAI deployment name
  • Example: AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4

Anthropic

ANTHROPIC_API_KEY

  • Type: String
  • Required: If using Anthropic provider
  • Description: Anthropic API key
  • Example: ANTHROPIC_API_KEY=sk-ant-...
  • 🔒 Security: Keep secret

Mistral

MISTRAL_API_KEY

  • Type: String
  • Required: If using Mistral provider
  • Description: Mistral AI API key
  • Example: MISTRAL_API_KEY=...
  • 🔒 Security: Keep secret

Ollama

OLLAMA_BASE_URL

  • Type: String
  • Default: http://localhost:11434
  • Description: Ollama server URL
  • Example: OLLAMA_BASE_URL=http://ollama:11434

OpenRouter

OPENROUTER_API_KEY

  • Type: String
  • Required: If using OpenRouter provider
  • Description: OpenRouter API key
  • Example: OPENROUTER_API_KEY=sk-or-...
  • 🔒 Security: Keep secret

Storage Configuration

STORAGE_PROVIDER

  • Type: String
  • Default: minio
  • Options: minio, azure
  • Description: Storage backend provider
  • Example: STORAGE_PROVIDER=minio

MinIO (S3-Compatible)

MINIO_CLIENT_URL

  • Type: String
  • Required: If using MinIO
  • Description: MinIO server URL
  • Example:
    # Docker
    MINIO_CLIENT_URL=minio:9000
    
    # Local
    MINIO_CLIENT_URL=localhost:9000
    

MINIO_ACCESS_KEY

  • Type: String
  • Default: minioadmin
  • Description: MinIO access key
  • Example: MINIO_ACCESS_KEY=admin

MINIO_SECRET_KEY

  • Type: String
  • Default: minioadmin
  • Description: MinIO secret key
  • Example: MINIO_SECRET_KEY=password123
  • 🔒 Security: Change default in production

MINIO_BUCKET_NAME

  • Type: String
  • Default: slidefactory
  • Description: Default bucket name
  • Example: MINIO_BUCKET_NAME=presentations

MINIO_PUBLIC_BUCKET_NAME

  • Type: String
  • Default: slidefactory-public
  • Description: Public bucket name
  • Example: MINIO_PUBLIC_BUCKET_NAME=public

Azure Blob Storage

AZURE_STORAGE_ACCOUNT_NAME

  • Type: String
  • Required: If using Azure storage
  • Description: Azure storage account name
  • Example: AZURE_STORAGE_ACCOUNT_NAME=mystorageaccount

AZURE_STORAGE_ACCOUNT_KEY

  • Type: String
  • Required: If using Azure storage
  • Description: Azure storage account key
  • Example: AZURE_STORAGE_ACCOUNT_KEY=...
  • 🔒 Security: Keep secret

AZURE_STORAGE_CONTAINER_NAME

  • Type: String
  • Default: slidefactory
  • Description: Azure container name
  • Example: AZURE_STORAGE_CONTAINER_NAME=presentations

Worker Configuration

CELERY_BROKER_URL

  • Type: String
  • Required: Yes
  • Description: Redis URL for Celery broker
  • Example:
    # Docker
    CELERY_BROKER_URL=redis://redis:6379/0
    
    # Local
    CELERY_BROKER_URL=redis://localhost:6379/0
    

CELERY_RESULT_BACKEND

  • Type: String
  • Required: Yes
  • Description: Redis URL for Celery results
  • Example: CELERY_RESULT_BACKEND=redis://redis:6379/0

CELERY_TASK_ALWAYS_EAGER

  • Type: Boolean
  • Default: false
  • Description: Execute tasks synchronously (for testing)
  • Example: CELERY_TASK_ALWAYS_EAGER=true

CELERY_TASK_TIME_LIMIT

  • Type: Integer
  • Default: 3600
  • Description: Task timeout in seconds
  • Example: CELERY_TASK_TIME_LIMIT=7200

N8N Integration

N8N_API_URL

  • Type: String
  • Required: If using N8N workflows
  • Description: N8N API endpoint
  • Example:
    # Docker
    N8N_API_URL=http://n8n:5678/api/v1
    
    # External
    N8N_API_URL=https://n8n.yourcompany.com/api/v1
    

N8N_API_KEY

  • Type: String
  • Required: If using N8N workflows
  • Description: N8N API key (create in N8N UI → Settings → API)
  • Example: N8N_API_KEY=your-n8n-api-key
  • 🔒 Security: Keep secret

N8N_WORKFLOW_TIMEOUT

  • Type: Integer
  • Default: 300
  • Description: N8N workflow timeout in seconds
  • Example: N8N_WORKFLOW_TIMEOUT=600

Document Processing (RAG)

JINA_API_KEY

  • Type: String
  • Required: If using RAG/context features
  • Description: Jina AI API key
  • Example: JINA_API_KEY=jina_...
  • 🔒 Security: Keep secret

JINA_MAX_CHUNK_LENGTH

  • Type: Integer
  • Default: 1000
  • Description: Maximum chunk length in characters
  • Example: JINA_MAX_CHUNK_LENGTH=1500

JINA_CHUNK_OVERLAP

  • Type: Integer
  • Default: 100
  • Description: Chunk overlap in characters
  • Example: JINA_CHUNK_OVERLAP=150

JINA_EMBEDDING_MODEL

  • Type: String
  • Default: jina-embeddings-v3
  • Description: Jina embedding model
  • Example: JINA_EMBEDDING_MODEL=jina-embeddings-v3

JINA_EMBEDDING_DIMENSIONS

  • Type: Integer
  • Default: 1024
  • Description: Embedding vector dimensions
  • Example: JINA_EMBEDDING_DIMENSIONS=1024

Whitelabel Configuration

CLIENT_NAME

  • Type: String
  • Default: Slidefactory
  • Description: Company/product name
  • Example: CLIENT_NAME=Acme Corp
  • Type: String
  • Default: /static/img/logo.png
  • Description: Path to small logo (navbar)
  • Example: CLIENT_LOGO=/static/img/branding/logo.png

CLIENT_LOGO_LARGE

  • Type: String
  • Default: /static/img/logo_large.png
  • Description: Path to large logo (login page)
  • Example: CLIENT_LOGO_LARGE=/static/img/branding/logo_large.png

CLIENT_FAVICON

  • Type: String
  • Default: /static/img/favicon.ico
  • Description: Path to favicon
  • Example: CLIENT_FAVICON=/static/img/branding/favicon.ico

CLIENT_PRIMARY_COLOR

  • Type: String (hex color)
  • Default: #ee0000
  • Description: Primary brand color
  • Example: CLIENT_PRIMARY_COLOR=#0066cc

CLIENT_SECONDARY_COLOR

  • Type: String (hex color)
  • Default: #333333
  • Description: Secondary brand color
  • Example: CLIENT_SECONDARY_COLOR=#666666

CLIENT_ACCENT_COLOR

  • Type: String (hex color)
  • Default: #ff6600
  • Description: Accent brand color
  • Example: CLIENT_ACCENT_COLOR=#ff9900

CLIENT_SUPPORT_EMAIL

  • Type: String
  • Default: support@slidefactory.io
  • Description: Support email address
  • Example: CLIENT_SUPPORT_EMAIL=help@yourcompany.com

CLIENT_SUPPORT_URL

  • Type: String
  • Default: None
  • Description: Support/help URL
  • Example: CLIENT_SUPPORT_URL=https://help.yourcompany.com

Authentication

SECRET_KEY

  • Type: String
  • Required: Yes
  • Description: Application secret key for encryption
  • Example: SECRET_KEY=$(openssl rand -hex 32)
  • 🔒 Security: Generate unique secret, keep secure

SESSION_SECRET_KEY

  • Type: String
  • Required: Yes
  • Description: Session signing key
  • Example: SESSION_SECRET_KEY=$(openssl rand -hex 32)
  • 🔒 Security: Generate unique secret, keep secure

SESSION_LIFETIME

  • Type: Integer
  • Default: 3600
  • Description: Session lifetime in seconds
  • Example: SESSION_LIFETIME=7200

ALLOWED_USERS

  • Type: JSON String
  • Required: For local authentication
  • Description: User credentials dictionary
  • Example:
    ALLOWED_USERS='{
      "admin@example.com": {
        "password": "SecurePassword123!",
        "scopes": ["admin", "user"]
      }
    }'
    
  • 🔒 Security: Use strong passwords

Azure AD (Optional)

AZURE_AD_ENABLED

  • Type: Boolean
  • Default: false
  • Description: Enable Azure AD authentication
  • Example: AZURE_AD_ENABLED=true

AZURE_AD_CLIENT_ID

  • Type: String
  • Required: If Azure AD enabled
  • Description: Azure AD application client ID
  • Example: AZURE_AD_CLIENT_ID=...

AZURE_AD_CLIENT_SECRET

  • Type: String
  • Required: If Azure AD enabled
  • Description: Azure AD application client secret
  • Example: AZURE_AD_CLIENT_SECRET=...
  • 🔒 Security: Keep secret

AZURE_AD_TENANT_ID

  • Type: String
  • Required: If Azure AD enabled
  • Description: Azure AD tenant ID
  • Example: AZURE_AD_TENANT_ID=...

AZURE_AD_REDIRECT_URI

  • Type: String
  • Required: If Azure AD enabled
  • Description: OAuth callback URL
  • Example: AZURE_AD_REDIRECT_URI=https://yourapp.com/auth/azure/callback

Security

CORS_ORIGINS

  • Type: JSON Array
  • Default: ["*"]
  • Description: Allowed CORS origins
  • Example: CORS_ORIGINS=["http://localhost:3000", "https://yourapp.com"]

CORS_ALLOW_CREDENTIALS

  • Type: Boolean
  • Default: true
  • Description: Allow credentials in CORS requests
  • Example: CORS_ALLOW_CREDENTIALS=true

Logging

LOG_LEVEL

  • Type: String
  • Default: INFO
  • Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
  • Description: Logging level
  • Example: LOG_LEVEL=DEBUG

LOG_FORMAT

  • Type: String
  • Default: json
  • Options: json, text
  • Description: Log output format
  • Example: LOG_FORMAT=text

LOG_FILE

  • Type: String
  • Default: None
  • Description: Log file path (if logging to file)
  • Example: LOG_FILE=/var/log/slidefactory/app.log

Example Configuration Files

.env (Local Development)

# Database
DATABASE_URL=postgresql+psycopg2://postgres:postgres@localhost:5432/slidefactory

# AI Provider
AI_PROVIDER=openai
AI_MODEL=gpt-4
OPENAI_API_KEY=sk-your-key-here

# Storage
STORAGE_PROVIDER=minio
MINIO_CLIENT_URL=localhost:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin

# Workers
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0

# Security
SECRET_KEY=$(openssl rand -hex 32)
SESSION_SECRET_KEY=$(openssl rand -hex 32)

# Development
DEBUG_MODE=true
PORT=8080

.env.local (Docker Compose)

# Database (use service name)
DATABASE_URL=postgresql+psycopg2://postgres:postgres@postgres:5432/slidefactory

# AI Provider
AI_PROVIDER=openai
OPENAI_API_KEY=sk-your-key-here

# Storage (use service name)
STORAGE_PROVIDER=minio
MINIO_CLIENT_URL=minio:9000

# Workers (use service name)
CELERY_BROKER_URL=redis://redis:6379/0
CELERY_RESULT_BACKEND=redis://redis:6379/0

# N8N (use service name)
N8N_API_URL=http://n8n:5678/api/v1
N8N_API_KEY=your-n8n-key

# Security
SECRET_KEY=$(openssl rand -hex 32)
SESSION_SECRET_KEY=$(openssl rand -hex 32)

# Development
DEBUG_MODE=true

Security Best Practices

  1. Never commit secrets to git
  2. Use .env files (already in .gitignore)
  3. Use GitHub Secrets for CI/CD
  4. Use Azure Key Vault for production

  5. Generate unique secrets

    openssl rand -hex 32
    

  6. Rotate keys regularly

  7. SECRET_KEY
  8. SESSION_SECRET_KEY
  9. API keys

  10. Use strong passwords

  11. Minimum 12 characters
  12. Mix of upper/lowercase, numbers, symbols

  13. Restrict CORS in production

    CORS_ORIGINS=["https://yourapp.com"]
    


Next Steps


Environment Variable Priority

Variables are loaded in this order (later overrides earlier): 1. Default values in code 2. .env file 3. Environment variables 4. Command-line arguments