Skip to content

Configuration

TalesMUD is configured via environment variables. Copy .env.example to .env and edit as needed.

VariableDefaultDescription
PORT8010HTTP server port
GIN_MODEdebugGin framework mode: debug, release, or test
LOG_LEVELdebugLog verbosity: debug, info, warn, error
Terminal window
PORT=8010
GIN_MODE=debug
LOG_LEVEL=debug

In production, set GIN_MODE=release to disable debug logging and enable performance optimizations.

VariableDefaultDescription
AUTH_ENABLEDfalseEnable Auth0 JWT authentication
ADMIN_USERadminAdmin username (when AUTH_ENABLED=false)
ADMIN_PASSWORDchangemeAdmin password (when AUTH_ENABLED=false)
Terminal window
AUTH_ENABLED=false
ADMIN_USER=admin
ADMIN_PASSWORD=changeme

These variables are only required when AUTH_ENABLED=true.

VariableExampleDescription
AUTH0_AUDIENCEhttps://talesmud.io/apiAuth0 API audience
AUTH0_DOMAINhttps://your-tenant.auth0.com/Auth0 tenant domain
AUTH0_WK_JWKShttps://your-tenant.auth0.com/.well-known/jwks.jsonJWKS endpoint for JWT validation
Terminal window
AUTH_ENABLED=true
AUTH0_AUDIENCE=https://talesmud.io/api
AUTH0_DOMAIN=https://your-tenant.auth0.com/
AUTH0_WK_JWKS=https://your-tenant.auth0.com/.well-known/jwks.json

See the Auth0 Setup guide for detailed instructions.

VariableDefaultDescription
SQLITE_PATH./talesmud.dbPath to the SQLite database file
Terminal window
SQLITE_PATH=./talesmud.db

For Docker deployments, mount a volume and point to the mounted path:

Terminal window
SQLITE_PATH=/data/talesmud.db
VariableDefaultDescription
BACKGROUNDS_PATH./uploads/backgroundsDirectory for room background images
Terminal window
BACKGROUNDS_PATH=./uploads/backgrounds
VariableDefaultDescription
GROQ_API_KEY(empty)Groq API key for AI-assisted character generation
Terminal window
GROQ_API_KEY=gsk_...

When set, TalesMUD uses the Groq API to generate character backstories during character creation. If not set, AI generation is silently disabled.

Terminal window
# Application settings
GIN_MODE=debug
LOG_LEVEL=debug
PORT=8010
# Authentication
AUTH_ENABLED=false
ADMIN_USER=admin
ADMIN_PASSWORD=changeme
# Auth0 (optional, only needed if AUTH_ENABLED=true)
AUTH0_AUDIENCE=http://localhost:8010/api
AUTH0_DOMAIN=https://your-tenant.auth0.com/
AUTH0_WK_JWKS=https://your-tenant.auth0.com/.well-known/jwks.json
# SQLite database path
SQLITE_PATH=./talesmud.db
# Background images storage path
BACKGROUNDS_PATH=./uploads/backgrounds

In docker-compose.yml, environment variables are set under the environment key:

services:
talesmud:
build: .
ports:
- "8010:8010"
environment:
- GIN_MODE=release
- SQLITE_PATH=/data/talesmud.db
- AUTH_ENABLED=false
- ADMIN_USER=admin
- ADMIN_PASSWORD=changeme
volumes:
- ~/volumes/talesmud/data:/data

TalesMUD has a three-tier role system:

RoleAccess
PlayerPlay the game, manage own characters
MUD CreatorAccess the content editor (Creator UI)
MUD AdminFull access including user management, ban system, role promotion

When AUTH_ENABLED=false, the admin user automatically gets the Admin role. When using Auth0, roles are managed through user promotion in the admin UI.