Repository navigation
Expand file tree
/
Copy pathdefault-settings.yaml
More file actions
executable file
·511 lines (511 loc) · 18.5 KB
/
Copy pathdefault-settings.yaml
File metadata and controls
executable file
·511 lines (511 loc) · 18.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
info:
relay_url: wss://nostream.your-domain.com
name: nostream.your-domain.com
description: A nostr relay written in Typescript.
banner: https://nostream.your-domain.com/banner.png
icon: https://nostream.your-domain.com/icon.png
pubkey: replace-with-your-pubkey-in-hex
# Optional. The relay's own signing pubkey, published as `self` in the NIP-11
# document. NIP-43 clients verify relay-signed events against it, so it MUST
# match the key the relay signs with. Leave it unset to have it derived from
# SECRET automatically; run `nostream info` to see the derived value.
# self: replace-with-your-relay-pubkey-in-hex
contact: mailto:[email protected]
terms_of_service: https://nostream.your-domain.com/terms
payments:
enabled: false
processor: zebedee
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
event_kinds:
- 9735 # Nip-57 Lightning Zap Receipts
# Recurring membership plans. Leave empty to keep the one-time admission fee above.
# The amount paid selects the plan, so every plan needs its own amount.
# - id: basic
# description: Basic membership, paid every 30 days
# amount: 1000000 # msats per period
# intervalSeconds: 2592000
# graceSeconds: 259200 # access lasts this long after a period ends unrenewed
subscriptionPlans: []
# Applied only when the payments processor does not report an expiry of its own.
# Without it such invoices can never be retired and stay pending forever.
# Raise it if your processor issues invoices that stay payable for longer than
# this: LNURL and NWC have no callback, so a payment made after the invoice has
# been retired would not be noticed. Capped at 30 days.
invoiceExpirySeconds: 86400
paymentsProcessors:
zebedee:
baseURL: https://api.zebedee.io/
callbackBaseURL: https://nostream.your-domain.com/callbacks/zebedee
ipWhitelist:
- "3.225.112.64"
- "::ffff:3.225.112.64"
lnbits:
baseURL: https://lnbits.your-domain.com/
callbackBaseURL: https://nostream.your-domain.com/callbacks/lnbits
lnurl:
invoiceURL: https://getalby.com/lnurlp/your-username
nodeless:
baseURL: https://nodeless.io
storeId: your-nodeless-io-store-id
opennode:
baseURL: api.opennode.com
callbackBaseURL: https://nostream.your-domain.com/callbacks/opennode
nwc:
invoiceExpirySeconds: 900
replyTimeoutMs: 10000
nip05:
# NIP-05 verification of event authors as a spam reduction measure.
# mode: 'enabled' requires NIP-05 for publishing (except kind 0),
# 'passive' verifies but never blocks, 'disabled' does nothing.
mode: disabled
# How long (ms) a successful verification remains valid before re-check.
# Matches nostr-rs-relay default of 1 week.
verifyExpiration: 604800000
# Minimum interval (ms) between re-verification attempts for a given author.
# Matches nostr-rs-relay default of 24 hours.
verifyUpdateFrequency: 86400000
# How many consecutive failed checks before giving up on verifying an author.
# Matches nostr-rs-relay default of 20.
maxConsecutiveFailures: 20
# Only allow authors with NIP-05 at these domains (empty = allow all)
domainWhitelist: []
# Block authors with NIP-05 at these domains
domainBlacklist: []
nip42:
# When true, clients must AUTH (NIP-42) as the event author before publishing.
# Advertised in NIP-11 as limitation.restricted_writes (not auth_required).
authRequired: false
# Seconds after which an authenticated session on a socket expires and must
# AUTH again. 0 (default) keeps the session for the connection lifetime.
sessionExpirySeconds: 0
# Only deliver these kinds to clients authenticated (NIP-42) as the event's
# author or a p-tagged recipient. Applies to REQ, live events and COUNT.
restrictedReads:
enabled: false
kinds:
- 4 # NIP-04 encrypted direct messages
- 1059 # NIP-59 gift wraps (NIP-17 private DMs, Marmot welcomes)
nip43:
# NIP-43: invite-based relay membership. When enabled, only admitted members
# (users who claimed an invite code via a kind 28934 join request) may
# publish events. Enabling this on an open relay blocks all non-members.
enabled: false
# Seconds until a newly minted invite code expires. Default is 600 (10 minutes).
# 0 means the code never expires.
inviteCodeExpirySeconds: 600
# How many times a newly minted invite code can be claimed.
defaultMaxUses: 1
# Answer REQs for kind 28935 by minting an invite code on the fly and returning
# it as a relay-signed ephemeral event. NIP-43 requires relays to opt in to this
# explicitly. Requesters must be authenticated via NIP-42.
allowInviteRequests: false
# Pubkeys allowed to request invite codes. Empty means any authenticated pubkey
# may request one; non-empty restricts minting to the listed pubkeys.
inviteRequestWhitelist: []
# Publish a kind 13534 membership list, signed by the relay's own key, and refresh it
# after every successful join or leave. This makes every member's pubkey public to
# anyone who can read the relay, so it is off by default. The list is a convenience
# for clients, not the source of truth for who may publish.
publishMembershipList: false
nip45:
enabled: true
nip50:
enabled: false
# 'simple' (no stemming) or a language name like 'english', 'spanish'
language: simple
maxQueryLength: 256
nip66:
# NIP-66 relay liveness monitoring. Disabled by default.
# When enabled, a relay-monitor worker probes targets and stores the latest snapshot in Redis.
enabled: false
# Seconds between scheduled probe runs.
probeIntervalSeconds: 3600
timeouts:
dnsMs: 10000
tlsMs: 10000
wsRttMs: 10000
nip11Ms: 10000
# Public WebSocket URLs to probe. Empty list defaults to info.relay_url.
targets: []
dnsCacheTtlSeconds: 300
historyRetentionRuns: 168
# Optional max age in hours for probe history; 0 disables age-based trimming (run count only).
historyRetentionHours: 0
wot:
# Web of Trust graph. When enabled, the relay builds a trust graph rooted
# at seedPubkey from NIP-02 contact lists, updated in real time as kind-3
# events arrive.
enabled: false
# The relay owner's pubkey in hex. This is the root of the trust graph.
# Required when enabled is true.
seedPubkey: ""
# A pubkey must be followed by at least this many already-trusted accounts
# to enter the graph at 2+ hops. Direct (1-hop) follows are always trusted.
minimumFollowers: 1
# How many hops out from seedPubkey the trust graph extends.
maxDepth: 2
# Reserved for a future periodic rebuild; not yet read by any code.
refreshIntervalHours: 24
nip56:
# NIP-56 content reporting. When enabled, kind-1984 report events are
# stored and scored by the reporter's WoT distance from wot.seedPubkey.
enabled: false
# Pubkeys (hex) whose reports are always maximum-weight and actionable,
# regardless of WoT distance. Reports from any other pubkey are stored
# and weighted, but never trigger automatic actions on their own.
trustedModerators: []
# When true, events matching an actionable report are excluded from
# REQ/COUNT results. Has no effect unless enabled is also true.
hideActionableReports: false
nip77:
# NIP-77 negentropy sync. Only answers when eventStore.backend is postgres.
enabled: false
# Most events a single session may hold in memory.
maxEventsPerSession: 100000
# Concurrent negentropy sessions per connection.
maxSessionsPerConnection: 3
# Close a session with no NEG-MSG for this long.
sessionIdleTimeoutMs: 60000
peering:
# Relay peering advertisement, served as the `peering` section of the NIP-11
# document. This is a discovery surface: it states the feeds and terms other
# relays can read. Enabling it does not accept peers by itself.
enabled: false
# How to ask for a peering relationship: a contact URI (mailto:, https:) and/or
# the WebSocket endpoint peers should connect to. At least one is required when
# peering is enabled.
contact: ""
endpoint: ""
# NIP-13 proof-of-work bits a peering request must carry. 0 means none.
# Advertised as peering.min_pow_difficulty.
minRequestPowDifficulty: 0
# Owner attestation for incoming peering requests:
# waived - configured peers are trusted without a request (default)
# preferred - record a valid request when presented, but do not require it
# required - withhold peer treatment until a valid owner-signed request is
# accepted on an authenticated connection
ownerAttestation: waived
# Configured peers are already trusted by pubkey, so their request does not
# need to meet minRequestPowDifficulty. Set false to require it anyway.
waiveRequestPowForConfiguredPeers: true
# A completed-but-unconfirmed paid peering invoice is retried by the
# maintenance worker. After this many failed settlements, enqueue one
# operator alert (peering.payment.failed) and keep retrying.
settlementFailureThreshold: 5
# Feeds this relay is willing to serve. Each scope lists event kinds and,
# optionally, an absolute time range (unix seconds) or a rolling window.
# At least one scope is required when peering is enabled.
# Example:
# scopes:
# - kinds: [1, 3, 6, 7, 30023]
# - kinds: [[0, 9999]]
# since: 1700000000
# - kinds: [1, 6]
# windowSeconds: 3600
scopes: []
# Terms for peering, reusing the NIP-11 fee-object shape. `period` is in
# seconds. An empty list means settlement-free peering. One positive term
# makes this a paid feed: payments must be enabled, and a paid msats amount
# must be a whole number of satoshis.
# Example: [{ amount: 21000, unit: msats, period: 2592000 }]
terms: []
# Peering peers trusted by their relay pubkey (hex or npub), never by URL
# alone. A connection that proves one of these keys with NIP-42 AUTH is
# recognized as a peer; any other key gets no peer recognition. Enabled
# peers are also synced: the peering-sync worker reads each peer's NIP-11
# peering scopes, reconciles them over NIP-77, and keeps a live feed.
# Example:
# peers:
# - pubkey: replace-with-peer-relay-pubkey-in-hex
# relayUrl: wss://peer.example.com
# enabled: true
# # Optional: require this operator key on the owner attestation.
# ownerPubkey: replace-with-peer-owner-pubkey-in-hex
# # Buying side: auto-pay this peer's invoices up to this budget.
# budget: { amount: 10000, unit: sats, period: 2592000 }
peers: []
# Buying side automatic payment. Invoices are paid only when the peer is
# configured above, the amount matches the peer's advertised NIP-11 terms,
# the payment hash has not been seen, and both budgets have room. Anything
# else is held for operator approval in the admin console.
autoPay:
enabled: false
# Optional cap across every peer, per this budget's own period.
# A zero amount means no global cap.
globalBudget: { amount: 0, unit: sats, period: 2592000 }
network:
maxPayloadSize: 524288
# Uncomment only when using a trusted reverse proxy and configuring trustedProxies.
# remoteIpHeader: x-forwarded-for
# remoteIpHeader: cf-connecting-ip
# Proxy IPs allowed to set remoteIpHeader (loopback and common docker internal)
trustedProxies:
- "127.0.0.1"
- "::ffff:127.0.0.1"
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
workers:
count: 0
eventStore:
# Only postgres for now. Changing it needs a restart.
backend: postgres
dvm:
workers: []
limits:
# Every `period` below is a count of milliseconds, and `rate` is how many hits
# one window allows. `period: 60`, written as if it meant 60 seconds, is read
# as a 60 ms window - which makes the limit a thousand times LOOSER, not
# stricter: twelve hits per minute becomes twelve hits per 60 ms. Nothing
# rejects it, because 60 is a valid count of milliseconds. The unit cannot be
# inferred from the number, so it is stated here and on RateLimit in
# src/@types/settings.ts.
#
# strategy selection configuration for rate limiting:
rateLimiter:
strategy: ewma
invoice:
# period is milliseconds (60000 = one minute)
rateLimits:
- period: 60000
rate: 12
- period: 3600000
rate: 30
ipWhitelist:
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
invite:
# Per-pubkey limit on kind 28935 invite requests. Each mint writes a row to
# invite_codes, so this is the main defence against a code flood.
# period is milliseconds (60000 = one minute)
rateLimits:
- description: 5 invite requests per hour per pubkey
period: 3600000
rate: 5
admissionCheck:
# period is milliseconds (60000 = one minute)
rateLimits:
- description: 30 admission checks/min or 1 check every 2 seconds
period: 60000
rate: 30
ipWhitelist:
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
admin:
# period is milliseconds (60000 = one minute)
rateLimits:
- description: 30 admin requests/min
period: 60000
rate: 30
# period is milliseconds (60000 = one minute)
loginRateLimits:
- description: 10 login attempts per 15 minutes
period: 900000
rate: 10
ipWhitelist:
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
connection:
# period is milliseconds (60000 = one minute)
rateLimits:
- period: 1000
rate: 12
- period: 60000
rate: 48
ipWhitelist:
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
event:
retention:
maxDays: -1
kind:
whitelist:
- 62
pubkey:
whitelist: []
eventId:
minLeadingZeroBits: 0
# Adaptive PoW: scales the required difficulty on the eventId check with
# observed relay load instead of using a fixed minLeadingZeroBits value.
# Does not affect the pubkey check above -- that stays static regardless.
# Disabled by default.
pow:
enabled: false
floorBits: 0
ceilingBits: 24
targetEventsPerSecond: 50
periodMs: 60000
# Optional WoT-distance-based reductions on top of the computed adaptive
# difficulty. Requires wot.enabled. Example: direct follows (distance 1)
# bypass eventId PoW entirely, distance-2 pubkeys need half the computed
# difficulty, anyone farther (or outside the trust graph) pays it in full.
# - maxDistance: 1
# difficultyFactor: 0
# - maxDistance: 2
# difficultyFactor: 0.5
wotThresholds: []
kind:
whitelist: []
blacklist: []
pubkey:
minBalance: 0
minLeadingZeroBits: 0
whitelist: []
blacklist: []
createdAt:
maxPositiveDelta: 900
maxNegativeDelta: 0
content:
- description: 64 KB for event kind ranges 0-10 and 40-49
maxLength: 102400
kinds:
- - 0
- 10
- - 40
- 49
- description: 96 KB for event kind ranges 11-39 and 50-max
maxLength: 102400
kinds:
- - 11
- 39
- - 50
- 9007199254740991
# period is milliseconds (60000 = one minute)
rateLimits:
- description: 6 events/min for event kinds 0, 3, 40 and 41
kinds:
- 0
- 3
- 40
- 41
period: 60000
rate: 6
- description: 12 events/min for event kinds 1, 2, 4 and 42
kinds:
- 1
- 2
- 4
- 42
period: 60000
rate: 12
- description: 30 events/min for event kind ranges 5-7 and 43-49
kinds:
- - 5
- 7
- - 43
- 49
period: 60000
rate: 30
- description: 24 events/min for replaceable events and parameterized replaceable
events
kinds:
- - 10000
- 19999
- - 30000
- 39999
period: 60000
rate: 24
- description: 60 events/min for Marmot group events (kind 445)
kinds:
- 445
period: 60000
rate: 60
- description: 60 events/min for ephemeral events
kinds:
- - 20000
- 29999
period: 60000
rate: 60
- description: 720 events/hour for all events
period: 3600000
rate: 720
whitelists:
pubkeys: []
ipAddresses:
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
client:
subscription:
maxSubscriptions: 10
maxFilters: 10
maxFilterValues: 2500
maxSubscriptionIdLength: 256
maxLimit: 5000
minPrefixLength: 4
peer:
# Configured peering peers get feed treatment, not client treatment. These
# caps are separate from limits.client and limits.message, so a full-feed
# subscription does not trip the client EWMA bucket or max_subscriptions.
# A value of 0 disables that cap.
subscription:
maxSubscriptions: 100
maxFilters: 100
maxFilterValues: 10000
maxSubscriptionIdLength: 256
# 0 = no cap, so a peer can request a full feed.
maxLimit: 0
minPrefixLength: 4
message:
# period is milliseconds (60000 = one minute)
rateLimits:
- description: 6000 peer messages/min
period: 60000
rate: 6000
request:
# On-demand REQ/COUNT/NEG-OPEN requests, counted per peer pubkey rather
# than per IP. Separate from the generic message bucket so a feed's raw
# traffic does not consume the on-demand budget.
rateLimits:
- description: 300 peer on-demand requests/min
period: 60000
rate: 300
message:
# period is milliseconds (60000 = one minute)
rateLimits:
- description: 240 raw messages/min
period: 60000
rate: 240
ipWhitelist:
- "::1"
- "10.10.10.1"
- "::ffff:10.10.10.1"
admin:
enabled: false
sessionTtlSeconds: 86400
nip98:
enabled: false
allowedPubkeys: []
maxSkewSeconds: 60
notifications:
enabled: false
targets: []
events:
admission.invoice.created: true
admission.invoice.paid: true
admission.invoice.failed: true
peering.invoice.created: true
peering.invoice.paid: true
peering.invoice.failed: true
peering.payment.failed: true
peering.access.lapsed: true
settings.changed: true
relay.restarted: false
probe.failed: true
probe.recovered: true
ssl.expiring: true
retry:
maxAttempts: 5
baseDelayMs: 1000
deliveryLogRetentionDays: 30