mirror of
https://github.com/Blah-IM/blahrs.git
synced 2025-05-01 00:31:09 +00:00
111 lines
3.8 KiB
TOML
111 lines
3.8 KiB
TOML
# The example configuration file, required options are documented as
|
|
# `(Required)`, other options are optional and the example value given here is
|
|
# the default value, or example values for commented lines.
|
|
|
|
[database]
|
|
# If enabled, a in-memory non-persistent database is used instead. Options
|
|
# `path` and `create` are ignored. This should only be used for testing.
|
|
in_memory = false
|
|
|
|
# The path to the main SQLite database.
|
|
# The file will be created and initialized if not exist, but missing directory
|
|
# will not.
|
|
path = "/var/lib/blahd/db.sqlite"
|
|
|
|
# Whether to create and initialize the database if `path` does not exist.
|
|
# Note that parent directory will never be created and must already exist.
|
|
create = true
|
|
|
|
# Listener socket configuration. (Required)
|
|
# There must be exact one option under this section being set.
|
|
[listen]
|
|
# Listen on an address.
|
|
address = "localhost:8080"
|
|
|
|
# Use systemd socket activation mechanism to get listener fd from envvars.
|
|
# See also sd_listen_fds(3) and systemd.socket(5).
|
|
# NB. Currently only TCP sockets are supported. UNIX domain socket support is
|
|
# blocked by axum 0.5, see https://github.com/tokio-rs/axum/pull/2941
|
|
#systemd = true
|
|
|
|
[server]
|
|
# (Required)
|
|
# The global absolute URL prefix where this service is hosted.
|
|
# It is for link generation and must not have trailing slash.
|
|
base_url = "http://localhost:8080"
|
|
|
|
# Maximum number of items in a single response, eg. get chat items.
|
|
# More items will be paged.
|
|
max_page_len = 1024
|
|
|
|
# Maximum request body length in bytes.
|
|
max_request_len = 4096
|
|
|
|
# The maximum timestamp tolerance in seconds for request validation.
|
|
# NB. This should be small enough to reject timestamps overflowing `i64`,
|
|
# otherwise it may cause panics.
|
|
timestamp_tolerance_secs = 90
|
|
|
|
[server.feed]
|
|
# Additional page length limit for room feed.
|
|
# Feed are fetched frequently and older items are rarely useful. You do want a
|
|
# large response for feed.
|
|
max_page_len = 64
|
|
|
|
[server.ws]
|
|
|
|
# The max waiting time for the first authentication message for websocket.
|
|
auth_timeout_sec = 15
|
|
|
|
# The max waiting time for outgoing message to be received for websocket.
|
|
send_timeout_sec = 15
|
|
|
|
# Maximum number of pending events a single user can have.
|
|
# If events overflow the pending buffer, older events will be dropped and
|
|
# client will be notified.
|
|
event_queue_len = 1024
|
|
|
|
[server.register]
|
|
# Allow public registration.
|
|
enable_public = false
|
|
|
|
# The timeout in seconds for fetching user `id_url`.
|
|
request_timeout_secs = 5
|
|
|
|
# The maximum response length in bytes of user's identity description.
|
|
max_identity_description_bytes = 65536
|
|
|
|
# [UNSAFE] Also accept HTTP `id_url`. By default only HTTPS is allowed.
|
|
# This should only be used for testing.
|
|
unsafe_allow_id_url_http = false
|
|
|
|
# [UNSAFE] Also accept `id_url` with custom port.
|
|
# This should only be used for testing.
|
|
unsafe_allow_id_url_custom_port = false
|
|
|
|
# The difficulty of Proof of Work (PoW) challenge to avoid API abuse.
|
|
# It demands at least `difficulty` number of leading zeros in SHA256.
|
|
# Currently only PoW challenge is supported.
|
|
# A zero difficulty effectively disables the challenge.
|
|
[server.register.challenge.pow]
|
|
# The difficulty.
|
|
# On average `2^difficulty` SHA256 ops are required to complete the challenge.
|
|
difficulty = 16
|
|
|
|
# The challenge nonce rotation period in seconds.
|
|
nonce_rotate_secs = 60
|
|
|
|
# If this section appears, the prometheus metrics tracking is enabled.
|
|
# The server must be built with "prometheus" feature enabled to support this.
|
|
#[metric.prometheus]
|
|
|
|
# The listen address for the metrics server, in the same type as `[listen]`.
|
|
# GET on route `/metrics` responds in Prometheus Exposition Format.
|
|
# See more: https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format
|
|
#listen.systemd = true
|
|
|
|
# Upkeep interval in seconds.
|
|
#upkeep_period_secs = 5
|
|
|
|
# The bucket width in seconds for histograms.
|
|
#bucket_duration_secs = 20
|