Skip to content

Repository files navigation

corpus

builds.sr.ht status

A self-hosted ListenBrainz and Last.fm listening-history dashboard. Corpus stores scrobbles in DuckDB, enriches release metadata, caches cover art, and serves an Elm web interface.

Documentation

  • Architecture: components, routes, data flows, configuration and operations
  • DuckDB: schema and analytical queries

Quick start

With Nix:

just shell
just nix build
just nix run

Or build locally with pnpm:

pnpm install
pnpm spago install
pnpm run build
pnpm test
pnpm spago run

Scrobbling API

Send ListenBrainz-compatible submissions to POST /1/submit-listens. Include Authorization: Token <token> and a standard ListenBrainz payload. Validate a token with GET /1/validate-token and the same header.

Corpus shows tokens once when you create, reset or approve a user. Store them securely.

Configuration

users.json defines each static user's slug, source usernames, DuckDB filename, and cover/backup settings. Shared secrets and integrations are supplied by environment variables.

VariablePurpose
CORPUS_USERS_FILEStatic user configuration (default: users.json)
DATABASE_PATHDirectory containing user databases
LASTFM_API_KEY, DISCOGS_TOKENLast.fm sync and metadata/cover fallbacks
S3_BUCKET and AWS_*Cover cache and optional database backups
COSINE_API_KEYSimilar-track lookup
PORT, HOSTHTTP listener (defaults: 8000, 127.0.0.1)
METRICS_ENABLEDEnable Prometheus metrics at /metrics

Set REGISTRATION_ENABLED=true to allow public registration at /register. Set ADMIN_TOKEN to enable approval at /admin. See the configuration reference for all settings and the registration workflow.

About

self-hosted listenbrainz and last.fm proxy

Topics

Resources

Stars

30 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages