Environment Variables
Complete reference of all environment variables for configuring Expunct.
Required
| Variable | Description | Example |
|---|---|---|
DATABASE_URL | Database connection string | postgresql+asyncpg://user:pass@host:5432/db |
API_KEY_SECRET | Secret for hashing API keys (32+ characters) | Random string via openssl rand -hex 32 |
Optional — General
| Variable | Description | Default |
|---|---|---|
HOST | Bind address | 0.0.0.0 |
PORT | Bind port | 8000 |
LOG_LEVEL | Logging level (debug, info, warning, error) | info |
LOG_FORMAT | Log format (json or text) | json |
CORS_ORIGINS | Allowed CORS origins (comma-separated or *) | * |
MAX_UPLOAD_SIZE_MB | Maximum file upload size in megabytes | 100 |
JOB_RETENTION_DAYS | Number of days to keep completed jobs before cleanup | 7 |
Optional — Security
| Variable | Description | Default |
|---|---|---|
ENCRYPTION_KEY | Fernet key for credential encryption | Auto-generated |
RATE_LIMIT_PER_MINUTE | Rate limit per API key per minute | 100 |
DB_API_KEY_AUTH | Enable database-backed API key authentication | true |
Optional — Processing
| Variable | Description | Default |
|---|---|---|
OCR_LANG | Default OCR language code | en |
CONFIDENCE_THRESHOLD | Default detection confidence threshold (0.0-1.0) | 0.5 |
LLM_DETECTION_ENABLED | Enable LLM-based named entity recognition | false |
LLM_ENDPOINT | LLM API endpoint for NER detection | — |
LLM_MODEL | LLM model name for NER detection | — |
Optional — Integrations
| Variable | Description | Default |
|---|---|---|
STRIPE_SECRET_KEY | Stripe API key for billing integration | — |
STRIPE_WEBHOOK_SECRET | Stripe webhook signing secret | — |
STRIPE_SUCCESS_URL | Checkout success redirect URL | — |
STRIPE_CANCEL_URL | Checkout cancel redirect URL | — |
OTEL_EXPORTER_OTLP_ENDPOINT | OpenTelemetry collector endpoint for tracing | — |
OTEL_SERVICE_NAME | Service name for OpenTelemetry tracing | pii-redactor |
Setting Variables
Docker:
docker run -e DATABASE_URL=... -e API_KEY_SECRET=... ghcr.io/uni-qingzhuo-zhen/pii-redactor:latestDocker Compose — Use an .env file:
DATABASE_URL=postgresql+asyncpg://pii:secret@db:5432/pii_redactor
API_KEY_SECRET=your-secret-key
ENCRYPTION_KEY=your-fernet-keyKubernetes — Use Secrets and ConfigMaps. See the Kubernetes deployment guide for details.