this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

README improvements

alice abd7a8dd 3dd3887e

+28 -25
+4 -4
.env.example
··· 1 - DID=did:plc:foobarbaz 2 - SIGNING_KEY=randomnumbersandletters123 3 - BSKY_IDENTIFIER=mylabeler.bsky.social 4 - BSKY_PASSWORD=hunter2 1 + DID=did:plc:xxx 2 + SIGNING_KEY=xxx 3 + BSKY_IDENTIFIER=xxx 4 + BSKY_PASSWORD=xxx 5 5 PORT=4002 6 6 METRICS_PORT=4102 7 7 FIREHOSE_URL=wss://jetstream.atproto.tools/subscribe
+24 -21
README.md
··· 1 - ## Configuration 1 + ## Prerequisites 2 2 3 - Run `npx @skyware/labeler setup` to convert an existing account into a labeler. 3 + - [Node.js](https://nodejs.org/) 21 or later 4 + - [Bun](https://bun.sh/) 5 + 6 + ## Setup 7 + 8 + Clone the repo and run `bun i` to install the dependencies. This project uses [Bun](https://bun.sh/) for package management. 9 + 10 + Run `bunx @skyware/labeler setup` to convert an existing account into a labeler. You can exit after converting the account; there's no need to add the labels with the wizard. We'll do that from code. 4 11 5 12 Copy the `.env.example` file to `.env` and fill in the values: 6 13 7 14 ```Dotenv 8 - DID = "did:plc:xxx" 9 - SIGNING_KEY = "xxx" 10 - BSKY_IDENTIFIER = "xxx" 11 - BSKY_PASSWORD = "xxx" 12 - PORT = 4002 13 - FIREHOSE_URL = "ws://localhost:6008/subscribe" 15 + DID=did:plc:xxx 16 + SIGNING_KEY=xxx 17 + BSKY_IDENTIFIER=xxx 18 + BSKY_PASSWORD=xxx 19 + PORT=4002 20 + METRICS_PORT=4102 21 + FIREHOSE_URL=wss://jetstream.atproto.tools/subscribe 22 + CURSOR_UPDATE_INTERVAL=10000 14 23 ``` 15 24 16 - A `cursor.txt` also needs to be present with the time in microseconds. If it doesn't exist, it will be created with the current time. 25 + A `cursor.txt` file containing the time in microseconds also needs to be present. If it doesn't exist, it will be created with the current time. 17 26 18 - You can create/update all labels at once by running `npx tsx src/set-labels.ts` once you filled out `src/constants.ts` with the related post rkeys, label IDs and so on. 27 + Fill out `src/constants.ts` with the related post rkeys ([record keys](https://atproto.com/specs/record-key)), label IDs and so on, then run `bunx tsx src/set-labels.ts` to create/update all labels at once. 19 28 20 - Alternatively, you can use `npx @skyware/labeler label add` and edit `src/constants.ts` after. 29 + Alternatively, use `bunx @skyware/labeler label add` and edit `src/constants.ts` after. 21 30 22 - The server connects to [Jetstream](https://github.com/ericvolp12/jetstream) which provides a WebSocket endpoint that emits ATProto events in JSON. There is a public instance available at `wss://jetstream.atproto.tools/subscribe`. 31 + The server connects to [Jetstream](https://github.com/bluesky-social/jetstream), which provides a WebSocket endpoint that emits ATProto events in JSON. There is a public instance available at `wss://jetstream.atproto.tools/subscribe`. 23 32 24 - The server has to be reachable outside your local network using the URL you provided during the account setup (typically, using a reverse proxy such as [Caddy](https://caddyserver.com/)): 33 + The server needs to be reachable outside your local network using the URL you provided during the account setup (typically using a reverse proxy such as [Caddy](https://caddyserver.com/)): 25 34 26 35 ```Caddyfile 27 36 labeler.example.com { ··· 29 38 } 30 39 ``` 31 40 32 - ## Installation & Usage 41 + Metrics are exposed on the defined `METRICS_PORT` for [Prometheus](https://prometheus.io/). [This dashboard](https://grafana.com/grafana/dashboards/11159-nodejs-application-dashboard/) can be used to visualize the metrics in [Grafana](https://grafana.com/grafana/). 33 42 34 - ```sh 35 - pnpm i 36 - ``` 37 - 38 - ```sh 39 - pnpm start 40 - ``` 43 + Start the project with `bun run start`.