The Sonda web app on an album page: the cover of Absolute Elsewhere by Blood Incantation, the two songs of the album and the player bar at the bottom

The first picture is an album from my own library. The pictures below come from a demo library that is made up: generated tones tagged with invented artists, albums and titles.

Sonda is a music server I am writing in Go. It plays the music you already own, from your own disks, in a browser, on a phone, or in any app that speaks OpenSubsonic. The first commit is from 11 November 2026 and, as I write this, it is at version 0.4.2. It is early. The code is at git.kmalloc.org/squid/sonda.

The title needs a correction right away. Sonda does keep a listening history: without one there are no mixes, no “you have not played this for a while”, no suggestions. What it does not do is tell anyone. This post is about that line: what the server learns, where it is stored, what can leave the machine, and how that shaped the code.

The rule

The rule is in the product notes of the project:

Nothing leaves the server unless an admin turns a provider on, and each provider says in plain words what it is sent.

Privacy is a rule of the product, not a setting. A fresh install makes no outbound network request at all.

What it learns

A music server that makes mixes has to learn something. This is the whole list.

  • Listen events. A row has the user, the song, the time, how long it was played, and one of three types: play, complete or skip. Streaming is not listening: opening or prefetching an audio URL records nothing. The player reports one event per play, when the play ends or is abandoned.
  • What counts. An event counts as a listen when it is complete, or when it lasted at least 20 seconds. The rule is applied when the history is read, not when it is written, so changing the number re-reads the past.
  • What you mark. Favourites, playlists, a wishlist of artists, and the artists you said you are not interested in.
  • Which artists you play together. The history is split into sittings (plays less than 30 minutes apart), and two artists that often share a sitting are linked. This one is kept in tables, but only as a cache: it can be dropped and built again from the events.

Your taste is not in that list, because it is not stored. It is worked out on every request from the rows above: a complete listen counts more than a short one, a skip counts against the artist, and a listen weighs half as much after 90 days. The storage interface of that package can only read.

There is also an import of a Spotify data export. Of each play it reads the song, the artist, the album, the time and how it ended. It never reads the IP addresses, the country or the platform that are in the same file, and the files are not kept. Of a play of an artist you have no music of, it keeps the name of the artist and the time, and nothing else.

Everything it learned is on a page you can open.

The History page: one bar for each month of the year, and the listens of November listed by day with time, song and artist

The History page. Nobody else on the server can see it.

Where it is stored

In one database. SQLite by default, which means one file, or PostgreSQL if you prefer. Next to it there is a data folder with things that are built from your music, like the scaled covers, and that can be deleted. There is no Redis, no message broker and no cloud account.

A few more things belong here:

  • Your music folders are only read. Sonda never writes or renames a file. The one exception is deleting the extra copies of a duplicate song, which is off until you turn it on in the config.
  • The request log has the method, the path, the status and the time it took. No headers, no query strings, no bodies.
  • File paths are never returned by the catalog.

And three things that make a backup of the database a secret:

  • The API keys of the providers are in the database in clear text. The API never returns them and the log never prints them, but they are in the file.
  • The same goes for the Mastodon token of a user who connected an account.
  • The passwords you make for other apps are sealed with a key derived from the server secret, not hashed. Subsonic’s token login needs the server to know the password itself.

What can leave

With nothing turned on: nothing. The web app is served by the server and talks only to it. No CDN, no external fonts, no analytics, and a Content-Security-Policy with connect-src 'self', so a page of the app cannot reach another host. The API documentation is a Swagger UI embedded in the binary. The service worker of the installed app keeps the files of the app and never anything from /api/.

Then there is the list of everything that can make an outbound call. All of it is off by default.

Providers, turned on by an admin, one by one:

  • Last.fm for similar artists and tags. It gets the name of the artist (or its MusicBrainz id) and your API key.
  • MusicBrainz for tags and for the link to Wikidata. It gets the MusicBrainz id of the artist.
  • Wikipedia (through Wikidata) for a short text about an artist, and Wikimedia Commons for a free photo.
  • The Cover Art Archive for the cover of an album whose files have no picture.
  • Lidarr, which is a server of your own. An admin can send it one artist, by MusicBrainz id.
  • Claude, from Anthropic, to give a playlist a name. It gets up to 5 genres and 8 artist names of that list. Without it, a local namer builds the name on the server.

