grain/app/static/examples/config.example.yml

86 lines
2.3 KiB
YAML
Raw Normal View History

mongodb:
2024-08-16 14:08:43 +00:00
uri: mongodb://localhost:27017/
database: grain
2024-07-25 13:06:48 +00:00
server:
2024-08-16 14:08:43 +00:00
port: :8181
read_timeout: 10 # in seconds
write_timeout: 10 # in seconds
idle_timeout: 120 # in seconds
max_connections: 100
max_subscriptions_per_client: 10
2024-07-25 03:04:26 +00:00
rate_limit:
2024-08-16 14:08:43 +00:00
ws_limit: 100 # WebSocket messages per second
ws_burst: 200 # Allowed burst of WebSocket messages
event_limit: 50 # Events per second
event_burst: 100 # Allowed burst of events
req_limit: 50 # HTTP requests per second
req_burst: 100 # Allowed burst of HTTP requests
max_event_size: 51200 # Maximum size of an event in bytes
2024-08-16 14:08:43 +00:00
# Size limits for specific event kinds
2024-07-26 20:46:01 +00:00
kind_size_limits:
- kind: 0
2024-08-16 14:08:43 +00:00
max_size: 10240 # Maximum size in bytes for kind 0 events
2024-07-26 20:46:01 +00:00
- kind: 1
2024-08-16 14:08:43 +00:00
max_size: 25600 # Maximum size in bytes for kind 1 events
2024-07-26 20:46:01 +00:00
2024-08-16 14:08:43 +00:00
# Rate limits for different event categories
category_limits:
ephemeral:
kind: 0
limit: 100 # Events per second
burst: 200 # Allowed burst
parameterized_replaceable:
kind: 0
limit: 5
burst: 10
2024-07-25 13:06:48 +00:00
regular:
2024-08-16 14:08:43 +00:00
kind: 0
limit: 25
burst: 50
2024-07-25 13:06:48 +00:00
replaceable:
2024-08-16 14:08:43 +00:00
kind: 0
limit: 10
burst: 20
2024-07-25 20:43:46 +00:00
2024-08-16 14:08:43 +00:00
# Rate limits for specific event kinds
kind_limits:
2024-07-26 01:26:47 +00:00
- kind: 0
2024-08-16 14:08:43 +00:00
limit: 1 # Events per second
burst: 5 # Allowed burst
2024-07-26 01:26:47 +00:00
- kind: 1
2024-08-16 14:08:43 +00:00
limit: 25
burst: 50
2024-07-26 01:26:47 +00:00
- kind: 3
2024-08-16 14:08:43 +00:00
limit: 25
burst: 50
pubkey_whitelist:
enabled: false
pubkeys: [] # List of allowed public keys
npubs: [] # List of allowed npubs (Nostr public keys in bech32 format)
kind_whitelist:
enabled: false
kinds: [] # List of allowed event kinds
domain_whitelist:
enabled: false
domains: [] # List of allowed domains
blacklist: #Removing a pubkey from the Blacklist requires a hard restart; Blacklist overides the Whitelist
enabled: true
permanent_ban_words: [] # Words that trigger a permanent ban
temp_ban_words: # Words that trigger a temporary ban
- crypto
- web3
- airdrop
max_temp_bans: 3 # Number of temporary bans before a permanent ban
temp_ban_duration: 3600 # Temporary ban duration in seconds
permanent_blacklist_pubkeys: # List of permanently banned public keys
- db0c9b8acd6101adb9b281c5321f98f6eebb33c5719d230ed1870997538a9765
permanent_blacklist_npubs: # List of permanently banned npubs
- npub1x0r5gflnk2mn6h3c70nvnywpy2j46gzqwg6k7uw6fxswyz0md9qqnhshtn