Skip to content

Configuration

Complete guide to configuring MediaMagic CRM for your environment.

Environment Files

FilePurposeGit Status
.envLocal developmentIgnored
.env.exampleTemplateCommitted
.env.serverProduction valuesIgnored

Required Variables

Database Configuration

bash
# Root password for MySQL
MYSQL_ROOT_PASSWORD=strong_password_here

# Application database password
MYSQL_PASSWORD=app_password_here
bash
# Analytics database password
POSTGRES_PASSWORD=analytics_password_here

EspoCRM 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_setup

Getting the API Key

  1. Start services with docker compose up -d
  2. Log into EspoCRM
  3. Go to Admin → API Users
  4. Create a new API user with admin role
  5. Copy the generated API key to .env
  6. 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:3200

External Service Configuration

Ayrshare (Social Media)

bash
# Get from https://app.ayrshare.com/dashboard/api-key
AYRSHARE_API_KEY=your_ayrshare_api_key

Required 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:3001

Required 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.com

Used 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_key

CDN & 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.net

Complete 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.net

Service URLs by Environment

ServiceLocalProduction
EspoCRMhttp://localhost:8080https://crm.yourdomain.com
Bridge APIhttp://localhost:3100https://api.yourdomain.com
Grafanahttp://localhost:3200https://analytics.yourdomain.com
Mobile PWAhttp://localhost:3300https://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
done

Next Steps

MediaMagic CRM Documentation