install instructions

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin 2024-07-11 09:11:02 -07:00
parent c85f9cbc3d
commit 9af92bfca3

View file

@ -34,6 +34,28 @@ kinds = [30065, 1064]
[filters.protected_events] [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 ## Filters
You can use any of the builtin filters, or create your own! 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 $ ./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 [strfry]: https://github.com/hoytech/strfry
[nip70]: https://github.com/nostr-protocol/nips/blob/protected-events-tag/70.md [nip70]: https://github.com/nostr-protocol/nips/blob/protected-events-tag/70.md