UnlockEd Production Deployment - Environment Variables Guide
UnlockEd is designed to be deployed in a Kubernetes (k8s) cluster . To function correctly, it requires multiple services, including:
PostgreSQL (Database)
NATS (Messaging system)
Ory Hydra (OAuth 2.0 provider)
Ory Kratos (Identity management)
UnlockEd Server (Main backend API)
Provider Middleware (Handles video and content processing)
Cron Tasks (Handles scheduled jobs)
This guide covers the required environment variables necessary for a production deployment.
Required Environment Variables
1. General Application Settings
Variable
Description
Example Value
APP_ENV
Defines the environment (production/development)
production
APP_KEY
Secret key for the application (stored in Kubernetes Secret)
<SECRET_KEY>
APP_URL
The public URL of the UnlockEd server
https://example.com
LOG_LEVEL
Logging level for debugging
debug
2. Database Configuration
Variable
Description
Example Value
DB_HOST
PostgreSQL database hostname
postgres
DB_PORT
PostgreSQL port
5432
DB_USER
Database username
testing
DB_NAME
Database name
testing
DB_PASSWORD
Database password (should be stored securely)
ChangeMe!
3. Authentication & Identity Management (Ory Hydra & Kratos)
4. Messaging System (NATS)
Variable
Description
Example Value
NATS_URL
NATS server connection URL
nats://nats:4222
NATS_USER
NATS authentication username
testing
NATS_PASSWORD
NATS authentication password
ChangeMe!
5. Video Processing & Storage
Variable
Description
Example Value
S3_BUCKET_NAME
S3 bucket used for storing video assets
unlockedv2
AWS_REGION
AWS region for the S3 bucket
us-west-2
IMG_FILEPATH
Path where thumbnails/images are stored
/imgs
BRIGHTSPACE_TEMP_DIR
Temporary directory for Brightspace exports
/videos
YOUTUBE_API_KEY
Google cloud API key for accessing the youtube API (Optional)
<API_KEY>
7. Scheduled Tasks & Migrations
Variable
Description
Example Value
MIDDLEWARE_CRON_SCHEDULE
Cron schedule for periodic tasks
0 22 * * *
MIGRATION_DIR
Directory for database migrations
./migrations
These environment variables are essential for running UnlockEd in a production environment. Ensure they are properly configured in your Kubernetes Secrets & ConfigMaps for security and reliability.
For additional configuration details, refer to further UnlockEd documentation or contact the team.