Overview
Self-hosted Annie Mei has two env surfaces:- the main
annie-meibot service - the companion
authservice for AniList OAuth
.env files for both services.
Shared values
These values should stay aligned across the bot and auth service.| Variable | Required | Notes |
|---|---|---|
OAUTH_CONTEXT_SIGNING_SECRET | Yes | Must match so the auth service can validate the bot’s signed OAuth context |
USERID_HASH_SALT | Yes | Keep this aligned if you want consistent hashed user identifiers in logs and Sentry |
Bot service
Required
| Variable | Notes |
|---|---|
DISCORD_TOKEN | Discord bot token |
DATABASE_URL | PostgreSQL connection string for the bot service |
REDIS_URL | Redis connection string |
SPOTIFY_CLIENT_ID | Spotify API client ID |
SPOTIFY_CLIENT_SECRET | Spotify API client secret |
MAL_CLIENT_ID | MyAnimeList API client ID |
SENTRY_DSN | Required by current bot startup |
ENV | Environment name such as development, staging, or production |
AUTH_SERVICE_BASE_URL | Auth service origin only, with no path |
OAUTH_CONTEXT_SIGNING_SECRET | Shared secret used to sign OAuth context payloads |
USERID_HASH_SALT | Salt for hashing Discord user IDs in logs |
Optional
| Variable | Default | Notes |
|---|---|---|
SENTRY_TRACES_SAMPLE_RATE | 0.0 | Float from 0.0 to 1.0 |
SERVER_PORT | 8080 | Local HTTP health server port |
OAUTH_CONTEXT_TTL_SECONDS | 300 | Lifetime of /register OAuth links |
GEMINI_API_KEY | none | Enables Gemini or another compatible LLM provider |
LLM_MODEL | gemini-2.0-flash | Optional LLM model override |
LLM_BASE_URL | https://generativelanguage.googleapis.com/v1beta/openai | Optional OpenAI-compatible base URL override |
RUST_LOG | info,serenity=warn | Tracing filter for local or production logging |
Auth service
Required
| Variable | Notes |
|---|---|
ANILIST_CLIENT_ID | AniList OAuth app client ID |
ANILIST_CLIENT_SECRET | AniList OAuth app client secret |
ANILIST_REDIRECT_URI | Must match the AniList app callback URL |
DATABASE_URL | PostgreSQL connection string for auth sessions and credentials |
ROCKET_SECRET_KEY | Rocket application secret |
OAUTH_CONTEXT_SIGNING_SECRET | Shared secret used to validate the bot’s OAuth context |
USERID_HASH_SALT | Salt used for hashed user fingerprints in logs |
Optional
| Variable | Default | Notes |
|---|---|---|
OAUTH_CONTEXT_TTL_SECONDS | 300 | Accepted age of signed OAuth context payloads |
OAUTH_STATE_TTL_SECONDS | 300 | Lifetime of the single-use AniList OAuth state value |
SENTRY_DSN | none | Enables Sentry in the auth service |
SENTRY_ENVIRONMENT | none | Environment label used by Sentry |
SENTRY_TRACES_SAMPLE_RATE | 0.0 | Float from 0.0 to 1.0 |
Example local configuration
Bot .env
Auth auth/.env
Where these values are used
- Bot service references come from
annie-mei/src/main.rs,annie-mei/src/server.rs, andannie-mei/src/utils/oauth.rs - Auth service references come from
auth/src/main.rs
