mirror of
https://github.com/0ceanSlim/grain.git
synced 2024-11-23 00:57:14 +00:00
88 lines
2.7 KiB
YAML
88 lines
2.7 KiB
YAML
mongodb:
|
|
uri: mongodb://localhost:27017/
|
|
database: grain
|
|
|
|
auth:
|
|
enabled: false # Enable or disable AUTH handling
|
|
relay_url: "wss://relay.example.com/" # Specify the relay URL
|
|
|
|
server:
|
|
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
|
|
|
|
event_time_constraints:
|
|
min_created_at: 1577836800 # January 1, 2020, as Unix timestamp
|
|
# min_created_at_string: now-5m # Custom value to indicate 5 minutes in the past
|
|
# max_created_at: 0 # Set to 0 to use the default behavior of 'now'
|
|
max_created_at_string: now+5m # Use a string to set a date for max created at in the future or past from current time
|
|
|
|
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
|
|
|
|
rate_limit:
|
|
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
|
|
|
|
# Size limits for specific event kinds
|
|
kind_size_limits:
|
|
- kind: 0
|
|
max_size: 10240 # Maximum size in bytes for kind 0 events
|
|
- kind: 1
|
|
max_size: 25600 # Maximum size in bytes for kind 1 events
|
|
|
|
# Rate limits for different event categories
|
|
category_limits:
|
|
ephemeral:
|
|
limit: 100 # Events per second
|
|
burst: 200 # Allowed burst
|
|
parameterized_replaceable:
|
|
limit: 5
|
|
burst: 10
|
|
regular:
|
|
limit: 25
|
|
burst: 50
|
|
replaceable:
|
|
limit: 10
|
|
burst: 20
|
|
|
|
# Rate limits for specific event kinds
|
|
kind_limits:
|
|
- kind: 0
|
|
limit: 1 # Events per second
|
|
burst: 5 # Allowed burst
|
|
- kind: 1
|
|
limit: 25
|
|
burst: 50
|
|
- kind: 3
|
|
limit: 25
|
|
burst: 50
|
|
|
|
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
|