Configuration
Complete guide to configuring MediaMagic CRM for your environment.
Environment Files
| File | Purpose | Git Status |
|---|---|---|
.env | Local development | Ignored |
.env.example | Template | Committed |
.env.server | Production values | Ignored |
Required Variables
Database Configuration
bash
# Root password for MySQL
MYSQL_ROOT_PASSWORD=strong_password_here
# Application database password
MYSQL_PASSWORD=app_password_herebash
# Analytics database password
POSTGRES_PASSWORD=analytics_password_hereEspoCRM Configuration
bash
# Admin credentials (created on first run)
ESPOCRM_ADMIN_USER=admin
ESPOCRM_ADMIN_PASSWORD=your_admin_password
# Site URL (used for internal links)
ESPOCRM_SITE_URL=http://localhost:8080
# API Key (generated after setup)
ESPOCRM_API_KEY=your_api_key_after_setupGetting the API Key
- Start services with
docker compose up -d - Log into EspoCRM
- Go to Admin → API Users
- Create a new API user with admin role
- Copy the generated API key to
.env - Restart Bridge:
docker compose restart bridge
Grafana Configuration
bash
# Admin credentials
GRAFANA_ADMIN_USER=admin
GRAFANA_ADMIN_PASSWORD=your_grafana_password
# Root URL for external access
GRAFANA_ROOT_URL=http://localhost:3200External Service Configuration
Ayrshare (Social Media)
bash
# Get from https://app.ayrshare.com/dashboard/api-key
AYRSHARE_API_KEY=your_ayrshare_api_keyRequired for:
- Scheduling social posts
- Collecting social analytics
- Managing post history
X Server (Platform Automation)
bash
# URL to your X Server instance
X_SERVER_URL=http://your-x-server:3001Required for:
- Publishing to Rumble, YouTube, Boxcast, etc.
- Livestream creation
- Episode uploads
n8n (Workflow Automation)
bash
# Base URL for n8n webhooks
N8N_WEBHOOK_BASE=https://your-n8n-instance.comUsed for:
- Guest booking notifications
- Content stage transitions
- Custom automations
AI & Transcription
bash
# Claude API (AI analysis)
ANTHROPIC_API_KEY=your_anthropic_key
# Deepgram (transcription - primary)
DEEPGRAM_API_KEY=your_deepgram_key
# AssemblyAI (transcription - alternative)
ASSEMBLYAI_API_KEY=your_assemblyai_keyCDN & Storage
bash
# Bunny.net CDN
BUNNY_STORAGE_API_KEY=your_bunny_key
BUNNY_STORAGE_ZONE=your_zone_name
BUNNY_CDN_URL=https://your-cdn.b-cdn.netComplete Example
bash
# ============================================
# MediaMagic CRM Configuration
# ============================================
# --- MySQL (EspoCRM Database) ---
MYSQL_ROOT_PASSWORD=super_secure_root_pw
MYSQL_PASSWORD=espocrm_db_password
# --- EspoCRM ---
ESPOCRM_ADMIN_USER=admin
ESPOCRM_ADMIN_PASSWORD=admin_password_123
ESPOCRM_SITE_URL=http://localhost:8080
ESPOCRM_API_KEY= # Fill after setup
# --- PostgreSQL (Analytics) ---
POSTGRES_PASSWORD=analytics_db_password
# --- Grafana ---
GRAFANA_ADMIN_USER=admin
GRAFANA_ADMIN_PASSWORD=grafana_admin_pw
GRAFANA_ROOT_URL=http://localhost:3200
# --- Ayrshare (Social Media) ---
AYRSHARE_API_KEY=your_ayrshare_key
# --- X Server (Platform Publishing) ---
X_SERVER_URL=http://192.168.1.100:3001
# --- n8n (Workflows) ---
N8N_WEBHOOK_BASE=https://n8n.yourdomain.com
# --- AI & Transcription ---
ANTHROPIC_API_KEY=sk-ant-xxx
DEEPGRAM_API_KEY=xxx
ASSEMBLYAI_API_KEY=xxx
# --- CDN ---
BUNNY_STORAGE_API_KEY=xxx
BUNNY_STORAGE_ZONE=mediamagic
BUNNY_CDN_URL=https://mediamagic.b-cdn.netService URLs by Environment
| Service | Local | Production |
|---|---|---|
| EspoCRM | http://localhost:8080 | https://crm.yourdomain.com |
| Bridge API | http://localhost:3100 | https://api.yourdomain.com |
| Grafana | http://localhost:3200 | https://analytics.yourdomain.com |
| Mobile PWA | http://localhost:3300 | https://mobile.yourdomain.com |
Platform-Specific Configuration
Rumble
No additional configuration needed. Credentials managed in X Server.
Boxcast
No additional configuration needed. Uses Rumble RTMP via dependency cascade.
YouTube
Requires OAuth setup in X Server. Contact X Server admin.
Transistor
Podcast RSS feed credentials configured in X Server.
Security Best Practices
Never Commit Secrets
Always use .env files and ensure they're in .gitignore.
Use Strong Passwords
- Minimum 16 characters
- Mix of letters, numbers, symbols
- Different password for each service
Rotate API Keys
Regularly rotate API keys, especially after team member changes.
Validating Configuration
bash
# Check all required vars are set
grep -E "^[A-Z_]+=$" .env | while read line; do
var=$(echo $line | cut -d= -f1)
val=$(echo $line | cut -d= -f2)
if [ -z "$val" ]; then
echo "⚠️ Missing: $var"
fi
doneNext Steps
- Quick Start — Run locally
- Deployment — Deploy to production
- Environment Variables Reference — Full variable list