# HTTP server configurations.
[http]
# The port number to run the HTTP server on. 
port = 6881

# Internal Mainline node configurations
[mainline]
# Port to run the internal Mainline DHT node on.
port = 6881
# Known public IPv4 address used to generate a BEP 42 secure node ID.
# When omitted, the DHT discovers its public address from peers.
# public_ip = "203.0.113.10"

# Cache settings
[cache]
# Set the path for the cache storage.
#
# Should be either absolute or relative to the location of this config file.
# Cache will be stored in a `pkarr-cache` directory inside the provided directory.
# 
# Defaults to a random temporary directory.
path = "./cache"
# Maximum number of SignedPackets to store, before evicting the oldest packets.
size = 1_000_000

# Minimum TTL before attempting to lookup a more recent version of a SignedPacket 
minimum_ttl =  300
# Maximum TTL before attempting to lookup a more recent version of a SignedPacket 
maximum_ttl =  86400

# Ip rate limiting configurations.
# If not included, rate limiting will be disabled.
[rate_limiter]
# Set to true if you are running this relay
# behind a reverse proxy, to use smart IP address
# extractors.
# 
# Make sure that your server is not also accessible
# directly, otherwise an attacker can bypass the
# Ip rate limiting by setting the trusted headers to 
# a random IP address on every request.
behind_proxy = false
# HTTP request quota per IP address.
# Always applied before request handling to every HTTP request.
# This includes GET, PUT, the index route, cache hits, and cache-only requests.
quota = "2r/s"
# Optional HTTP request burst size. Defaults to the quota rate when omitted.
burst = 10
# Incoming DHT request quota per DHT peer IP address.
# This is enforced by the internal Mainline DHT node before handling requests
# from other DHT peers.
dht_quota = "2r/s"
# Optional incoming DHT request burst size.
# Defaults to the DHT quota rate when omitted.
dht_burst = 10
# User-initiated DHT operation quota per IP address.
# This is separate from the HTTP quota above and is consumed only when a
# request makes the relay contact the DHT: PUT publishes, GET cache misses,
# expired CacheFirst entries, and NetworkOnly requests. Cache hits and
# CacheOnly requests do not consume this quota.
user_dht_quota = "2r/s"
# Optional user-initiated DHT operation burst size.
# Defaults to the DHT quota rate when omitted.
user_dht_burst = 10
