Commit Graph
11 Commits
Author SHA1 Message Date
mattandClaude Sonnet 5.5 9243fe4d3f Let users pick their Gravatar as their profile image (SCR-1)
CI / validate-monitoring (push) Successful in 8s
CI / lint (push) Successful in 13s
CI / federation-interop (push) Successful in 1m42s
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / trigger-deploy (push) Skipped
CI / test (push) Successful in 5m46s
CI / images (push) Skipped
CI / notify (push) Successful in 7s
Opt-in per user and gated by AVATAR_GRAVATAR_ENABLED. The server fetches the image by
the SHA-256 of the account email and caches it with the uploads, so browsers never
contact Gravatar.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 11:41:32 +01:00
mattandClaude Sonnet 5.5 c55a6596d0 Add uploaded profile images (SCR-1)
CI / validate-monitoring (push) Successful in 8s
CI / lint (push) Successful in 16s
CI / federation-interop (push) Successful in 1m40s
CI / test (push) Successful in 4m48s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / trigger-deploy (push) Skipped
CI / notify (push) Successful in 5s
Users can upload, fetch and remove a profile image at /api/v1/me/avatar. The
bytes live in an avatars folder inside ART_STORAGE_DIR; the users row records the
source and content type. Adds metrics, AVATAR_UPLOAD_MAX_BYTES and the regenerated
OpenAPI document.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-13 11:39:43 +01:00
mattandClaude Sonnet 5.5 ad383b602e Configurable logging for the API and worker (SCR-5)
CI / notify (push) Successful in 6s
CI / lint (push) Successful in 18s
CI / test (push) Successful in 5m26s
CI / validate-monitoring (push) Successful in 15s
CI / federation-interop (push) Successful in 1m17s
CI / images (push) Successful in 33s
CI / assets (push) Successful in 9s
CI / python-package (push) Successful in 18s
CI / trigger-deploy (push) Successful in 3s
Shared LOG_LEVEL/LOG_FORMAT (text or json) set up in create_app, per-task
activity and duration logs in the worker, and more context on delivery,
inbox and import failures. Alembic's fileConfig no longer disables loggers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 23:30:54 +01:00
mattandClaude Sonnet 5.5 d0b8e1ed22 Add per-user album art override model and migration
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QHPkt2v797pphGCFKfTFmv
2026-10-06 22:22:26 +01:00
mattandClaude Sonnet 5 83b27d7ba1 Stop album art from blocking page loads
CI / validate-monitoring (push) Successful in 8s
CI / lint (push) Successful in 13s
CI / federation-interop (push) Successful in 1m39s
CI / test (push) Successful in 3m38s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / trigger-deploy (push) Skipped
CI / notify (push) Successful in 5s
Root cause: gunicorn runs only 2 sync workers, and GET /api/v1/art/album
did its MusicBrainz + Cover Art Archive work synchronously inside the
request (2-12+ seconds per call, measured). A page with several
uncached albums could tie up the entire application - every endpoint,
every user - for as long as that took. Separately, even an
already-resolved album re-streamed its image bytes live from Cover
Art Archive on every single page view, by the original v1 design.

The endpoint is now cache-only: it reads the album_art table and, if
resolved, a local file, and never touches the network. A cache miss
records a "pending" row and returns 404 immediately - the frontend
already treats 404 as "show the placeholder," so no frontend changes
are needed. A new background worker task (the same claim-with-
FOR-UPDATE-SKIP-LOCKED pattern already used by imports and federation
deliveries) does the actual resolving and downloads the image bytes
to a shared volume, completely decoupled from any request. No
migration needed: AlbumArt.status just gains a new "pending" value.

Verified against the real docker compose stack (not just the test
suite): cold lookups for 5 real albums all returned 404 in well under
0.2s (previously 2-12+s each), the worker resolved all 5 within ~10s
in the background, and resolved art then served in single-digit
milliseconds from the volume, including after a full container
restart (no re-download).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Hn2QwS1HRT8tFAzo8ew63
2026-10-06 21:27:50 +01:00
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