Skip to content

Instantly share code, notes, and snippets.

@ikuradon
Created December 29, 2023 05:33
Show Gist options
  • Save ikuradon/db91b5525c45363b9887e2409dec0ebe to your computer and use it in GitHub Desktop.
Save ikuradon/db91b5525c45363b9887e2409dec0ebe to your computer and use it in GitHub Desktop.
2023/12/29現在のやぶみリレー設定抜粋
services:
strfry-relay:
image: local/strfry
build:
context: ../repos/strfry
dockerfile: Dockerfile.custom
restart: always
volumes:
- ./data/strfry/strfry.conf:/etc/strfry.conf:ro
- ./repos/writepolicy:/writepolicy
- ./data/strfry/db:/app/strfry-db
ulimits:
nofile:
soft: 1048576
hard: 1048576
networks:
- internal_network
- traefik_network
labels:
"traefik.enable": "true"
"traefik.http.services.strfry.loadbalancer.server.port": "7777"
"traefik.http.routers.strfry.rule": "Host(`yabu.me`) && PathPrefix(`/`) && (Header(`Upgrade`, `websocket`) || Header(`accept`, `application/nostr+json`))"
"traefik.http.routers.strfry.tls.certresolver": "resolver"
"traefik.http.routers.strfry.tls.domains[0].main": "yabu.me"
"traefik.http.routers.strfry.tls.domains[0].sans": "*.yabu.me"
"application.module": "strfry"
"application.type": "server"
strfry-router:
image: local/strfry
build:
context: ../repos/strfry
dockerfile: Dockerfile.custom
restart: always
command: router strfry-router.config
volumes:
- ./data/strfry/strfry.conf:/etc/strfry.conf:ro
- ./data/strfry/strfry-router.config:/app/strfry-router.config:ro
- ./repos/writepolicy:/writepolicy
- ./data/strfry/db:/app/strfry-db
depends_on:
- strfry-relay
pid: service:strfry-relay
networks:
- internal_network
- traefik_network
labels:
"application.module": "strfry"
"application.type": "worker"
networks:
traefik_network:
external: true
external_network: {}
internal_network:
internal: true
streams {
# Template
# name {
# dir = "down|up|both"
# pluginDown = "/app/test.script"
# pluginUp = "/app/test.script"
# filter = { "kinds": [0] }
# urls = [
# "wss://example.com"
# ]
# }
# Collect events from upstream
upstream {
dir = "down"
urls = [
"wss://relay-jp.nostr.wirednet.jp"
"wss://nostrja-kari.heguro.com"
"wss://nrelay-jp.c-stellar.net"
"wss://nostr.holybea.com"
"wss://nostream.ocha.one"
"wss://nostr.fediverse.jp"
]
}
# Collect zap events(9735) from global relays
zap {
dir = "down"
filter = { "kinds": [9735] }
urls = [
"wss://nos.lol"
"wss://nostr.zebedee.cloud"
"wss://relay.damus.io"
"wss://relay.nostr.band"
"wss://relayable.org"
]
}
# Send events to downstream
downstream {
dir = "up"
urls = [
"wss://nostr-relay.nokotaro.com"
"wss://relay.nostr.wirednet.jp"
"wss://relay.nostr.band"
"wss://relayable.org"
]
}
# Mirror events with mirrors
mirror {
dir = "both"
pluginDown = "/writepolicy/app.mjs"
urls = [
"wss://r.kojira.io"
]
}
## Broadcast profiles and contact lists
directory {
dir = "up"
filter = { "kinds": [0, 10002] }
urls = [
"wss://purplepag.es"
]
}
}
##
## Default strfry config
##
# Directory that contains the strfry LMDB database (restart required)
db = "/app/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 = 102400
# 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 = 10000
# 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 = 1000000
# HTTP header that contains the client's real IP, before reverse proxying (ie x-real-ip) (MUST be all lower-case)
realIpHeader = "x-forwarded-for"
info {
# NIP-11: Name of this server. Short/descriptive (< 30 characters)
name = "やぶみ 🏹📨"
# NIP-11: Detailed information about relay, free-form
description = "Aggregator relay for (mainly) Japanese users."
# NIP-11: Administrative nostr pubkey, for contact purposes
pubkey = "b707d6be7fd9cc9e1aee83e81c3994156cfcf74ded5b09111930fdeeeb5a0c20"
# NIP-11: Alternative administrative contact (email, website, etc)
contact = "mailto:admin@yabu.me"
}
# Maximum accepted incoming websocket frame size (should be larger than max event) (restart required)
maxWebsocketPayloadSize = 1310720
# Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts) (restart required)
autoPingSeconds = 30
# If TCP keep-alive should be enabled (detect dropped connections to upstream reverse proxy)
enableTcpKeepalive = true
# 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 subscriptions (concurrent REQs) a connection can have open at any time
maxSubsPerConnection = 50
writePolicy {
# If non-empty, path to an executable script that implements the writePolicy plugin logic
plugin = "/writepolicy/app.mjs"
}
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 = 5
# reqWorker threads: Handle initial DB scan for events (restart required)
reqWorker = 5
# reqMonitor threads: Handle filtering of new events (restart required)
reqMonitor = 5
# 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
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment