Skip to main content

Overview

Genie Helper requires several environment variables for security, service connectivity, and feature configuration. This page documents all required and optional environment variables.

Core Security Variables

Credential Encryption

Required for production
Used for AES-256-GCM encryption of platform credentials (OnlyFans, etc.) stored in Directus. Generate a key:

Directus Admin Access

This token is used by:
  • Registration endpoint (creates users without exposing admin credentials to browser)
  • RBAC sync operations
  • Server-side Directus MCP tools
Generate in Directus:
  1. Login to Directus admin panel (http://localhost:8055/admin)
  2. Settings → Access Tokens → Create New Token
  3. Name: “Server Admin Token”
  4. No expiration
  5. Copy token to .env

RBAC Sync Webhook

Used to secure the Directus → AnythingLLM user sync webhook. Generate:

Service Configuration

AnythingLLM (server/.env)

Directus CMS (cms/.env)

Generate KEY and SECRET:

Stagehand Server (server/.env)

Media Worker (media-worker/.env)

Dashboard (dashboard/.env)

MCP Server Configuration

MCP servers are configured in storage/plugins/anythingllm_mcp_servers.json:
MCP servers are auto-booted on AnythingLLM startup via patched server/utils/boot/index.js.

Production Hardening

Change Default Passwords

Enable Password Policy (Directus)

Requirements:
  • Minimum 8 characters
  • At least 1 digit
  • At least 1 lowercase letter
  • At least 1 uppercase letter
  • At least 1 special character
  • No whitespace

Restrict Admin Access

For production, restrict admin panel access:
  1. IP Allowlist: Configure Nginx to allow admin subdomains only from specific IPs
  2. VPN: Require VPN connection for admin access
  3. Cookie Gate: Use the cookie gate system (see nginx configs)

Database: SQLite → PostgreSQL

For production with multiple users, migrate Directus from SQLite to PostgreSQL:

Environment Files Checklist

  • server/.env - AnythingLLM configuration
  • cms/.env - Directus configuration
  • media-worker/.env - BullMQ worker configuration
  • dashboard/.env - React build variables
  • storage/plugins/anythingllm_mcp_servers.json - MCP server config

Security Best Practices

  1. Never commit .env files - Add to .gitignore
  2. Use strong random values - Generate with crypto.randomBytes()
  3. Rotate secrets regularly - Especially admin tokens and encryption keys
  4. Restrict admin token scope - Use dedicated tokens per service if possible
  5. Enable HTTPS - Use SSL certificates (Let’s Encrypt via Plesk)
  6. Monitor logs - Check PM2 logs for unauthorized access attempts

Next Steps