noteguard

the nostr relay spam guardian
git clone git://jb55.com/noteguard
Log | Files | Refs | README | LICENSE

commit 9af92bfca382af3c3bcc4ed616a412f55a0f9917
parent c85f9cbc3df487ed9ec00c0bbee5a8b0f89d3f77
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 11 Jul 2024 09:11:02 -0700

install instructions

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
MREADME.md | 34++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md @@ -34,6 +34,28 @@ kinds = [30065, 1064] [filters.protected_events] ``` +## Installation + +You can install noteguard by copying the binary to the strfry directory. + +Static musl builds are convenient ways to package noteguard for deployment. It enables you to copy the binary directly to your server, assuming its the same architecture as the one you're building on. + +```sh +$ rustup target add x86_64-unknown-linux-musl +$ cargo build --target x86_64-unknown-linux-musl --release +$ scp ./target/x86_64-unknown-linux-musl/release/noteguard server:strfry +$ scp noteguard.toml server:strfry +``` + +You can then setup your `strfry.conf` to use the noteguard by adding it as a writePolicy plugin: + +``` +writePolicy { + # If non-empty, path to an executable script that implements the writePolicy plugin logic + plugin = "./noteguard" +} +``` + ## Filters You can use any of the builtin filters, or create your own! @@ -105,17 +127,5 @@ $ <test/inputs ./target/debug/noteguard $ ./test/delay | ./target/debug/noteguard ``` -## Static builds - -Static musl builds are convenient ways to package noteguard for deployment. It enables you to copy the binary directly to your server, assuming its the same architecture as the one you're building on. - -```sh -$ rustup target add x86_64-unknown-linux-musl -$ cargo build --target x86_64-unknown-linux-musl --release -$ ldd ./target/x86_64-unknown-linux-musl/release/noteguard - statically linked -$ scp ./target/x86_64-unknown-linux-musl/release/noteguard server: -``` - [strfry]: https://github.com/hoytech/strfry [nip70]: https://github.com/nostr-protocol/nips/blob/protected-events-tag/70.md