From 9e22776227d30039458b698fd0eca21b179b453a Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Mon, 3 Jul 2023 10:35:51 -0500 Subject: [PATCH] refactor: whitespace --- .gitignore | 2 +- config.toml | 2 +- docs/pay-to-relay.md | 11 +++++------ docs/run-as-linux-system-process.md | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index d9f2b5d..d8e965e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ **/target/ nostr.db nostr.db-* -justfile \ No newline at end of file +justfile diff --git a/config.toml b/config.toml index b4f7dcc..ef5f68d 100644 --- a/config.toml +++ b/config.toml @@ -203,7 +203,7 @@ reject_future_seconds = 1800 #api_secret = "" # Nostr direct message on signup -#direct_message=true +#direct_message=true # Terms of service #terms_message = """ diff --git a/docs/pay-to-relay.md b/docs/pay-to-relay.md index b742959..12723dc 100644 --- a/docs/pay-to-relay.md +++ b/docs/pay-to-relay.md @@ -22,12 +22,12 @@ api_secret = "" # Terms of service terms_message = """This service .... """ -# Whether or not new sign ups should be allowed -sign_ups = true +# Whether or not new sign ups should be allowed +sign_ups = true secret_key = "" ``` -The LNBits instance must have a signed HTTPS a self signed certificate will not work. +The LNBits instance must have a signed HTTPS a self signed certificate will not work. ## Design Overview @@ -54,7 +54,7 @@ Invoice information is stored in a dedicated table. This tracks: * `created_at` timestamp of creation * `confirmed_at` timestamp of payment -### Event Handling +### Event Handling If "pay to relay" is enabled, all incoming events are evaluated to determine whether the author is on the relay's whitelist or if they have paid the admission fee and accepted the terms. If "pay per note" is enabled, there is an additional check to ensure that the author has enough balance, which is then reduced by the cost per note. If the author is on the whitelist, this balance check is not necessary. @@ -77,9 +77,8 @@ simply to demonstrate a mitigation is possible. *Mitigation*: Rate limit number of new sign ups -### Admitted Author Spamming +### Admitted Author Spamming *Threat*: An attacker gains write access by paying the admission fee, and then floods the relay with a large number of spam events. *Mitigation*: The attacker's admission can be revoked and their admission fee will not be refunded. Enabling "cost per event" and increasing the admission cost can also discourage this type of behavior. - diff --git a/docs/run-as-linux-system-process.md b/docs/run-as-linux-system-process.md index 1896825..6d9cf27 100644 --- a/docs/run-as-linux-system-process.md +++ b/docs/run-as-linux-system-process.md @@ -18,7 +18,7 @@ We want to place the nostr-rs-relay binary and the config.toml file where they b 2. `sudo cp config.toml /etc/nostr-rs-relay` ### Create the Systemd service file -We need to create a new Systemd service file. These files are placed in the `/etc/systemd/system/` folder where you will find many other services running. +We need to create a new Systemd service file. These files are placed in the `/etc/systemd/system/` folder where you will find many other services running. 1. `sudo vim /etc/systemd/system/nostr-rs-relay.service` 2. Paste in the contents of [this service file](../contrib/nostr-rs-relay.service). Remember to replace the `User` value with your own username. @@ -36,4 +36,4 @@ To get the service running, we need to reload the systemd daemon and enable the ### Tips #### Logs -The application will write logs to the journal. To read it, execute `sudo journalctl -f -u nostr-rs-relay` \ No newline at end of file +The application will write logs to the journal. To read it, execute `sudo journalctl -f -u nostr-rs-relay`