···11-# Label Watcher
22-33->WIP: Will share with a few people, and ofc it's public if you are reading this. But going run locally before telling the whole atmosphere about it and make a docker container
44-55-66-Does what it says. Watches for labels. Okay really it watches for labelers and labels you set. And if it sees a label applied to an account on the PDS it notifies you via email. And will one day do auto take downs as well.
11+# Label Watcher - PDS Moderation powered by labelers
7288-The idea is we have some awesome labelers like [skywatch.blue](https://bsky.app/profile/skywatch.blue) and [Hailey's Labeler](https://bsky.app/profile/did:plc:saslbwamakedc4h6c5bmshvz) that are doing an amazing job of catching troubled accounts that PDS admins may want to know if they are doing these things on their PDS. This gives an easy way to use these resources to help moderate your PDS. And once auto takedowns are added I think it will be great for PDSs that also run their own labeler to be able to issue takedowns from a manual label added via ozone.
33+Subscribes to multiple labelers that you set in your [settings.toml](settings.toml.example) along with which labels you would like to watch for. If it sees the label is applied to a user on one of the PDSs you configure it will take an action. Either notify you by email, or does an auto takedown of the account.
9455+The idea is we have some awesome labelers like [skywatch.blue](https://bsky.app/profile/skywatch.blue) and [Hailey's Labeler](https://bsky.app/profile/did:plc:saslbwamakedc4h6c5bmshvz) that are doing an amazing job of moderating already, but we do not have a way as PDS admins to be able to use these labels in an easy way. The hope is that this gives an easy way to use these resources to help moderate your PDS. Pick your labelers to subscribe to and which labels from it you would like to to watch for. Then set an action like notify to get an email when a label is applied to an account on your PDS, or can even do an auto takedown of the account(beta and recommend trying the notify action first to get a hang of what accounts gets the label you expect).
10677+I think it will be great for PDSs that also run their own labeler to be able to issue a label for takedowns allowing moderates of an org to have the ability to remotely do takedowns with out the need of the PDS admin password. Should also work at catching bot accounts since the labelers have gotten very good at it
11812913101411# Setup
1512Got some configs to setup. Use toml to set it up and have an example one at [settings.toml.example](./settings.toml.example). Here you can set
1616-- Which PDSs to follow
1313+- PDSs settings
1414+ - Can set the watch for multiple PDSs
1515+ - An array of email addresses to send the notifications to
1616+ - On startup should it query your PDS to find all the active accounts and add them to the watch list
1717+ - Should it subscribe to your PDS to auto pick up new accounts (cursor resume does not work for this)
1818+ - Admin password. This is the keys to your PDS so please use this with caution. label watcher does not require this. But it is needed for auto takedowns.
1719- Which labelers and labels
2020+ - Can set multiple labelers
2121+ - Backfill (should mostly be supported in my test)
2222+ - Which label and which action to take when it is seen
18231919-Also have a .env for some shared secrets at [.env.example](.env.example)
2424+Also have a .env for some shared secrets at [.env.example](.env.example).
202521262222-Can use pnpm or npm and just do
2727+Can use pnpm or npm and run with
2328```bash
2429pnpm i
2530pnpm run start
2631```
3232+or can use the docker compose file with
3333+```bash
3434+docker compose up
3535+```
3636+3737+# How do I find the labeler info?
3838+1. Find a labeler you like. Like [@skywatch.blue](https://bsky.app/profile/skywatch.blue)
3939+2. Resolve it's did doc or use one of the atproto browsers to get the `atproto_labeler` service endpoint. sky watches is `https://ozone.skywatch.blue/` so `ozone.skywatch.blue` is the host
4040+3. Each labeler has a record at `app.bsky.labeler.service` with a rkey of self. Like [here](https://blewit.us-west.host.bsky.network/xrpc/com.atproto.repo.getRecord?repo=did:plc:e4elbtctnfqocyfcml6h2lf7&collection=app.bsky.labeler.service&rkey=self).
4141+4. The label values are found under policies -> labelValues. We are going to use `bluesky-elder` as an example and set an action of `notify`.
4242+4343+Put it all together it looks like this
4444+```toml
4545+# Define the labeler
4646+[labeler.skywatch]
4747+host = "ozone.skywatch.blue"
4848+# Set if you want to replay labels. Takes a minute, or a few...
4949+# backfillLabels = true
5050+5151+# Notifies if an account has the bluesky-elder label applied
5252+[labeler.skywatch.labels.bluesky-elder]
5353+label_name = "bluesky-elder"
5454+action = "notify"
5555+5656+#Repeat the last one for as many labels as you want
5757+```
275828592960# Features
···3869## Labeler
3970- Can subscribe to labels from a labeler. Multiple of each set up in the settings.toml
4071- Does support backfilling of labels via the cursor on restart so you do not miss any
4141-- Will support full backfill at some point
4242-- Can give each label an action like notify or takedown (will come later). It will take the action and send you an email
7272+- Should support full backfill if set
7373+- Can give each label an action like notify or takedown. It will take the action and send you an email
7474+- Auto takedowns are still new and should expect possible bugs. Takedowns have been reservable in my experience, but I highly recommend to start with notify first and do manual takedowns when needed while you find what labels work.
7575+- During auto takedowns if a label is negated(reversed) the takedown is also reversed
7676+7777+7878+# Future features?
7979+Not sure. Playing around with making a UI possibly, maybe even a multi instance that others can sign up for and not have to host?
+21
settings.toml.example
···1111# Listens for new accounts
1212listenForNewAccounts = true
13131414+# Another PDS you want to watch
1515+# [pds.your-pds-two]
1616+# host = "your-pds-two.com"
1717+# notifyEmails = ["admin@example.com", "another@example.com"]
1818+# # Will be used for auto take downs on down the road
1919+# pdsAdminPassword = "secure"
2020+# # Loads all the historic accounts in
2121+# backfillAccounts = true
2222+# # Listens for new accounts
2323+# listenForNewAccounts = true
2424+14251526# Define the labeler. Can do multiple labelers
1627[labeler.skywatch]
···2536[labeler.skywatch.labels.platform-manipulation]
2637label_name = "platform-manipulation"
2738action = "notify"
3939+4040+4141+# Define another labeler
4242+# [labeler.hailey]
4343+# host = "ozone.hailey.at"
4444+4545+#
4646+# [labeler.hailey.labels.suss-handle-change]
4747+# label_name = "suss-handle-change"
4848+# action = "notify"