···11DATABASE_URL=file:./label-watcher.db
22+# for the docker compose
33+# DATABASE_URL="file:/app/data/label-watcher.db"
24MIGRATIONS_FOLDER=drizzle
33-# Email sending: set RESEND_API_KEY to use Resend, or NOTIFY_SMTP_URL to use SMTP (one is required)
44-RESEND_API_KEYb=123
55+# Will always default to using resend if the API key is set
66+# RESEND_API_KEY=123
57NOTIFY_SMTP_URL=smtp://localhost:1025
68NOTIFY_SENDER_EMAIL=yougotmail@pdsmoover.com
79LOG_LEVEL=info
+14-8
README.md
···2233Subscribes 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.
4455-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).
55+The idea is we have some awesome labelers like [Blacksky's labeler](https://bsky.app/profile/moderation.blacksky.app), [Hailey's Labeler](https://bsky.app/profile/did:plc:saslbwamakedc4h6c5bmshvz), and [skywatch.blue](https://bsky.app/profile/skywatch.blue) 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).
6677I 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
889910101111# Setup
1212-Got 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
1212+Got some configs to setup. We use toml to config the PDSs and labelers. There is an example one at [settings.toml.example](./settings.toml.example). Here you can set
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.
1717+ - Should it subscribe to your PDS to auto pick up new accounts (cursor resume does not work for this since the startup backfill can usually handle most backfills)
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.
1919- 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
2121+ - Backfill (should mostly be supported in my test and does take a while to run)
2222+ - Which labels and which action to take when it is seen. Can set as many as you want, make sure to match it to the labeler key.
23232424-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). This sets up
2525+2626+- How to email the notifications. Either via Resend's API or a smtp url like the PDS supports
2727+- Email address the email comes from
2828+- database location
2929+- migrations folder
3030+- logs level
253126322733Can use pnpm or npm and run with
···2935pnpm i
3036pnpm run start
3137```
3232-or can use the docker compose file with
3838+or can use the docker compose file with. This will build and run label-watcher as a docker container. No release image yet.
3339```bash
3440docker compose up
3541```
+27
settings.toml.example
···4646# [labeler.hailey.labels.suss-handle-change]
4747# label_name = "suss-handle-change"
4848# action = "notify"
4949+5050+5151+# Bluesky example to be notify on their needs-review or !takedowns
5252+# This is what blocks users from their appview
5353+# [labeler.bluesky]
5454+# host = "mod.bsky.app"
5555+5656+# [labeler.bluesky.labels.spam]
5757+# label_name = "spam"
5858+# action = "notify"
5959+6060+# [labeler.bluesky.labels.needs-review]
6161+# label_name = "needs-review"
6262+# action = "notify"
6363+6464+# [labeler.bluesky.labels.takedown]
6565+# label_name = "!takedown"
6666+# action = "notify"
6767+6868+6969+# Blacksky example
7070+# [labeler.blacksky]
7171+# host = "mod.blackskyweb.xyz"
7272+7373+# [labeler.blacksky.labels.violence]
7474+# label_name = "violence"
7575+# action = "notify"
+2-2
src/handlers/handleNewLabel.ts
···7474 throw new Error(`Watched repo: ${watchedRepo.did} config not found`);
7575 }
76767777- logger.debug(
7777+ logger.info(
7878 { label: label.val, action: labelConfig.action },
7979 `Listed label: ${label.val} found added to ${watchedRepo.did}`,
8080 );
···251251 return;
252252 }
253253254254- logger.warn(
254254+ logger.debug(
255255 { label: label.val, action: labelConfig.action },
256256 "Listed label found but repo is not watched. Skipping",
257257 );