sonda/migrations/postgres
Repository files (latest commit first)
Filename Latest commit message Latest commit date
tgiachi 89826fcd07 feat(federation): shared libraries and the signed read API for friends
A friend's server can now read what an admin chose to share.

- A library has a shared flag, off by default (migration 0024), set with
  PATCH /libraries/{id}. Changing it never waits for a scan.
- Requests between friends are signed with each server's Ed25519 key: the
  method, the path and query from /api/v1/peer on, a date, a nonce and the
  hash of the empty body. A date more than two minutes off, a nonce used
  before, an unknown or removed key and a bad signature all get the same
  401. A friend still waiting for approval gets 403, and while federation is
  off the routes are missing.
- Routes under /api/v1/peer: info, artists, albums, tracks, covers and
  streaming with Range. The catalogue, the counts and the format come from
  the shared libraries only, and the file served is the one in a shared
  library. No path, library id, listen, taste, user or provider data is part
  of an answer.
- A friend never makes this server build a cover, read an audio file or ask
  a provider: only covers already built from the audio files are served.
- Per-friend limits, set by the admin: parallel streams (default 3) and KiB
  a second (default 4096, 0 for none), shared by all the streams of a friend.
- A log of the last requests friends made (route, status, bytes; never the
  query), kept for 7 days, in GET /federation/requests.
- POST /federation/friends/{id}/check lets the side that pasted an invite
  find out that the other admin approved; a signed call from a friend this
  server is waiting for makes it active too.
- Admin: a Shared with friends switch on each library, which asks first, and
  limits, recent requests and a Check button in the Federation section, in
  English and Italian.
- OpenAPI paths and schemas, contract test, two real servers checked end to
  end with tagged audio files.
2026-11-13 15:04:07 +01:00
..
0001_init.sql feat: add sondad server with config, storage, auth and listening API 2026-11-11 12:06:15 +01:00
0002_users_listening.sql feat: add sondad server with config, storage, auth and listening API 2026-11-11 12:06:15 +01:00
0003_name_keys.sql fix(library): harden the scanner against special files, stat errors and lossy logging 2026-11-11 12:28:44 +01:00
0004_admin_refresh.sql feat(auth): add refresh tokens, admin role and user management 2026-11-11 12:38:42 +01:00
0005_libraries.sql fix(library): make the libraries upgrade and validation robust 2026-11-11 13:34:44 +01:00
0006_track_title_key.sql feat(catalog): add the read API for artists, albums and tracks 2026-11-11 13:43:38 +01:00
0007_provider_settings.sql feat(providers): provider settings in a table and a careful outbound HTTP client 2026-11-11 16:07:12 +01:00
0008_artist_similar.sql fix(discovery): concurrent writes, adopted artists and a client that leaves 2026-11-11 16:47:33 +01:00
0009_artist_tags.sql feat(discovery): artist tags from Last.fm and MusicBrainz, and ids from my files 2026-11-11 17:01:43 +01:00
0010_track_genres.sql feat(discovery): remove provider data, genres from my files, full rescans 2026-11-11 17:27:29 +01:00
0011_user_settings.sql feat(settings): my own settings, starting with Discover from my listening 2026-11-11 19:16:26 +01:00
0012_artist_feedback.sql feat(feedback): a wishlist and "not interested" 2026-11-11 20:11:18 +01:00
0013_images.sql fix(images): limit parallel builds, no stale saves, safer files 2026-11-11 21:03:26 +01:00
0014_artist_descriptions.sql feat(about): artist descriptions from Wikipedia 2026-11-11 21:36:27 +01:00
0015_image_credit.sql feat(images): free photos of artists from Wikimedia Commons 2026-11-11 22:03:32 +01:00
0016_search_keys.sql feat(search): search ignores accents 2026-11-12 10:17:21 +01:00
0017_lidarr_settings.sql feat(lidarr): set up Lidarr as a provider and read what it offers 2026-11-12 11:04:53 +01:00
0018_users_email.sql feat(auth): accounts are identified by an email address 2026-11-12 14:40:33 +01:00
0019_playlists.sql feat(playlists): a user keeps playlists of tracks 2026-11-12 16:55:25 +01:00
0020_smart_playlists.sql feat(smart): smart playlists, playlists made of rules 2026-11-13 09:36:52 +01:00
0021_generated_names.sql feat(naming): names for playlists, with the Claude API as an option 2026-11-13 10:33:48 +01:00
0022_claude_usage.sql feat(naming): an admin section that shows what Claude costs 2026-11-13 11:14:45 +01:00
0023_federation.sql feat(federation): keys, invites and pairing between Sonda servers 2026-11-13 14:43:48 +01:00
0024_federation_sharing.sql feat(federation): shared libraries and the signed read API for friends 2026-11-13 15:04:07 +01:00