From c949ca01ebb4e4a041dd83948b361857e6124a0b Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Wed, 25 Oct 2023 11:03:09 -0400 Subject: [PATCH] more closely align config and sample config --- dendrite/dendrite-sample.in.yaml | 76 +++++++++++++++++++++++++++----- dendrite/dendrite.in.yaml | 21 ++++----- 2 files changed, 75 insertions(+), 22 deletions(-) diff --git a/dendrite/dendrite-sample.in.yaml b/dendrite/dendrite-sample.in.yaml index 7affc25..7c6232f 100644 --- a/dendrite/dendrite-sample.in.yaml +++ b/dendrite/dendrite-sample.in.yaml @@ -4,9 +4,39 @@ # configuration section, in addition to the "global" section which applies to # all components. +# NOTES: +# ----------------------------------------------------------------------------- +# +# At a minimum, to get started, you will need to update the settings in the +# "global" section for your deployment, and you will need to check that the +# database "connection_string" line in each component section is correct. +# +# Each component with a "database" section can accept the following formats +# for "connection_string": +# SQLite: file:filename.db +# file:///path/to/filename.db +# PostgreSQL: postgresql://user:pass@hostname/database?params=... +# +# SQLite is embedded into Dendrite and therefore no further prerequisites are +# needed for the database when using SQLite mode. However, performance with +# PostgreSQL is significantly better and recommended for multi-user deployments. +# SQLite is typically around 20-30% slower than PostgreSQL when tested with a +# small number of users and likely will perform worse still with a higher volume +# of users. +# +# The "max_open_conns" and "max_idle_conns" settings configure the maximum +# number of open/idle database connections. The value 0 will use the database +# engine default, and a negative value will use unlimited connections. The +# "conn_max_lifetime" option controls the maximum length of time a database +# connection can be idle in seconds - a negative value is unlimited. +# ----------------------------------------------------------------------------- + # The version of the configuration file. version: 2 +client_api: + registration_shared_secret: ${REGISTRATION_SHARED_SECRET} + # Global Matrix configuration. This configuration applies to all components. global: # The domain name of this homeserver. @@ -41,7 +71,7 @@ global: # sections. For monolith deployments using SQLite databases, # you must configure the "database" block for each component instead. database: - connection_string: postgresql://username:password@hostname/dendrite?sslmode=disable + connection_string: ${DATABASE_URL} max_open_conns: 90 max_idle_conns: 5 conn_max_lifetime: -1 @@ -90,14 +120,14 @@ global: # presence events from other servers, outbound controls whether we send presence # events for our local users to other servers. presence: - enable_inbound: false - enable_outbound: false + enable_inbound: true + enable_outbound: true # Configures phone-home statistics reporting. These statistics contain the server # name, number of active users and some information on your deployment config. # We use this information to understand how Dendrite is being used in the wild. report_stats: - enabled: false + enabled: true endpoint: https://panopticon.matrix.org/push # Server notices allows server admins to send messages to all users on the server. @@ -127,15 +157,39 @@ global: # Persistent directory to store JetStream streams in. This directory should be # preserved across Dendrite restarts. - storage_path: ./ + storage_path: /data/nats # The prefix to use for stream names for this homeserver - really only useful # if you are running more than one Dendrite server on the same NATS deployment. topic_prefix: Dendrite + # Configuration for Kafka/Naffka. + kafka: + # List of Kafka broker addresses to connect to. This is not needed if using + # Naffka in monolith mode. + addresses: + - kafka:9092 + + # The prefix to use for Kafka topic names for this homeserver. Change this only if + # you are running more than one Dendrite homeserver on the same Kafka deployment. + topic_prefix: Dendrite + + # Whether to use Naffka instead of Kafka. This is only available in monolith + # mode, but means that you can run a single-process server without requiring + # Kafka. + use_naffka: true + + # Naffka database options. Not required when using Kafka. + naffka_database: + connection_string: file:///data/dendrite.db + max_open_conns: 10 + max_idle_conns: 2 + conn_max_lifetime: -1 + # Configuration for Prometheus metric collection. metrics: enabled: false + # HTTP basic authentication to protect access to monitoring. basic_auth: username: metrics password: metrics @@ -144,6 +198,8 @@ global: # is no local caching resolver available for use. dns_cache: enabled: false + # Maximum number of entries to hold in the DNS cache, and + # for how long those items should be considered valid in seconds. cache_size: 256 cache_lifetime: "5m" # 5 minutes; https://pkg.go.dev/time@master#ParseDuration @@ -251,7 +307,7 @@ federation_api: # Configuration for the Media API. media_api: # Storage path for uploaded media. May be relative or absolute. - base_path: ./media_store + base_path: /data/media_store # The maximum allowed file size (in bytes) for media uploads to this homeserver # (0 = unlimited). If using a reverse proxy, ensure it allows requests at least @@ -291,10 +347,10 @@ sync_api: # Configuration for the full-text search engine. search: # Whether or not search is enabled. - enabled: false + enabled: true # The path where the search index will be created in. - index_path: "./searchindex" + index_path: "/data/searchindex" # The language most likely to be used on the server - used when indexing, to # ensure the returned results match expectations. A full list of possible languages @@ -325,7 +381,7 @@ user_api: auto_join_rooms: # - "#main:matrix.org" -# Configuration for Opentracing. +# Configuration for OpenTracing. # See https://github.com/matrix-org/dendrite/tree/master/docs/tracing for information on # how this works and how to set it up. tracing: @@ -350,4 +406,4 @@ logging: - type: file level: info params: - path: ./logs + path: /var/logs/dendrite diff --git a/dendrite/dendrite.in.yaml b/dendrite/dendrite.in.yaml index 7c98765..e86a9d0 100644 --- a/dendrite/dendrite.in.yaml +++ b/dendrite/dendrite.in.yaml @@ -34,9 +34,6 @@ # The version of the configuration file. version: 2 -client_api: - registration_shared_secret: ${REGISTRATION_SHARED_SECRET} - # Global Matrix configuration. This configuration applies to all components. global: # The domain name of this homeserver. @@ -188,9 +185,7 @@ global: # Configuration for Prometheus metric collection. metrics: - # Whether or not Prometheus metrics are enabled. enabled: false - # HTTP basic authentication to protect access to monitoring. basic_auth: username: metrics @@ -199,14 +194,13 @@ global: # Optional DNS cache. The DNS cache may reduce the load on DNS servers if there # is no local caching resolver available for use. dns_cache: - # Whether or not the DNS cache is enabled. enabled: false # Maximum number of entries to hold in the DNS cache, and # for how long those items should be considered valid in seconds. cache_size: 256 cache_lifetime: "5m" # 5 minutes; https://pkg.go.dev/time@master#ParseDuration -# Configuration for the AppService API. +# Configuration for the Appservice API. app_service_api: # Disable the validation of TLS certificates of appservices. This is # not recommended in production since it may allow appservice traffic @@ -217,6 +211,8 @@ app_service_api: config_files: # - /path/to/appservice_registration.yaml +# Configuration for the Client API. +client_api: # Prevents new users from being able to register on this homeserver, except when # using the registration shared secret below. registration_disabled: true @@ -227,7 +223,7 @@ app_service_api: # If set, allows registration by anyone who knows the shared secret, regardless # of whether registration is otherwise disabled. - registration_shared_secret: "" + registration_shared_secret: ${REGISTRATION_SHARED_SECRET} # Whether to require reCAPTCHA for registration. If you have enabled registration # then this is HIGHLY RECOMMENDED to reduce the risk of your homeserver being used @@ -235,9 +231,9 @@ app_service_api: enable_registration_captcha: false # Settings for ReCAPTCHA. - # recaptcha_public_key: "" - # recaptcha_private_key: "" - # recaptcha_bypass_secret: "" + recaptcha_public_key: "" + recaptcha_private_key: "" + recaptcha_bypass_secret: "" # To use hcaptcha.com instead of ReCAPTCHA, set the following parameters, otherwise just keep them empty. # recaptcha_siteverify_api: "https://hcaptcha.com/siteverify" @@ -359,6 +355,7 @@ sync_api: language: "en" # Configuration for the User API. +user_api: # The cost when hashing passwords on registration/login. Default: 10. Min: 4, Max: 31 # See https://pkg.go.dev/golang.org/x/crypto/bcrypt for more information. # Setting this lower makes registration/login consume less CPU resources at the cost @@ -379,7 +376,7 @@ sync_api: # make certain it is a publicly joinable room, i.e. the join rule of the room must be set to 'public'. # As Spaces are just rooms under the hood, Space aliases may also be used. auto_join_rooms: - - "#main:matrix.burd.me" + # - "#main:matrix.org" # Configuration for OpenTracing. # See https://github.com/matrix-org/dendrite/tree/master/docs/tracing for information on