Configuration
Environment variables and server setup
Overview
LinkedRecords is configured primarily through environment variables. This guide covers all available configuration options.
Quick Start
For local development, use Docker Compose:
This starts LinkedRecords on port 6543 with a built-in mock OIDC provider for testing.
The Docker Compose setup is for local development only. It includes a mock OIDC provider with test accounts and should not be used in production.
Database Configuration
LinkedRecords uses PostgreSQL for data storage:
| Variable | Description | Default |
|---|---|---|
PGHOST | PostgreSQL host | localhost |
PGPORT | PostgreSQL port | 5432 |
PGUSER | Database user | - |
PGPASSWORD | Database password | - |
PGDATABASE | Database name | - |
Authentication (OIDC)
LinkedRecords supports OpenID Connect for authentication:
| Variable | Description | Required |
|---|---|---|
AUTH_ISSUER_BASE_URL | OIDC provider URL | Yes |
AUTH_CLIENT_ID | OAuth client ID | Yes |
AUTH_CLIENT_SECRET | OAuth client secret | Confidential clients |
AUTH_COOKIE_SIGNING_SECRET | Secret for signing cookies | Yes |
AUTH_TOKEN_AUDIENCE | Token audience (public client mode) | Public clients |
Confidential Client Mode
For same-domain setups where the frontend and backend share a domain:
Public Client Mode
For cross-domain setups (SPA on different domain than API):
CORS Configuration
For cross-domain access, configure allowed origins:
| Variable | Description | Default |
|---|---|---|
CORS_ORIGIN | JSON array of allowed origins | ["http://localhost:*"] |
URL Configuration
| Variable | Description | Default |
|---|---|---|
SERVER_BASE_URL | Public URL of the LinkedRecords server | - |
FRONTEND_BASE_URL | URL of the frontend application | - |
Redis Configuration
Redis is used for caching and real-time pub/sub:
| Variable | Description | Default |
|---|---|---|
REDIS_URL | Redis connection URL | redis://localhost:6379 |
S3/MinIO Configuration (Optional)
For blob storage, configure S3-compatible object storage:
| Variable | Description | Default |
|---|---|---|
S3_ENDPOINT | S3-compatible endpoint URL | - |
S3_BUCKET | Bucket name | - |
S3_ACCESS_KEY | Access key ID | - |
S3_SECRET_KEY | Secret access key | - |
S3_USE_SSL | Use HTTPS (true/false) | true |
If S3 is not configured, blob storage will use PostgreSQL (with reduced performance for large files).
Quota Configuration
Control storage limits per user:
| Variable | Description | Default |
|---|---|---|
DEFAULT_STORAGE_SIZE_QUOTA | Default storage quota in MB | 500 |
QUOTA_COUNT_KV_ATTRIBUTES | Max key-value attributes | - |
QUOTA_COUNT_LT_ATTRIBUTES | Max long-text attributes | - |
QUOTA_COUNT_BLOB_ATTRIBUTES | Max blob attributes | - |
Payment Integration (Optional)
For paid plans with Paddle:
| Variable | Description |
|---|---|
PADDLE_API_KEY | Paddle API key |
PADDLE_API_URL | Paddle API URL |
PADDLE_NOTIFICATION_SECRET | Webhook signing secret |
Performance Tuning
| Variable | Description | Default |
|---|---|---|
ENABLE_AUTH_RULE_CACHE | Cache authorization rules | false |
SHORT_LIVED_ACCESS_TOKEN_SIGNING | Use short-lived tokens | false |
Complete Example Configuration
Development
Production
OIDC Provider Setup
Auth0
- Create an Application (Regular Web Application for confidential, SPA for public)
- Configure Allowed Callback URLs:
https://your-backend.com/callback - Configure Allowed Logout URLs:
https://your-app.com - Configure Allowed Web Origins:
https://your-app.com - Get the Client ID and Client Secret
Other Providers
LinkedRecords works with any standard OIDC provider:
- Okta: Use the OIDC metadata URL
- Keycloak: Configure a client with appropriate scopes
- Google: Create OAuth 2.0 credentials
Health Check
LinkedRecords exposes a health endpoint:
Logging
Configure logging output through standard Node.js mechanisms: