6 Commits
Author SHA1 Message Date
mattandClaude Sonnet 5 5bdeeddb0b Add album art backend: MusicBrainz + Cover Art Archive, proxied and cached
New GET /api/v1/art/album?artist=&album= resolves and streams an
album's cover art. Lookups go through MusicBrainz release-group
search then Cover Art Archive's release-group front-image endpoint,
both free and keyless - no setup required by self-hosters. Results
(hits, misses and errors) are cached in a new album_art table keyed
case-insensitively on (artist, album), since Scrobble.mbid can't be
trusted as a release identifier.

The service layer separates resolving where the art is (lookup())
from fetching the bytes (fetch_image()) so a future move to storing
the bytes ourselves only touches the latter.

Also widens the UI's CSP (img-src) to allow blob: URLs, since the
frontend will fetch art with the existing bearer-auth header and
hand the browser a blob: object URL rather than hotlinking.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-06 17:05:57 +01:00
mattandClaude Opus 5.5 8d12922f6a Serve fediverse paths on the UI's domain (phase 1, step 6)
CI / validate-monitoring (push) Successful in 8s
CI / lint (push) Successful in 12s
CI / test (push) Successful in 1m6s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s
- The UI container forwards /.well-known/{webfinger,nodeinfo,host-meta},
  /nodeinfo/, /users/, /inbox and /actor to API_INTERNAL_URL (compose:
  http://api:8000), passing Host and X-Forwarded-*; unset means no
  forwarding
- The API's name is resolved per request via the container's resolver,
  so the UI starts before the API and survives API restarts
- Compose passes the FEDERATION_* settings to api and worker;
  .env.example documents them, including FEDERATION_KEY_SECRET
- gunicorn: disable the 26.x control socket (the container user has no
  home directory)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
2026-09-25 20:32:40 +01:00
mattandClaude Opus 5.5 c79c42ee00 Federation module skeleton and its own migration branch (phase 0, steps 3-4)
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 12s
CI / test (push) Successful in 50s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s
- scrobbler.federation with init_app() as its only entry point, called
  from create_app(); does nothing unless FEDERATION_ENABLED
- FederationConfig validates FEDERATION_DOMAIN (bare host) and
  FEDERATION_BASE_URL (https) when enabled, with clear errors
- federation/protocol/ package for pure, framework-free protocol code
- Package README with the boundary rules, configuration and migration
  workflow; .env.example lists the settings (off)
- Alembic: existing history labelled `core`; new empty `federation`
  branch root (depends on the core users table). Everything upgrades
  `heads` (entrypoint, CI, tests); tests check both branches apply and
  that federation can be removed without touching core

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
2026-09-25 19:59:47 +01:00
mattandClaude Opus 5.5 e40a074a64 Import page in the web UI, worker service and import monitoring
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 11s
CI / test (push) Successful in 43s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s
- New Import page: upload an export (with upload progress) or, when the
  server has a Last.fm API key, import straight from a Last.fm username;
  jobs list with live progress, counts, errors and cancelling
- docker compose runs the import worker from the API image; the API
  image no longer sets PROMETHEUS_MULTIPROC_DIR (gunicorn.conf.py does,
  and other commands must not inherit multiprocess mode)
- Prometheus scrapes the worker; Usage dashboard gains an Imports row;
  ImportWorkerDown and ImportJobsWaiting alerts
- README and .env.example document imports and LASTFM_API_KEY

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
2026-09-25 15:10:15 +01:00
mattandClaude Opus 5.5 ea705589f1 Monitoring stack, containers and dashboards
CI / lint (push) Successful in 9s
CI / test (push) Successful in 36s
CI / notify (push) Successful in 5s
- API image (uv multi-stage, non-root, gunicorn, migrations on start,
  health check) and UI image (nginx, CSP, config.js rendered from
  API_BASE_URL); /healthz documented in OpenAPI
- docker compose runs db, api and ui; the "monitoring" profile adds
  Prometheus, postgres-exporter and Grafana, all provisioned from files
- Grafana dashboards: API overview (RED), Last.fm API, Usage, Database
- Prometheus alert rules: API down, error rate, latency, auth failure
  spike, ignored scrobbles, DB pool saturation, Postgres down
- Pool checkout gauge counts events (the pool's own counters lag the
  checkin event); error ratios show 0 instead of "No data"
- Tests check dashboards and alerts only use metrics that exist
- scripts/generate_traffic.py drives realistic traffic for demos

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
2026-09-25 14:26:19 +01:00
mattandClaude Opus 5.5 98c8f2e824 App factory, data model, initial migration and HTTP metrics
CI / lint (push) Successful in 9s
CI / test (push) Failing after 22s
CI / notify (push) Successful in 5s
- Flask app factory with env-driven config (.env loaded at import)
- SQLAlchemy models: users, API apps, UI tokens, Last.fm auth tokens,
  sessions, scrobbles (deduplicated) and now-playing
- Initial Alembic migration; CI checks migrations match the models
- Prometheus metric definitions, per-endpoint RED hooks with bounded
  labels, and a standalone metrics server
- docker compose Postgres with a test database; CI test job runs
  against a Postgres service container

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 13:55:04 +01:00