Skip to content

Commit

Permalink
chore: sync upstream nostream code by 14bc96f
Browse files Browse the repository at this point in the history
  • Loading branch information
flxxyz committed May 16, 2023
1 parent ba873f4 commit 73d61c9
Show file tree
Hide file tree
Showing 22 changed files with 721 additions and 483 deletions.
1 change: 1 addition & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI Checks

on:
workflow_dispatch:
pull_request:
push:
branches:
Expand Down
86 changes: 49 additions & 37 deletions CONFIGURATION.md

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ Todo

## Full Guide

- [ ] Set up a paid Nostr relay

### Accepting payments

1. Zebedee

- You must set `ZEBEDEE_API_KEY` with an API Key from one of your projects in your Zebedee Developer Dashboard. Contact @foxp2zeb on Telegram or npub1rvg76s0gz535txd9ypg2dfqv0x7a80ar6e096j3v343xdxyrt4ksmkxrck on Nostr requesting access to
the Zebedee Developer Dashboard. See the Zebedee full guide on how to set up a paid relay.

2. Lnbits

- You must set `LNBITS_API_KEY` with an API Key from one of "Invoice/read key" in your wallet.

### Quick Start (Standalone)

Clone repository and enter directory:
Expand All @@ -95,6 +108,17 @@ WORKER_TYPE=worker
MONGO_URI=mongodb://user:pass@host:port/db?replicaSet=rs0&authSource=admin
```

Generate a long random secret and set SECRET:

You may want to use `openssl rand -hex 128` to generate a secret.

```ini
SECRET=aaabbbccc...dddeeefff
# Secret shortened for brevity
```

In addition, if using API Key for payments, You must also use the API key of each payment service to set the.

Create `.nostr` folder inside **denostr project folder** and copy over the settings file:

```sh
Expand Down
33 changes: 31 additions & 2 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

207 changes: 106 additions & 101 deletions deployment/maintenance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,30 @@ data:
name: "nostr relay by denostr"
description: Deno-based, cloud-native nostr implementation supported by ByteTrade and Revo, forked from nostream.
pubkey: replace-with-your-pubkey-in-hex
contact: [email protected]
contact: mailto:[email protected]
payments:
enabled: false
processor: zebedee
processor: lnbits
feeSchedules:
admission:
- enabled: false
description: Admission fee charged per public key in msats (1000 msats = 1 satoshi)
amount: 1000000
whitelists:
pubkeys:
- replace-with-your-pubkey-in-hex
# Allow the following Zap providers:
# LightningTipBot by Calle
- "fcd720c38d9ee337188f47aac845dcd8f590ccdb4a928b76dde18187b4c9d37d"
- enabled: false
description: Admission fee charged per public key in msats (1000 msats = 1 satoshi)
amount: 1000000
whitelists:
pubkeys:
- replace-with-your-pubkey-in-hex
event_kinds:
- 9735 # Nip-57 Lightning Zap Receipts
paymentsProcessors:
zebedee:
baseURL: https://api.zebedee.io/
callbackBaseURL: https://denostr.your-domain.com/callbacks/zebedee
callbackBaseURL: https://relay.your-domain.com/callbacks/zebedee
ipWhitelist:
- "3.225.112.64"
- "::ffff:3.225.112.64"
lnbits:
baseURL: https://lnbits.your-domain.com/
callbackBaseURL: https://denostr.your-domain.com/callbacks/lnbits
callbackBaseURL: https://relay.your-domain.com/callbacks/lnbits
network:
maxPayloadSize: 524288
# Comment the next line if using CloudFlare proxy
Expand All @@ -94,24 +93,24 @@ data:
limits:
invoice:
rateLimits:
- period: 60000
rate: 12
- period: 3600000
rate: 30
- period: 60000
rate: 12
- period: 3600000
rate: 30
ipWhitelist:
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
connection:
rateLimits:
- period: 1000
rate: 24
- period: 60000
rate: 72
- period: 1000
rate: 24
- period: 60000
rate: 72
ipWhitelist:
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
event:
eventId:
minLeadingZeroBits: 0
Expand All @@ -127,90 +126,96 @@ data:
maxPositiveDelta: 900
maxNegativeDelta: 0
content:
- description: 64 KB for event kind ranges 0-10 and 40-49
kinds:
- - 0
- 10
- - 40
- 49
maxLength: 65536
- description: 96 KB for event kind ranges 11-39 and 50-max
kinds:
- - 11
- 39
- - 50
- 9007199254740991
maxLength: 98304
- description: 100 KB for event kind ranges 0-10 and 40-49
kinds:
- - 0
- 10
- - 40
- 49
maxLength: 102400
- description: 100 KB for event kind ranges 11-39 and 50-max
kinds:
- - 11
- 39
- - 50
- 9007199254740991
maxLength: 102400
rateLimits:
- description: 30 events/min for event kinds 0, 3, 40 and 41
kinds:
- 0
- 3
- 40
- 41
period: 60000
rate: 30
- description: 144 events/min for event kinds 1, 2, 4 and 42
kinds:
- 1
- 2
- 4
- 42
period: 60000
rate: 144
- description: 480 events/min for encrypted channel event kinds 104 and 140-142
kinds:
- 104
- 140
- 141
- 142
period: 60000
rate: 480
- description: 60 events/min for event kind ranges 5-7 and 43-49
kinds:
- - 5
- 7
- - 43
- 49
period: 60000
rate: 60
- description: 24 events/min for replaceable events and parameterized replaceable
events
kinds:
- - 10000
- 19999
- - 30000
- 39999
period: 60000
rate: 24
- description: 120 events/min for ephemeral events
kinds:
- - 20000
- 29999
period: 60000
rate: 120
- description: 2880 events/hour for all events
period: 3600000
rate: 2880
- description: 30 events/min for event kinds 0, 3, 40 and 41
kinds:
- 0
- 3
- 40
- 41
period: 60000
rate: 30
- description: 144 events/min for event kinds 1, 2, 4 and 42
kinds:
- 1
- 2
- 4
- 42
period: 60000
rate: 144
- description: 1200 events/min for encrypted channel event kinds 104 and 140-142
kinds:
- 104
- 140
- 141
- 142
period: 60000
rate: 1200
- description: 60 events/min for event kind ranges 5-7 and 43-49
kinds:
- - 5
- 7
- - 43
- 49
period: 60000
rate: 60
- description:
24 events/min for replaceable events and parameterized replaceable
events
kinds:
- - 10000
- 19999
- - 30000
- 39999
period: 60000
rate: 24
- description: 120 events/min for ephemeral events
kinds:
- - 20000
- 29999
period: 60000
rate: 120
- description: 4800 events/hour for all events
period: 3600000
rate: 4800
whitelists:
pubkeys: []
ipAddresses:
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
client:
subscription:
maxSubscriptions: 20
maxSubscriptions: 10
maxFilters: 10
maxFilterValues: 2500
maxSubscriptionIdLength: 256
maxLimit: 5000
minPrefixLength: 4
message:
rateLimits:
- description: 480 raw messages/min
period: 60000
rate: 480
- description: 720 raw messages/min
period: 60000
rate: 720
ipWhitelist:
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
kind: ConfigMap
metadata:
labels:
Expand Down
Loading

0 comments on commit 73d61c9

Please sign in to comment.