Skip to content

Configuration Reference

OsuRender API is configured entirely through environment variables, managed by pydantic-settings. Copy .env.example to .env and customize as needed.

Application Settings

VariableTypeDefaultDescription
APP_NAMEstrOsuRender APIApplication display name
APP_HOSTstr0.0.0.0Server bind address
APP_PORTint8000Server port
DEBUGboolfalseEnable debug mode (verbose SQL, full error messages)
CORS_ORIGINSlist[str]["*"]Allowed CORS origins
API_BASE_URLstrhttp://localhost:8000Public-facing base URL for webhook callbacks

Database

VariableTypeDefaultDescription
DATABASE_URLstrpostgresql+asyncpg://osurender:osurender@localhost:5433/osurenderAsync PostgreSQL connection string (used by API + Dispatcher)
DATABASE_URL_SYNCstrpostgresql+psycopg2://osurender:osurender@localhost:5433/osurenderSync PostgreSQL connection string (used by Alembic)

Redis

VariableTypeDefaultDescription
REDIS_URLstrredis://localhost:6379/0Redis connection URL (Celery broker + rate limiter backend)

Object Storage (S3-compatible)

VariableTypeDefaultDescription
STORAGE_ENDPOINTstrlocalhost:9000S3-compatible endpoint (MinIO locally, R2 in production)
STORAGE_ACCESS_KEYstrminioadminS3 access key
STORAGE_SECRET_KEYstrminioadminS3 secret key
STORAGE_BUCKET_NAMEstrosurenderBucket name for all artifacts
STORAGE_USE_SSLboolfalseEnable HTTPS for storage connections
VariableTypeDefaultDescription
USE_MODAL_GPUstr0Set to 1 to offload rendering to Modal GPU instances
MODAL_TOKEN_IDstr(empty)Modal API token ID
MODAL_TOKEN_SECRETstr(empty)Modal API token secret
WEBHOOK_SECRETstr(empty)HMAC-SHA256 secret for webhook verification

osu! API

VariableTypeDefaultDescription
OSU_API_KEYstr(empty)osu! API v1 key for beatmap resolution (required)

Rendering Defaults

VariableTypeDefaultDescription
DEFAULT_SKINstrDefaultDefault skin if none specified
DEFAULT_BG_DIMfloat0.95Default background dim (0.0 – 1.0)
DEFAULT_RESOLUTIONstr1080pDefault resolution (1080p or 4k)
RENDER_TIMEOUT_SECONDSint600Hard timeout for render jobs (10 minutes)

Upload Limits

VariableTypeDefaultDescription
MAX_REPLAY_SIZE_MBint50Maximum .osr file upload size
MAX_SKIN_SIZE_MBint200Maximum .osk file upload size

Capacity Limits

VariableTypeDefaultDescription
MAX_QUEUEDint100Maximum number of jobs in queued state (circuit breaker)
MAX_RENDERINGint20Maximum number of jobs in rendering/downloading state

Worker Types

The WORKER_TYPE environment variable controls which process starts in the Docker container:

ValueProcessDescription
apiUvicorn + FastAPIHTTP API gateway
dispatcherOutboxDispatcherPostgreSQL → Celery bridge
celeryCelery WorkerRender job processor
beatCelery BeatScheduled task scheduler (zombie reaper)

TIP

In Docker Compose, each service sets WORKER_TYPE in its environment. The scripts/start.sh entrypoint routes to the correct process.

Built with VitePress