2024-07-20 01:09:42 +00:00
|
|
|
mongodb:
|
2024-08-16 14:08:43 +00:00
|
|
|
uri: mongodb://localhost:27017/
|
|
|
|
database: grain
|
2024-07-25 13:06:48 +00:00
|
|
|
|
2024-08-19 18:28:13 +00:00
|
|
|
auth:
|
|
|
|
enabled: false # Enable or disable AUTH handling
|
|
|
|
relay_url: "wss://relay.example.com/" # Specify the relay URL
|
|
|
|
|
2024-07-25 02:09:54 +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-08-09 12:38:18 +00:00
|
|
|
|
2024-08-19 17:47:23 +00:00
|
|
|
resource_limits:
|
|
|
|
cpu_cores: 2 # Limit the number of CPU cores the application can use
|
|
|
|
memory_mb: 1024 # Cap the maximum amount of RAM in MB the application can use
|
|
|
|
heap_size_mb: 512 # Set a limit on the Go garbage collector's heap size in MB
|
|
|
|
max_goroutines: 100 # Limit the maximum number of concurrently running Go routines
|
|
|
|
|
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-07-26 14:40:31 +00:00
|
|
|
|
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:
|
|
|
|
limit: 100 # Events per second
|
|
|
|
burst: 200 # Allowed burst
|
|
|
|
parameterized_replaceable:
|
|
|
|
limit: 5
|
|
|
|
burst: 10
|
2024-07-25 13:06:48 +00:00
|
|
|
regular:
|
2024-08-16 14:08:43 +00:00
|
|
|
limit: 25
|
|
|
|
burst: 50
|
2024-07-25 13:06:48 +00:00
|
|
|
replaceable:
|
2024-08-16 14:08:43 +00:00
|
|
|
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
|
|
|
|
|
2024-09-22 19:34:32 +00:00
|
|
|
event_purge:
|
|
|
|
enabled: true # Toggle to enable/disable event purging
|
|
|
|
keep_duration_days: 2 # Number of days to keep events
|
|
|
|
purge_interval_hours: 24 # Runs every 24 hours
|
|
|
|
purge_by_category: # Configure purging based on categories
|
|
|
|
parameterized_replaceable: false
|
|
|
|
regular: true
|
|
|
|
replaceable: false
|
|
|
|
purge_by_kind: # Configure purging based on event kind
|
|
|
|
- kind: 0
|
|
|
|
enabled: false
|
|
|
|
- kind: 1
|
|
|
|
enabled: true
|
|
|
|
- kind: 3
|
|
|
|
enabled: false
|
|
|
|
exclude_whitelisted: true # Exclude events from whitelisted pubkeys during purging
|