Skip to content

Self-hosting

Raven is made of three parts, each with its own repository and Docker image:

Part What it is Image port
raven-bot The bot and its HTTP API, with MongoDB for storage 3001
raven-dashboard The dashboard (Nuxt) 3000
raven-docs This site (static, served by nginx) 80
  1. Create an application at the Discord developer portal and add a bot.
  2. Under Bot, turn on the Server Members and Presence intents. Raven needs presences for streamers and /phasmo-mute.
  3. Under OAuth2, add the dashboard’s redirect URL, for example https://dashboard.example.com/auth/discord.

Environment variables:

Variable What it is
BOT_TOKEN The bot token
BOT_ID The application ID
MONGO_URL MongoDB connection string, e.g. mongodb://user:pass@mongo:27017/
API_SECRET Secret for the HTTP API; the dashboard needs the same value

After a change to the commands, register them with Discord: pnpm commands:register in raven-bot.

Variable What it is
NUXT_OAUTH_DISCORD_CLIENT_ID / NUXT_OAUTH_DISCORD_CLIENT_SECRET From the application’s OAuth2 page
NUXT_OAUTH_DISCORD_REDIRECT_URL The dashboard URL plus /auth/discord
NUXT_APP_SECRET At least 32 random characters; seals the login cookie
NUXT_BOT_API_URL Where the bot’s API is reachable, e.g. http://raven:3001
NUXT_BOT_API_SECRET The bot’s API_SECRET
NUXT_PUBLIC_CONTEXT production (default) requires Discord login. development skips login and lets anyone manage every server; only use it locally

The dashboard has no database. Keep the bot’s API on an internal network: only the dashboard needs to reach it.