Files
atproto-cosocial-labeler/README.md
T
govandClaude Opus 5.5 a7d410fd6d Canadian cities labeler over Bluesky DMs
Users DM @cities.pds.cosocial.ca their city and get a signed account label.
Serves com.atproto.label.queryLabels and subscribeLabels, built on jacquard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 16:33:19 -05:00

42 lines
1.5 KiB
Markdown

# cosocial cities labeler
An atproto labeler that puts a Canadian city badge on accounts that ask for one over Bluesky DMs.
1. Subscribe to `@cities.pds.cosocial.ca` (the Subscribe button on its profile).
2. Follow it.
3. DM it your city, e.g. `Halifax` or `Richmond, BC`. Send `remove` to clear it.
The labeler polls its DMs, matches the city against `data/cities.json`, and signs an account
label (e.g. `halifax-ns`), negating any previous one. Labels are stored in SQLite and served over
`com.atproto.label.subscribeLabels` and `queryLabels`.
```
src/
dms.rs DM polling, onboarding, replies
cities.rs city list and matching
labeler.rs set_city: negate the old label, apply the new one
labels.rs label signing
server.rs queryLabels + subscribeLabels (axum, jacquard-axum)
db.rs SQLite
bin/keygen.rs
```
Built on [jacquard](https://tangled.org/nonbinary.computer/jacquard) for atproto types and XRPC.
## Local test
```sh
cp .env.example .env # set LABELER_APP_PASSWORD
cargo run --bin keygen # paste SIGNING_KEY_HEX into .env
cargo run # :4100
```
`rust-toolchain.toml` pins the Rust version; rustup installs it on first build.
The labeler account must allow DMs from everyone (Settings → Privacy and security → Chat).
DM it from a test account, then check
`curl 'localhost:4100/xrpc/com.atproto.label.queryLabels?uriPatterns=<did>'`.
Labels won't appear in the Bluesky app until the labeler is deployed publicly and its DID
document has the `#atproto_label` key and `#atproto_labeler` service.