None of them is ever sent your users, your listens or your file paths. All of them see the IP address of your server, because that is how a request works.

The Providers section of the admin area: Last.fm is off, and its card says which data it is sent and which it is never sent

Each provider has a card that says what it is sent.

Mastodon, connected by each person for themselves. Once you connect an account, each song that counts as a listen is posted as an unlisted status. This one is, by design, telling people what you play, and it does nothing until you connect an account.

Federation, turned on by an admin. Two Sonda servers can become friends, and the listeners of one can play the libraries the other chose to share. Requests are signed, the friend sees the other server and never the listener, and a friend’s song is never recorded as a listen.

The admin is not the only one who decides. Discover can start from the artists you pick, or from the artists you play most. The second way sends their names to Last.fm, so it is a switch that belongs to each person, and it starts off.

The Discover page: the tags and artists the server learned, and a switch, turned off, that says the names of the artists you play most would go to Last.fm

What the server learned, and the switch that would let part of it out.

How that shaped the code

These are the places where the rule shows in the code.

One door out. The package internal/providers/outbound is the HTTP client of the data providers: a plain GET with an identifiable User-Agent, no cookies, no Referer, no redirects, requests spaced out, retries with backoff, and a circuit breaker. The comment at its top still says it is the only way Sonda talks to the outside world. That was true on the first day. Lidarr, Claude, Mastodon and federation came later with their own clients, so today there are five doors, and I can still count them with one grep.

Ids, never guesses. MusicBrainz ids come from the tags of your files, read offline during the scan. Sonda never searches MusicBrainz for an artist by name, because a search returns look-alikes and picking one would be a guess. There is one exception, for the cover of an album with no id, and it takes a result only when MusicBrainz scores it 95 or more and title and artist match.

Work it out, do not store it. Taste, mixes and radio stations are computed when you ask. A smart playlist stores its rules, not its songs.

Everything fetched can be taken back. What a provider answered is kept with an expiry date, and one admin call removes everything that provider gave.

One program. SQLite and the tag reader (TagLib, compiled to WebAssembly) are inside the binary, with no CGO, and so is the web app.

Saying no in a protocol. OpenSubsonic has a call, getNowPlaying, that tells an app what the other users are playing. Sonda answers it with nothing.

One leak is documented, not closed: what Last.fm answers is cached in the shared database, so another user of the same server can see that someone looked up an artist, and when. Not who.

What it still lacks

  • Transcoding. An app always gets the original file.
  • Formats. Only MP3 and FLAC are read. Other audio files are counted as unsupported in the scan result instead of disappearing.
  • Ratings and ListenBrainz. Not there.
  • Encryption at rest. The history is rows in a database. Whoever can read that file can read it, and so can the admin of the server. Sonda protects you from the outside, not from the person who runs it.
  • HTTPS. It listens on localhost by default. Reaching it from other machines is the job of a reverse proxy.
  • A stable API. It may still change, and the web client is young.
  • A native Android app. There is a small one, a shell that opens the web app of your server, signed with a debug key and built by hand.

Trying it

It is one container, with your music mounted read-only:

docker pull git.kmalloc.org/squid/sonda:latest
(umask 077; echo "SONDA_JWT_SECRET=$(openssl rand -hex 32)" > sonda.env)
docker run -d --name sonda --env-file sonda.env \
  -p 127.0.0.1:8080:8080 \
  -v sonda-data:/data \
  -v /path/to/your/music:/music:ro \
  git.kmalloc.org/squid/sonda:latest

Then open http://127.0.0.1:8080, create the first account, which becomes the admin, and add /music as a library. The README has the rest, including the full list of what each provider is sent.

If you read that list and find something that leaves the server and that I did not write down, I want to know. Write below.

Thank you for reading this far.