relay-config.toml (8151B)
1 # Nostr-rs-relay configuration 2 3 [info] 4 # The advertised URL for the Nostr websocket. 5 relay_url = "ws://localhost:21648" 6 7 # Relay information for clients. Put your unique server name here. 8 name = "rad-roots-dev-relay" 9 10 # Description 11 description = "rad-roots-dev-relay" 12 13 # Administrative contact pubkey (32-byte hex, not npub) 14 #pubkey = "0c2d168a4ae8ca58c9f1ab237b5df682599c6c7ab74307ea8b05684b60405d41" 15 16 # Administrative contact URI 17 #contact = "mailto:contact@example.com" 18 19 # Favicon location. Relative to the current directory. Assumes an 20 # ICO format. 21 #favicon = "favicon.ico" 22 23 # URL of Relay's icon. 24 #relay_icon = "https://example.test/img.png" 25 26 # Path to custom relay html page 27 #relay_page = "index.html" 28 29 [diagnostics] 30 # Enable tokio tracing (for use with tokio-console) 31 #tracing = false 32 33 [database] 34 # Database engine (sqlite/postgres). Defaults to sqlite. 35 # Support for postgres is currently experimental. 36 #engine = "sqlite" 37 38 # Directory for SQLite files. Defaults to the current directory. Can 39 # also be specified (and overriden) with the "--db dirname" command 40 # line option. 41 #data_directory = "." 42 43 # Use an in-memory database instead of 'nostr.db'. 44 # Requires sqlite engine. 45 # Caution; this will not survive a process restart! 46 #in_memory = false 47 48 # Database connection pool settings for subscribers: 49 50 # Minimum number of SQLite reader connections 51 #min_conn = 0 52 53 # Maximum number of SQLite reader connections. Recommend setting this 54 # to approx the number of cores. 55 #max_conn = 8 56 57 # Database connection string. Required for postgres; not used for 58 # sqlite. 59 #connection = "postgresql://postgres:nostr@localhost:7500/nostr" 60 61 # Optional database connection string for writing. Use this for 62 # postgres clusters where you want to separate reads and writes to 63 # different nodes. Ignore for single-database instances. 64 #connection_write = "postgresql://postgres:nostr@localhost:7500/nostr" 65 66 [logging] 67 # Directory to store log files. Log files roll over daily. 68 folder_path = "./logs/relay" 69 file_prefix = "nostr-relay" 70 71 [grpc] 72 # gRPC interfaces for externalized decisions and other extensions to 73 # functionality. 74 # 75 # Events can be authorized through an external service, by providing 76 # the URL below. In the event the server is not accessible, events 77 # will be permitted. The protobuf3 schema used is available in 78 # `proto/nauthz.proto`. 79 # event_admission_server = "http://[::1]:50051" 80 81 # If the event admission server denies writes 82 # in any case (excluding spam filtering). 83 # This is reflected in the relay information document. 84 # restricts_write = true 85 86 [network] 87 # Bind to this network address 88 address = "0.0.0.0" 89 90 # Listen on this port 91 port = 8080 92 93 # If present, read this HTTP header for logging client IP addresses. 94 # Examples for common proxies, cloudflare: 95 #remote_ip_header = "x-forwarded-for" 96 #remote_ip_header = "cf-connecting-ip" 97 98 # Websocket ping interval in seconds, defaults to 5 minutes 99 #ping_interval = 300 100 101 [options] 102 # Reject events that have timestamps greater than this many seconds in 103 # the future. Recommended to reject anything greater than 30 minutes 104 # from the current time, but the default is to allow any date. 105 reject_future_seconds = 1800 106 107 [limits] 108 # Limit events created per second, averaged over one minute. Must be 109 # an integer. If not set (or set to 0), there is no limit. Note: 110 # this is for the server as a whole, not per-connection. 111 # 112 # Limiting event creation is highly recommended if your relay is 113 # public! 114 # 115 #messages_per_sec = 5 116 117 # Limit client subscriptions created, averaged over one minute. Must 118 # be an integer. If not set (or set to 0), defaults to unlimited. 119 # Strongly recommended to set this to a low value such as 10 to ensure 120 # fair service. 121 #subscriptions_per_min = 0 122 123 # UNIMPLEMENTED... 124 # Limit how many concurrent database connections a client can have. 125 # This prevents a single client from starting too many expensive 126 # database queries. Must be an integer. If not set (or set to 0), 127 # defaults to unlimited (subject to subscription limits). 128 #db_conns_per_client = 0 129 130 # Limit blocking threads used for database connections. Defaults to 16. 131 #max_blocking_threads = 16 132 133 # Limit the maximum size of an EVENT message. Defaults to 128 KB. 134 # Set to 0 for unlimited. 135 #max_event_bytes = 131072 136 137 # Maximum WebSocket message in bytes. Defaults to 128 KB. 138 #max_ws_message_bytes = 131072 139 140 # Maximum WebSocket frame size in bytes. Defaults to 128 KB. 141 #max_ws_frame_bytes = 131072 142 143 # Broadcast buffer size, in number of events. This prevents slow 144 # readers from consuming memory. 145 #broadcast_buffer = 16384 146 147 # Event persistence buffer size, in number of events. This provides 148 # backpressure to senders if writes are slow. 149 #event_persist_buffer = 4096 150 151 # Event kind blacklist. Events with these kinds will be discarded. 152 #event_kind_blacklist = [ 153 # 70202, 154 #] 155 156 # Event kind allowlist. Events other than these kinds will be discarded. 157 #event_kind_allowlist = [ 158 # 0, 1, 2, 3, 7, 40, 41, 42, 43, 44, 30023, 159 #] 160 161 # Rejects imprecise requests (kind only and author only etc) 162 # This is a temperary measure to improve the adoption of outbox model 163 # Its recommended to have this enabled 164 limit_scrapers = false 165 166 [authorization] 167 # Pubkey addresses in this array are whitelisted for event publishing. 168 # Only valid events by these authors will be accepted, if the variable 169 # is set. 170 #pubkey_whitelist = [ 171 # "35d26e4690cbe1a898af61cc3515661eb5fa763b57bd0b42e45099c8b32fd50f", 172 # "887645fef0ce0c3c1218d2f5d8e6132a19304cdc57cd20281d082f38cfea0072", 173 #] 174 # Enable NIP-42 authentication 175 #nip42_auth = false 176 # Send DMs (kind 4 and 44) and gift wraps (kind 1059) only to their authenticated recipients 177 #nip42_dms = false 178 179 [verified_users] 180 # NIP-05 verification of users. Can be "enabled" to require NIP-05 181 # metadata for event authors, "passive" to perform validation but 182 # never block publishing, or "disabled" to do nothing. 183 #mode = "disabled" 184 185 # Domain names that will be prevented from publishing events. 186 #domain_blacklist = ["wellorder.net"] 187 188 # Domain names that are allowed to publish events. If defined, only 189 # events NIP-05 verified authors at these domains are persisted. 190 #domain_whitelist = ["example.com"] 191 192 # Consider an pubkey "verified" if we have a successful validation 193 # from the NIP-05 domain within this amount of time. Note, if the 194 # domain provides a successful response that omits the account, 195 # verification is immediately revoked. 196 #verify_expiration = "1 week" 197 198 # How long to wait between verification attempts for a specific author. 199 #verify_update_frequency = "24 hours" 200 201 # How many consecutive failed checks before we give up on verifying 202 # this author. 203 #max_consecutive_failures = 20 204 205 [pay_to_relay] 206 # Enable pay to relay 207 #enabled = false 208 209 # Node interface to use 210 #processor = "ClnRest/LNBits" 211 212 # The cost to be admitted to relay 213 #admission_cost = 4200 214 215 # The cost in sats per post 216 #cost_per_event = 0 217 218 # Url of node api 219 #node_url = "<node url>" 220 221 # LNBits api secret 222 #api_secret = "<ln bits api>" 223 224 # Path to CLN rune 225 #rune_path = "<rune path>" 226 227 # Nostr direct message on signup 228 #direct_message=false 229 230 # Terms of service 231 #terms_message = """ 232 #This service (and supporting services) are provided "as is", without warranty of any kind, express or implied. 233 # 234 #By using this service, you agree: 235 #* Not to engage in spam or abuse the relay service 236 #* Not to disseminate illegal content 237 #* That requests to delete content cannot be guaranteed 238 #* To use the service in compliance with all applicable laws 239 #* To grant necessary rights to your content for unlimited time 240 #* To be of legal age and have capacity to use this service 241 #* That the service may be terminated at any time without notice 242 #* That the content you publish may be removed at any time without notice 243 #* To have your IP address collected to detect abuse or misuse 244 #* To cooperate with the relay to combat abuse or misuse 245 #* You may be exposed to content that you might find triggering or distasteful 246 #* The relay operator is not liable for content produced by users of the relay 247 #""" 248 249 # Whether or not new sign ups should be allowed 250 #sign_ups = false 251 252 # optional if `direct_message=false` 253 #secret_key = "<nostr nsec>"