Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0xtrr/chief
A writepolicy plugin for Strfry relays
https://github.com/0xtrr/chief
nostr nostr-relay plugin strfry
Last synced: about 2 months ago
JSON representation
A writepolicy plugin for Strfry relays
- Host: GitHub
- URL: https://github.com/0xtrr/chief
- Owner: 0xtrr
- Created: 2023-10-28T11:39:40.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-17T18:53:15.000Z (12 months ago)
- Last Synced: 2024-02-16T05:34:53.452Z (11 months ago)
- Topics: nostr, nostr-relay, plugin, strfry
- Language: Rust
- Homepage:
- Size: 31.3 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-nostr - Chief - A Strfry write policy plugin that provides blacklists for public keys, event kinds and words/sentences. (Tools / Client reviews and/or comparisons)
README
# Chief
Chief is a write policy plugin for [Strfry](https://github.com/hoytech/strfry) (which is a [nostr](https://github.com/nostr-protocol/nostr) relay software).
It enables relay operators to blacklist or whitelist public keys, event kinds and specific words or sentences using either
a JSON file or a postgresql database.## Setup
### Compile and configure
1. Compile from source
- Run `cargo build --release`.
2. Put the compiled binary where you want it to run from
- E.g. `sudo cp target/release/chief /usr/local/bin`.
3. Create a folder in `/etc` where your configuration files will live and copy the example config to that folder
1. `sudo mkdir /etc/chief/`
2. `sudo cp docs/examples/example-config.toml /etc/chief/config.toml`.
- This path is currently hardcoded and cannot be changed.
4. Configure strfry to use Chief as the write policy
- Under "relay.writePolicy", set the plugin to `/usr/local/bin/chief`
```
writePolicy {
# If non-empty, path to an executable script that implements the writePolicy plugin logic
plugin = "/usr/local/bin/chief"
}
```### Select a datasource
The datasource contains the public keys, kinds and/or words you want to either whitelist or blacklist.
This application supports two different datasources: a JSON file or a postgresql database.#### JSON
To use a JSON file as the datasource, please read [this document](docs/json_datasource.md).
#### Postgresql database
To use a postgresql database as the datasource, please read [this document](docs/postgresql_datasource.md).
### Filters
- Pubkey filter to blacklist or whitelist specific public keys
- Kinds filter to blacklist or whitelist specific note kinds
- Content filter to blacklist certain words and/or sentences
- Rate limiting filter to only allow a certain amount of events in a specific time period (measured in seconds)