From a9c69bd7c168acc7167dcf6bd8604205f27ec535 Mon Sep 17 00:00:00 2001 From: Doug Hoyte Date: Fri, 13 Jan 2023 16:14:11 -0500 Subject: [PATCH] more descriptive default config --- golpe | 2 +- golpe.yaml | 57 ++++++++++++++++++++++++++++-------------- strfry.conf | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 20 deletions(-) diff --git a/golpe b/golpe index 72a0160..e39dcdc 160000 --- a/golpe +++ b/golpe @@ -1 +1 @@ -Subproject commit 72a016041fdf99fd1cf3aec7b539ff8bf3d33126 +Subproject commit e39dcdc7ed857f8614950de2a99d336eb29af677 diff --git a/golpe.yaml b/golpe.yaml index ef07d4c..d1a27bf 100644 --- a/golpe.yaml +++ b/golpe.yaml @@ -54,25 +54,50 @@ tables: config: - name: db + desc: "Directory that contains strfry database" default: "./strfry-db/" noReload: true - - name: relay__port - default: 7777 - noReload: true - name: relay__bind + desc: "Interface to listen on. Use 0.0.0.0 to listen on all interfaces" default: "127.0.0.1" noReload: true + - name: relay__port + desc: "Port to open for the nostr websocket protocol" + default: 7777 + noReload: true - name: relay__info__name + desc: "NIP-11: Name of this server. Short/descriptive (< 30 characters)" default: "strfry default" - name: relay__info__description + desc: "NIP-11: Detailed information about relay, free-form" default: "This is a strfry instance." - name: relay__info__pubkey + desc: "NIP-11: Administrative nostr pubkey, for contact purposes" default: "unset" - name: relay__info__contact + desc: "NIP-11: Alternative administrative contact (email, website, etc)" default: "unset" + - name: relay__maxWebsocketPayloadSize + desc: "Maximum accepted incoming websocket frame size (should be larger than max event and yesstr msg)" + default: 131072 + noReload: true + - name: relay__autoPingSeconds + desc: "Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts)" + default: 55 + noReload: true + - name: relay__enableTcpKeepalive + desc: "If TCP keep-alive should be enabled (detect dropped connections to upstream reverse proxy)" + default: false + - name: relay__queryTimesliceBudgetMicroseconds + desc: "How much uninterrupted CPU time a REQ query should get during its DB scan" + default: 10000 + - name: relay__maxFilterLimit + desc: "Maximum records that can be returned per filter" + default: 500 + - name: relay__numThreads__ingester default: 3 noReload: true @@ -86,30 +111,24 @@ config: default: 1 noReload: true - - name: relay__maxWebsocketPayloadSize - default: 131072 - noReload: true - - name: relay__autoPingSeconds - default: 55 - noReload: true - - name: relay__enableTcpKeepalive - default: false - - name: relay__queryTimesliceBudgetMicroseconds - default: 10000 - - name: relay__maxFilterLimit - default: 500 - + - name: events__maxEventSize + desc: "Maximum size of normalised JSON, in bytes" + default: 65536 - name: events__rejectEventsNewerThanSeconds + desc: "Events newer than this will be rejected" default: 900 # 15 mins - name: events__rejectEventsOlderThanSeconds - default: 604800 # 1 week + desc: "Events older than this will be rejected" + default: 94608000 # 3 years - name: events__rejectEphemeralEventsOlderThanSeconds + desc: "Ephemeral events older than this will be rejected" default: 60 - name: events__ephemeralEventsLifetimeSeconds + desc: "Ephemeral events will be deleted from the DB when older than this" default: 300 - - name: events__maxEventSize - default: 65536 - name: events__maxNumTags + desc: "Maximum number of tags allowed" default: 250 - name: events__maxTagValSize + desc: "Maximum size for tag values, in bytes" default: 128 diff --git a/strfry.conf b/strfry.conf index 78a6884..196c8f3 100644 --- a/strfry.conf +++ b/strfry.conf @@ -1,5 +1,76 @@ +## +## Default strfry config +## + +# Directory that contains strfry database db = "./strfry-db/" relay { + # Interface to listen on. Use 0.0.0.0 to listen on all interfaces + bind = "127.0.0.1" + + # Port to open for the nostr websocket protocol port = 7777 + + 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, for contact purposes + pubkey = "unset" + + # NIP-11: Alternative administrative contact (email, website, etc) + contact = "unset" + } + + # Maximum accepted incoming websocket frame size (should be larger than max event and yesstr msg) + maxWebsocketPayloadSize = 131072 + + # Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts) + 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 + + numThreads { + ingester = 3 + + reqWorker = 3 + + reqMonitor = 3 + + yesstr = 1 + } +} + +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 = 250 + + # Maximum size for tag values, in bytes + maxTagValSize = 128 }