Add musicbrainz role for self-hosted MetaBrainz mirror
Created by: jedmund
Summary
Add a musicbrainz role that runs the official metabrainz/musicbrainz-docker upstream stack with a thin local/ overlay (Traefik labels, network attachment, replication token). Wire multi-scrobbler in media_consumption to hit the local mirror over shared-network instead of the public musicbrainz.org endpoint.
Why
Multi-scrobbler enriches scrobbles with MusicBrainz metadata. Against the public WS/2 endpoint that's bound by a 1 req/s rate limit and ~600ms round trip, which causes the enrichment queue to back up. Local mirror is rate-limit-free and ~10ms.
Commits
- musicbrainz: add role for self-hosted MetaBrainz mirror — the role itself + deploy playbook
- infra: wire musicbrainz into orchestration — host group, all.yml import, TinyAuth label
- media_consumption: route multi-scrobbler MB lookups to local mirror — defaults var + multi-scrobbler config
- Makefile: add deploy-musicbrainz target
Notes
- Pinned to upstream tag
v-2026-04-27.0. Master HEAD references base images that haven't been pushed yet (e.g.metabrainz/musicbrainz-docker-musicbrainz:<tag>-build0404s on build). - DB credentials are upstream defaults (
musicbrainz/musicbrainz). Postgres is on an internal-only docker network, never reachable from host or other stacks. - No backup strategy — DB is reproducible from upstream dumps. If the volume is lost, re-run the import.
- Vault key
musicbrainz_replication_tokenmust be present ingroup_vars/musicbrainz/vault.ymlbefore deploy. Get one frommetabrainz.org/account/applications.
Test plan
-
group_vars/musicbrainz/vault.ymlexists withmusicbrainz_replication_token -
make deploy-musicbrainzbrings the stack up cleanly -
Run the manual import from roles/musicbrainz/README.md(~3-6 hours, do via tmux on nuc-mini) -
After import: curl -fsS 'http://nuc-mini:5000/ws/2/recording/?query=artist:cornelius&fmt=json' | jq '.count'returns > 0 -
https://musicbrainz.atelier.houseresolves and serves the MB UI behind TinyAuth -
make deploy-media-consumptionrolls multi-scrobbler with the new config -
docker logs multi-scrobblershows MB lookups hittinghttp://musicbrainz:5000and not the public endpoint