this repo has no description
1# supercell
2
3> A supercell is a thunderstorm characterized by the presence of a mesocyclone, a deep, persistently rotating updraft.
4
5Supercell is a lightweight and configurable atproto feed generator.
6
7# Configuration
8
9The following environment variables are used:
10
11* `HTTP_PORT` - The port to listen on for HTTP requests.
12* `EXTERNAL_BASE` - The hostname of the feed generator.
13* `DATABASE_URL` - The URL of the database to use.
14* `JETSTREAM_HOSTNAME` - The hostname of the JetStream server to consume events from.
15* `COMPRESSION` - Use zstd compression. Default `false`.
16* `ZSTD_DICTIONARY` - The path to the ZSTD dictionary to use. Required when compression is enabled.
17* `CONSUMER_TASK_ENABLE` - Whether or not to enable the consumer tasks. Default `true`.
18* `VMC_TASK_ENABLE` - Whether or not to enable the VMC (verification method cache) tasks. Default `true`.
19* `CACHE_TASK_ENABLE` - Whether or not to enable the cache tasks. Default `true`.
20* `CACHE_TASK_INTERVAL` - The interval to run the cache tasks. Default `3m`.
21* `CLEANUP_TASK_ENABLE` - Whether or not to enable the cleanup tasks. Default `true`.
22* `CLEANUP_TASK_INTERVAL` - The interval to run the cleanup tasks. Default `1h`.
23* `CLEANUP_TASK_MAX_AGE` - The maximum age of a post before it is considered stale and deleted from storage. Default `48h`.
24* `PLC_HOSTNAME` - The hostname of the PLC server to use for VMC tasks. Default `plc.directory`.
25* `FEEDS` - The path to the feeds configuration file.
26* `COLLECTIONS` - The collections to consume. Default `app.bsky.feed.post`.
27* `RUST_LOG` - Logging configuration. Defaults to `supercell=debug,info`
28
29The feed configuration file is a YAML file that contains the feeds to serve and how to match events to the feed. It supports a variable number of matchers with different rules. Matching is done in order and uses json path plus the matcher implementation.
30
31```yaml
32feeds:
33- uri: "at://did:plc:4acsffvbo4niovge362ptijz/app.bsky.feed.generator/3la5azib4xe2c"
34 name: "Smoke Signal Support"
35 description: "The Smoke Signal Support feed."
36 allow: ["did:plc:cbkjy5n7bk3ax2wplmtjofq2"]
37 deny: "at://did:plc:4acsffvbo4niovge362ptijz/app.bsky.feed.post/3la5bsyzj3j23"
38 matchers:
39 - path: "$.did"
40 value: "did:plc:tgudj2fjm77pzkuawquqhsxm"
41 type: equal
42 - path: "$.commit.record.facets[*].features[?(@['$type'] == 'app.bsky.richtext.facet#tag')].tag"
43 values: ["smoke", "signal"]
44 type: sequence
45 - path: "$.commit.record.facets[*].features[?(@['$type'] == 'app.bsky.richtext.facet#link')].uri"
46 value: "https://smokesignal.events/"
47 type: prefix
48 - path: "$.commit.record.embed.external.uri"
49 value: "https://smokesignal.events/"
50 type: prefix
51```
52
53The `equal` matcher performs an exact string match matched paths.
54
55The `prefix` matcher performs a prefix string match on matched paths. Given the value "foo bar baz", the following prefixes would match: "foo", "foo ", etc.
56
57The `sequence` matcher performs a sequence string match on matched paths. This is used to match a list of values in order making flexible ordered matching without needing regex or complex reverse lookups.
58
59Consider the example string "The quick brown fox jumps over the lazy dog". The following sequences would match:
60
61* "the" "quick"
62* "brown"
63* "brow" "fox" "lazy" "dog"
64* "the" "dog"
65
66JSONPath is a query language for JSON. When used with matchers, JSONPath will use all nodes as inputs and each matcher will match against any of the values.
67
68For example, the following json would match the `equal` matcher with both `$.text` and `$.tags.*`:
69
70```json
71{
72 "text": "foo",
73 "tags": ["foo", "bar"],
74}
75```
76
77The site [https://jsonpath.com/](https://jsonpath.com/) is a great resource for testing JSONPath queries.
78
79See the `config.example.yml` file for additional examples.
80
81# License
82
83This project is open source under the MIT license.
84
85Copyright (c) 2023 Astrenox Cooperative. All Rights Reserved.
86