refactor: whitespace

This commit is contained in:
Greg Heartsfield 2023-07-03 10:35:51 -05:00
parent dad6911807
commit 9e22776227
4 changed files with 9 additions and 10 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
**/target/ **/target/
nostr.db nostr.db
nostr.db-* nostr.db-*
justfile justfile

View File

@ -203,7 +203,7 @@ reject_future_seconds = 1800
#api_secret = "<ln bits api>" #api_secret = "<ln bits api>"
# Nostr direct message on signup # Nostr direct message on signup
#direct_message=true #direct_message=true
# Terms of service # Terms of service
#terms_message = """ #terms_message = """

View File

@ -22,12 +22,12 @@ api_secret = "<LNbits api key>"
# Terms of service # Terms of service
terms_message = """This service .... terms_message = """This service ....
""" """
# Whether or not new sign ups should be allowed # Whether or not new sign ups should be allowed
sign_ups = true sign_ups = true
secret_key = "<nostr secret key to send dms>" secret_key = "<nostr secret key to send dms>"
``` ```
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 ## Design Overview
@ -54,7 +54,7 @@ Invoice information is stored in a dedicated table. This tracks:
* `created_at` timestamp of creation * `created_at` timestamp of creation
* `confirmed_at` timestamp of payment * `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. 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 *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. *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. *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.

View File

@ -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` 2. `sudo cp config.toml /etc/nostr-rs-relay`
### Create the Systemd service file ### 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` 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. 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 ### Tips
#### Logs #### Logs
The application will write logs to the journal. To read it, execute `sudo journalctl -f -u nostr-rs-relay` The application will write logs to the journal. To read it, execute `sudo journalctl -f -u nostr-rs-relay`