···11-# skywatch-tools
11+# skywatch-automod
2233-This is a rewrite of the original skywatch-tools project in TypeScript. The original project was written in Bash. The purpose of this project is to automate the moderation by the Bluesky independent labeler skywatch.blue
33+Automated moderation tooling for the Bluesky independent labeler skywatch.blue. Monitors the Bluesky firehose and applies labels based on configured moderation rules.
4455-## Installation and Setup
55+## Setup
6677-To install dependencies:
77+Configure environment:
8899```bash
1010-bun i
1010+cp .env.example .env
1111+# Edit .env with your credentials and configuration
1112```
12131313-Modify .env.example with your own values and rename it to .env
1414+Required environment variables:
1515+- `BSKY_HANDLE` - Bluesky account handle
1616+- `BSKY_PASSWORD` - Account password
1717+- `MOD_DID` - Moderator DID
1818+- `OZONE_PDS` - Ozone PDS URL
1919+- `FIREHOSE_URL` - Jetstream firehose URL
2020+2121+Create cursor file (optional but recommended):
2222+2323+```bash
2424+touch cursor.txt
2525+```
2626+2727+## Running
2828+2929+Production:
14301531```bash
1616-bun run start
3232+docker compose up -d
1733```
18341919-To run in docker:
3535+Development mode with auto-reload:
20362137```bash
2222-docker build -pull -t skywatch-tools .
2323-docker run -d -p 4101:4101 skywatch-autolabeler
3838+docker compose -f compose.yaml -f compose.dev.yaml up
2439```
25402626-## Brief overview
4141+The service runs on port 4101 (metrics endpoint). Redis and Prometheus are included in the compose stack.
4242+4343+## Authentication
4444+4545+The application authenticates with Bluesky on startup and retries up to 3 times on failure. If all attempts fail, the application exits. Sessions are cached in `.session` (gitignored).
4646+4747+## Testing
4848+4949+```bash
5050+bun test # Watch mode
5151+bun test:run # Single run
5252+bun test:coverage # With coverage
5353+```
27542828-Currently this tooling does one thing. It monitors the bluesky firehose and analyzes content for phrases which fit Skywatch's criteria for moderation. If the criteria is met, it can automatically label the content with the appropriate label.
5555+## How It Works
29563030-In certain cases, where regexp will create too many false positives, it will flag content as a report against related to the account, so that it can be reviewed later.
5757+Monitors the Bluesky firehose via Jetstream and analyzes posts, profiles, and handles against configured moderation rules. When criteria are met, applies appropriate labels or creates moderation reports.
31583232-For information on how to set-up your own checks, please see the [developing_checks.md](./src/developing_checks.md) file.
5959+For developing custom checks, see [developing_checks.md](./rules/developing_checks.md).