forked from hoytech/strfry
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathstrfry.conf
More file actions
205 lines (145 loc) · 6.81 KB
/
Copy pathstrfry.conf
File metadata and controls
205 lines (145 loc) · 6.81 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
##
## Default strfry config
##
# Directory that contains the strfry LMDB database (restart required)
db = "./strfry-db/"
dbParams {
# Maximum number of threads/processes that can simultaneously have LMDB transactions open (restart required)
maxreaders = 256
# Size of mmap() to use when loading LMDB (default is 10TB, does *not* correspond to disk-space used) (restart required)
mapsize = 10995116277760
# Disables read-ahead when accessing the LMDB mapping. Reduces IO activity when DB size is larger than RAM. (restart required)
noReadAhead = false
}
events {
# Maximum size of normalised JSON, in bytes
maxEventSize = 65536
# Events newer than this will be rejected
rejectEventsNewerThanSeconds = 900
# Events older than this will be rejected
rejectEventsOlderThanSeconds = 94608000
# Ephemeral events older than this will be rejected
rejectEphemeralEventsOlderThanSeconds = 60
# Ephemeral events will be deleted from the DB when older than this
ephemeralEventsLifetimeSeconds = 300
# Maximum number of tags allowed
maxNumTags = 2000
# Maximum size for tag values, in bytes
maxTagValSize = 1024
}
relay {
# Interface to listen on. Use 0.0.0.0 to listen on all interfaces (restart required)
bind = "0.0.0.0"
# Port to open for the nostr websocket protocol (restart required)
port = 7777
# Set OS-limit on maximum number of open files/sockets (if 0, don't attempt to set) (restart required)
nofiles = 524288
# HTTP header that contains the client's real IP, before reverse proxying (ie x-real-ip) (MUST be all lower-case)
realIpHeader = ""
auth {
# Enable NIP-42 authentication
enabled = true
# External relay URL (beginning with wss://). Required in order to validate challenge responses.
serviceUrl = ""
# Comma-separated list of event kinds that require NIP-42 AUTH to read via REQ/COUNT/NEG-OPEN. Example for DMs: '4,1059'.
restrictedReadKinds = "4, 1059"
# When a filter matches restrictedReadKinds, also require the authenticated pubkey to appear in its 'authors' or '#p' set.
restrictReadToInvolvedPubkey = true
}
info {
# NIP-11: Name of this server. Short/descriptive (< 30 characters)
name = "strfry default"
# NIP-11: Detailed information about relay, free-form
description = "This is a strfry instance."
# NIP-11: Administrative nostr pubkey (in npub or 32-byte HEX format), for contact purposes
pubkey = ""
# NIP-11: Relay's own pubkey (in npub or 32-byte HEX format)
self = ""
# NIP-11: Alternative administrative contact (email, website, etc)
contact = ""
# NIP-11: URL pointing to an image to be used as an icon for the relay
icon = ""
# NIP-11: URL pointing to an image to be used as an banner for the relay
banner = ""
# NIP-11: Privacy policy URL
privacy = ""
# NIP-11: Terms of service URL
terms = ""
# List of supported lists as JSON array, or empty string to use default. Example: "[1,2]"
nips = ""
}
# Maximum accepted incoming websocket frame size (should be larger than max event) (restart required)
maxWebsocketPayloadSize = 131072
# Maximum number of filters allowed in a REQ
maxReqFilterSize = 200
# Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts) (restart required)
autoPingSeconds = 55
# If TCP keep-alive should be enabled (detect dropped connections to upstream reverse proxy)
enableTcpKeepalive = false
# How much uninterrupted CPU time a REQ query should get during its DB scan
queryTimesliceBudgetMicroseconds = 10000
# Maximum records that can be returned per filter
maxFilterLimit = 500
# Maximum number of tag filters allowed per filter (O(N^2) in matching, so keep it small)
maxTagsPerFilter = 3
# Maximum records that can be counted by a COUNT request (set 0 to disable COUNT)
maxFilterLimitCount = 1000000
# Maximum number of subscriptions (concurrent REQs) a connection can have open at any time
maxSubsPerConnection = 200
# Per-connection cap on unsent outbound bytes buffered inside the websocket library (0 = unlimited). Default 33554432 (32 MiB) aligns with worst-case outbound for one maximal filter under default maxFilterLimit * maxEventSize. Connections exceeding this are terminated to bound memory used by slow/stalled clients.
maxPendingOutboundBytes = 33554432
writePolicy {
# If non-empty, path to an executable script that implements the writePolicy plugin logic
plugin = "/app/write-policy.py"
# Number of seconds to wait for a plugin to respond
timeoutSeconds = 10
}
compression {
# Use permessage-deflate compression if supported by client. Reduces bandwidth, but slight increase in CPU (restart required)
enabled = true
# Maintain a sliding window buffer for each connection. Improves compression, but uses more memory (restart required)
slidingWindow = true
}
logging {
# Dump all incoming messages
dumpInAll = false
# Dump all incoming EVENT messages
dumpInEvents = false
# Dump all incoming REQ/CLOSE messages
dumpInReqs = false
# Log performance metrics for initial REQ database scans
dbScanPerf = false
# Log reason for invalid event rejection? Can be disabled to silence excessive logging
invalidEvents = true
}
numThreads {
# Ingester threads: route incoming requests, validate events/sigs (restart required)
ingester = 3
# reqWorker threads: Handle initial DB scan for events (restart required)
reqWorker = 3
# reqMonitor threads: Handle filtering of new events (restart required)
reqMonitor = 3
# negentropy threads: Handle negentropy protocol messages (restart required)
negentropy = 2
}
negentropy {
# Support negentropy protocol messages
enabled = true
# Maximum records that sync will process before returning an error
maxSyncEvents = 1000000
}
filterValidation {
# Enable strict filter validation for REQ messages
enabled = false
# Maximum number of filters allowed per REQ (when validation enabled)
maxFiltersPerReq = 3
# Minimum number of filters required per REQ (when validation enabled)
minFiltersPerReq = 1
# Maximum number of kinds allowed per filter (when validation enabled)
maxKindsPerFilter = 3
# Comma-separated list of allowed kinds (empty = all allowed)
allowedKinds = ""
# Require at least one author, p tag, or e tag in each filter
requireAuthorOrTag = false
}
}