hello! i made an internet radio server. https://radio.wisp.place
1
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
people can sign in with atproto oauth, listen to whatever is currently playing, and complain in chat when i put the same album on again.
2
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
running one radio station is easy enough.
3
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the slightly more interesting problem begins when someone else runs one.
4
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
i wanted radio stations to be independently hosted. each station should own its own songs, playback state, queue, chat, moderation, and database. an operator should be able to download the server, point a domain at it, and become another station in the network without asking me f…
5
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
29
byteStart
0
features
0
$type
pub.leaflet.richtext.facet#italic
plaintext
> where are all the stations?
6
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the boring answer is that i operate a canonical directory and station operators submit their urls to me.
7
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the even more boring answer is that i put a list of stations in a json file and update it whenever somebody asks nicely.
8
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
neither of these is especially terrible. nearly every small federated project begins with a manually maintained list somewhere. unfortunately, i was already using atproto, which meant i was obligated to make the problem substantially stranger.
9
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.header
level
2
facets
0
index
byteEnd
44
byteStart
0
features
0
$type
pub.leaflet.richtext.facet#bold
plaintext
## the usual shape of an atproto application
10
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
a common atproto application has three major parts: users with repositories hosted on pdses, a relay aggregating repository events from those pdses, and an appview indexing that data into something clients can efficiently query.
11
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
in theory, there can be many competing appviews. a user should not be permanently tied to one company’s index, moderation system, algorithms, or client.
12
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
181
byteStart
171
features
0
uri
https://wisp.place
$type
pub.leaflet.richtext.facet#link
plaintext
in practice, applications often develop one appview which nearly every client uses. the protocol is decentralized, but the application still ends up with a center. my own wisp.place ended up this way too.
13
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
projects such as blacksky and tangled are demonstrating that alternative appviews and infrastructure are possible. they are also demonstrating how much work it takes.
14
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
a serious appview needs to ingest the network, maintain a large index, implement the application’s semantics, deal with moderation, survive malformed records, and remain compatible with clients people already use.
15
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
i did not want to build one of those.
16
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
more importantly, i did not actually want the radio to have the usual atproto shape at all.
17
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the songs do not belong to the listeners. the queue does not belong to the listeners. the chat history, playback clock, moderation state, audio files, and playlists do not belong in a hundred unrelated user repositories.
18
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
they belong to the station.
19
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
so what happens if we invert the architecture?
20
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
instead of one large service collecting records from many users, imagine many small services which clients can automatically discover and connect to.
21
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
each service keeps its authoritative state in its own database, exposes its own api, and operates independently. atproto is used only for the narrow parts it is especially good at: authenticated identity, signed metadata, discovery, and distribution.
22
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
this is entirely protocol-compliant and spiritually improper.
23
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
evil atproto.
24
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.header
level
2
facets
0
index
byteEnd
38
byteStart
0
features
0
$type
pub.leaflet.richtext.facet#bold
plaintext
## putting a tiny pds inside the radio
25
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
every station embeds a tiny, read-only atproto pds.
26
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
calling it a pds makes it sound more impressive than it really is.
27
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
it does not host user accounts. it does not accept arbitrary writes. it does not contain the station’s song library or chat history. it serves one repository belonging to the station’s service did, containing one record:
28
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.code
language
rust
plaintext
pet.nkp.radio.station/self
syntaxHighlightingTheme
gruvbox-dark-soft
29
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
conceptually, the record looks something like this:
30
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.code
language
json
plaintext
{
"$type": "pet.nkp.radio.station",
"url": "https://radio.example.com",
"name": "example radio",
"description": "music transmitted directly into your brain",
"updatedAt": "2026-07-15T12:00:00Z"
}
syntaxHighlightingTheme
gruvbox-dark-soft
31
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the repository is signed by the station’s own key. the public key is exposed through the station’s did document, so infrastructure crawling the station can verify that the repository and its station record actually belong to that service. the station implements the small subset o…
32
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
85
byteStart
25
features
0
uri
https://blog.stream.place/3lut7mgni5s2k
$type
pub.leaflet.richtext.facet#link
plaintext
the idea was inspired by stream.place’s embedded pds for publishing lexicon records. once i saw that a service could contain a tiny repository without becoming a conventional account-hosting pds, the radio version felt fairly natural. the repository is not the source of truth for…
33
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
again, evil atproto.
34
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
this separation is the important part.
35
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
atproto records are good at saying:
36
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
86
byteStart
0
features
0
$type
pub.leaflet.richtext.facet#italic
plaintext
> this service exists, it is controlled by this did, and this is how to connect to it.
37
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
they do not also need to say:
38
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
150
byteStart
0
features
0
$type
pub.leaflet.richtext.facet#italic
plaintext
> here is every song, queue mutation, chat message, listener heartbeat, and playback timestamp the service has ever produced. feel free to dmca me!!!!
39
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the first is durable public information which benefits from signing, replication, and discovery.
40
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the second is high-volume, application-specific operational state which is more naturally handled by the station itself.
41
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the important idea is not that every application should secretly contain a tiny pds. it is that an atproto repository can describe an independently operated service without becoming that service’s entire storage model.
42
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.header
level
2
facets
0
index
byteEnd
30
byteStart
0
features
0
$type
pub.leaflet.richtext.facet#bold
plaintext
## now somebody has to find it
43
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
unfortunately, embedding a repository does not cause relays to psychically detect the hostname.
44
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
a new station still needs some way to enter the network.
45
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
when the radio server starts, it sends a standard `com.atproto.sync.requestCrawl` request to one or more configured relays or syndication workers:
46
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.code
language
json
plaintext
{
"hostname": "radio.example.com"
}
syntaxHighlightingTheme
gruvbox-dark-soft
47
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the request contains almost nothing. the hostname is enough to bootstrap everything else.
48
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
from there, the receiver can resolve the station’s identity, connect to its atproto endpoints, and retrieve or follow the repository containing the station record. the station now looks like another source of repository events. a general-purpose relay can carry its commits. a rad…
49
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
25
byteStart
0
features
0
$type
pub.leaflet.richtext.facet#bold
plaintext
## the syndication worker
50
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
i wrote a syndication worker which watches for station records and exposes them to clients and its api is quite fucking huge, see:
51
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.code
language
json
plaintext
GET /stations
GET /stations/{did}
POST /xrpc/com.atproto.sync.requestCrawl
syntaxHighlightingTheme
gruvbox-dark-soft
52
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
i joke. the worker does not ingest the actual radio application state. it does not mirror songs, audio, playlists, chat messages, queues, or playback events. it stores enough information to identify a station, checks whether that station is alive, and exposes the healthy ones thr…
53
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
a standalone frontend asks the worker for the current directory and after the user chooses a station, the frontend communicates directly with it. the worker is not in the playback path. it does not proxy audio. it does not own the chat connection. it does not become the permanent…
54
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
a frontend can consult several workers, use a hardcoded station directly, or let the user enter a url.
55
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
of course, if every client uses one public worker operated by me, then congratulations: i have recreated a central service with extra steps and i solved nothing, but at least its a very thin rust worker that is easily replaceable.
56
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.header
level
2
facets
0
index
byteEnd
24
byteStart
0
features
0
$type
pub.leaflet.richtext.facet#bold
plaintext
## cheating with hydrant
57
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the worker does not implement atproto repository synchronization itself.
58
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
doing that would involve discovering pdses, consuming firehoses, resolving identities, fetching missing repositories, validating commits, handling backfills, persisting records, managing cursors, and keeping all of this synchronized without inventing a new and exciting form of da…
59
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
26
byteStart
19
features
0
uri
https://hydrant.klbr.net/
$type
pub.leaflet.richtext.facet#link
plaintext
instead, it embeds hydrant.
60
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
hydrant is a rust atproto indexer built on the fjall key-value database. it can consume firehoses, crawl and backfill repositories, persist records, and produce an ordered, replayable stream of record events. it can run as a standalone service, but it can also be used as a librar…
61
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
that last part is extremely cool.
62
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
rather than operating a generic indexer beside the syndication worker and making the two communicate over http, the worker constructs hydrant directly inside its own process. hydrant handles the miserable protocol-shaped parts of indexing atproto. the worker implements the tiny a…
it does not need to ingest the entire atproto network. it is interested in exactly one collection and can discard everything else. when a station calls `com.atproto.sync.requestCrawl`, the worker validates and rate-limits the hostname, then hands the station’s websocket endpoint …
66
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the radio-specific portion of the worker is basically a projection over that stream:
67
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.code
language
rust
plaintext
hydrant record event
│
│ collection == pet.nkp.radio.station
▼
validate station record
│
├── create/update → add it to the directory
├── delete → remove it from the directory
└── inactive repo → remove it from the directory
syntaxHighlightingTheme
gruvbox-dark-soft
68
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the worker does not ask hydrant to understand radio stations. hydrant understands dids, repositories, commits, records, cursors, firehoses, crawling, and backfills. the worker understands that a `pet.nkp.radio.station` record should become an entry in `/stations`. it also perform…
69
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
hydrant is therefore not quite the radio appview by itself. it is the generic indexing engine underneath one. the thin layer which decides that a valid, healthy station record belongs in `/stations` is the application-specific appview.
70
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
hydrant is then maybe an evil appview as a library.
71
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.header
level
2
facets
0
index
byteEnd
23
byteStart
0
features
0
$type
pub.leaflet.richtext.facet#bold
plaintext
## what i find fun here
72
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
what is created here is different from most atproto applications where the station operators, rather than the listeners, own the repositories. the records describe services rather than user-generated objects. most application data remains outside the protocol. and clients use ind…
73
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
atproto is merely just for federation here and not the driving force for everything going on. i think this is how you can fit atproto into much more than social media. a record could advertise a game server, collaborative editor, search engine, community archive, model inference …
74
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the protocol does not need to become the application. sometimes it can simply help the application’s participants find one another.
75
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.header
level
2
plaintext
host your own radio
76
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
anyway, you can run one of these yourself.
77
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
66
byteStart
32
features
0
uri
https://tangled.org/okami.mom/sister-radio
$type
pub.leaflet.richtext.facet#link
1
index
byteEnd
98
byteStart
70
features
0
uri
https://github.com/waveringana/radio
$type
pub.leaflet.richtext.facet#link
plaintext
the source code is available at tangled.org/okami.mom/sister-radio or github.com/waveringana/radio. a self-hosted station gets its own song library, queue, chat, moderation, embedded pds, and deeply irresponsible amount of control over what everyone listening has to hear.
78
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
to install the dependencies:
79
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.code
language
sh
plaintext
git clone https://github.com/waveringana/radio.git
cd radio
cp .env.example .env
npm --prefix frontend install
cargo check
syntaxHighlightingTheme
gruvbox-dark-soft
80
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the station needs to be publicly reachable over normal https on a public domain. atproto relays and syndication workers must be able to connect to it, inspect its did document, and consume the embedded repository.
81
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
the easiest options are usually a reverse proxy such as caddy or nginx, or a cloudflare tunnel pointing at the radio server.
82
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
53
byteStart
49
features
0
$type
pub.leaflet.richtext.facet#code
plaintext
once you have a public hostname, configure it in .env:
SERVICE_DID identifies the station and must correspond to the hostname serving its did document. STATION_URL is the endpoint advertised in the station record. ADMIN_DIDS is a comma-separated list of the atproto accounts allowed to upload music, manage the queue, moderate chat, an…
86
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
then build the frontend and start the server:
87
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.code
language
sh
plaintext
npm --prefix frontend run build
cargo run --release
syntaxHighlightingTheme
gruvbox-dark-soft
88
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
when the backend starts, it creates or loads its repository signing key, publishes the station record through its embedded pds, and announces its hostname to the configured syndication workers.
89
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
154
byteStart
138
features
0
uri
https://radio.wisp.place/
$type
pub.leaflet.richtext.facet#link
plaintext
after the worker crawls it and confirms that the health endpoint is alive, the station should automatically appear in directories such as radio.wisp.place.
90
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
you can also request a crawl manually (not necessary! the syn worker should pick it up when the backend sends a crawl request to fire.hose.cam):