Skip to main content

Module config

Module config 

Source
Expand description

Loads and validates server configuration.

Configuration types preserve startup sources for reloads and expose typed settings to the rest of the workspace. Field documentation also supplies the generated example configuration.

Re-exportsΒ§

use std::borrow::Cow; πŸ”’
use std::collections::BTreeMap; πŸ”’
use std::collections::BTreeSet; πŸ”’
use std::iter::once; πŸ”’
use std::path::Path; πŸ”’
use std::path::PathBuf; πŸ”’
use bytesize::ByteSize; πŸ”’
use derive_more::Debug; πŸ”’
use figment::Error as FigmentError; πŸ”’
use figment::Profile as FigmentProfile; πŸ”’
use figment::Provider; πŸ”’
use figment::Source; πŸ”’
use figment::providers::Env; πŸ”’
use figment::providers::Format; πŸ”’
use itertools::Itertools; πŸ”’
use regex::RegexSet; πŸ”’
pub use rocksdb::Rocksdb;
use ruma::OwnedMxcUri; πŸ”’
use ruma::OwnedRoomOrAliasId; πŸ”’
use ruma::OwnedServerName; πŸ”’
use ruma::OwnedUserId; πŸ”’
use ruma::api::client::discovery::discover_support::ContactRole; πŸ”’
use serde::Deserialize; πŸ”’
use serde::Deserialize; πŸ”’
use serde::de::IgnoredAny; πŸ”’
use smallstr::SmallString; πŸ”’
use tuwunel_macros::config_example_generator; πŸ”’
use url::Url; πŸ”’
pub use self::admin::Admin;
pub use self::appservice_client::AppserviceClient;
pub use self::authentication::Authentication;
pub use self::cache::Cache;
pub use self::check::check;
pub use self::client::Client;
pub use self::compatibility::Compatibility;
pub use self::configuration::Configuration;
pub use self::database::Database;
pub use self::directory::Directory;
pub use self::encryption::Encryption;
pub use self::federation::Federation;
pub use self::http::Http;
pub use self::ip_source::IpSource;
pub use self::ip_source::UNIX_SOCKET_PEER;
pub use self::logging::Logging;
pub use self::manager::Manager;
pub use self::media::Media;
pub use self::network::Network;
pub use self::presence::Presence;
pub use self::profile::Profile;
pub use self::push::Push;
pub use self::read_receipts::ReadReceipts;
pub use self::regenerate::Overwrite;
pub use self::regenerate::RegenerateOptions;
pub use self::regenerate::RegenerationSummary;
pub use self::regenerate::example_config;
pub use self::regenerate::regenerate_config;
pub use self::regenerate::write_example_config;
pub use self::registration::Registration;
pub use self::rendezvous::Rendezvous;
pub use self::rooms::Rooms;
pub use self::runtime::Runtime;
pub use self::sending::Sending;
pub use self::sources::Sources;
pub use self::telemetry::Telemetry;
pub use self::tracing::Tracing;
pub use self::turn::Turn;
pub use self::typing::Typing;
use self::format::Toml; πŸ”’
use self::normalize::assert_canonical; πŸ”’
use self::normalize::environment; πŸ”’
use self::normalize::normalize as normalize_provider; πŸ”’
use self::normalize::redact_error; πŸ”’
use self::normalize::unknown; πŸ”’
use self::proxy::ProxyConfig; πŸ”’
use crate::Err; πŸ”’
use crate::Error; πŸ”’
use crate::Result; πŸ”’
use crate::err; πŸ”’
use crate::implement; πŸ”’
use crate::redacted_debug; πŸ”’
use crate::utils; πŸ”’
use crate::utils::BoolExt; πŸ”’
use crate::utils::bytes::deserialize_bytesize_u64; πŸ”’
use crate::utils::bytes::deserialize_bytesize_usize; πŸ”’
use crate::utils::hash::Cost; πŸ”’
use crate::utils::sys; πŸ”’

ModulesΒ§

admin
Configures server administration and command output.
appservice_client
Configures outgoing application-service transport.
authentication
Configures account authentication and session lifetimes.
cache
Configures cache capacities and space hierarchy retention.
check
Validates configuration before startup and reload.
client
Configures client-facing protocol behavior.
compatibility
Configures compatibility behavior across room versions.
configuration
Configures loading and reloading policy.
database
Configures online database backups and request workers.
directory
Configures room and user discovery.
encryption
Configures encrypted rooms and device-key distribution.
federation
Configures federation access and local state derivation.
format πŸ”’
http
Configures incoming HTTP requests, listeners, and response compression.
identity_provider_serde πŸ”’
ip_source
Defines sources for trusted client IP extraction.
jwt πŸ”’
Turns the JWT key settings into signing and verifying keys and an algorithm.
logging
Configures log filtering, formatting, and output.
manager
Maintains the active reloadable configuration.
media
Configures media storage and processing.
net πŸ”’
network
Configures outbound discovery, DNS, and HTTP clients.
normalize πŸ”’
presence
Configures local and federated presence.
profile
Configures profile access, updates, and remote caching.
proxy
Defines outbound proxy configuration and domain matching.
push
Configures push-gateway delivery and notification policy.
read_receipts
Configures federated read receipts.
regenerate πŸ”’
registration
Configures account registration and initial user setup.
rendezvous
Configures QR sign-in rendezvous sessions.
rocksdb πŸ”’
Configures the RocksDB engine and its resource limits.
room_version
Defines supported Matrix room-version policy.
rooms
Configures room creation, access, and lifecycle.
runtime
Configures stream concurrency and batching.
sending
Configures outbound delivery workers and retries.
sources
Defines the inputs used to assemble configuration.
telemetry
Configures optional external telemetry.
tracing
Configures developer tracing tools.
turn
Configures TURN relay credentials and servers.
typing
Configures typing notifications.
well_known
Converts discovery configuration into Matrix API values.

StructsΒ§

AppService
Application services (bridges and bots)
AppServiceNamespace
Appservice namespaces
Config
Global settings
Figment
Combiner of [Provider]s for configuration value extraction.
IdentityProvider
Upstream identity providers (SSO)
JwtConfig
JSON Web Token login
LdapConfig
LDAP login
LoginAccountRateLimit
Successful sign-in limit
LoginAddressRateLimit
Per-address attempt limit
LoginFailedRateLimit
Wrong-password limit
LoginRateLimits
Password sign-in limits
RateLimits
Rate limits
SmtpConfig
Outbound email (SMTP)
StorageProviderGcs
Google Cloud Storage provider
StorageProviderLocal
Local filesystem storage provider
StorageProviderS3
S3 storage provider
SupportContact
Support contact
SupportPolicy
Support policy document
SupportPolicyTranslation
Support policy translation
TermsPolicy
Registration terms
TermsPolicyTranslation
Registration terms translation
TlsConfig
Direct TLS
WellKnownConfig
Matrix discovery (well-known) responses

EnumsΒ§

FigmentValue
An enum representing all possible figment value variants.
StorageProvider
Selects the backend for a named media storage provider.

ConstantsΒ§

ENV_PREFIXES πŸ”’
TUWUNEL_CONFIG_SECTION_APPSERVICE πŸ”’
TUWUNEL_CONFIG_SECTION_APPSERVICENAMESPACE πŸ”’
TUWUNEL_CONFIG_SECTION_CONFIG πŸ”’
TUWUNEL_CONFIG_SECTION_IDENTITYPROVIDER πŸ”’
TUWUNEL_CONFIG_SECTION_JWTCONFIG πŸ”’
TUWUNEL_CONFIG_SECTION_LDAPCONFIG πŸ”’
TUWUNEL_CONFIG_SECTION_LOGINACCOUNTRATELIMIT πŸ”’
TUWUNEL_CONFIG_SECTION_LOGINADDRESSRATELIMIT πŸ”’
TUWUNEL_CONFIG_SECTION_LOGINFAILEDRATELIMIT πŸ”’
TUWUNEL_CONFIG_SECTION_LOGINRATELIMITS πŸ”’
TUWUNEL_CONFIG_SECTION_RATELIMITS πŸ”’
TUWUNEL_CONFIG_SECTION_SMTPCONFIG πŸ”’
TUWUNEL_CONFIG_SECTION_STORAGEPROVIDERGCS πŸ”’
TUWUNEL_CONFIG_SECTION_STORAGEPROVIDERLOCAL πŸ”’
TUWUNEL_CONFIG_SECTION_STORAGEPROVIDERS3 πŸ”’
TUWUNEL_CONFIG_SECTION_SUPPORTCONTACT πŸ”’
TUWUNEL_CONFIG_SECTION_SUPPORTPOLICY πŸ”’
TUWUNEL_CONFIG_SECTION_SUPPORTPOLICYTRANSLATION πŸ”’
TUWUNEL_CONFIG_SECTION_TERMSPOLICY πŸ”’
TUWUNEL_CONFIG_SECTION_TERMSPOLICYTRANSLATION πŸ”’
TUWUNEL_CONFIG_SECTION_TLSCONFIG πŸ”’
TUWUNEL_CONFIG_SECTION_WELLKNOWNCONFIG πŸ”’

StaticsΒ§

DEPRECATED_KEYS πŸ”’
Items listed here generate a deprecation warning when configured.
KNOWN_KEYS πŸ”’
Items matched here will not generate an β€œunknown to tuwunel” warning when configured. This is important for environment variables which share the TUWUNEL_ prefix namespace but aren’t config items; match them here in their split+lowercased format.

FunctionsΒ§

default_database_path πŸ”’
default_jwt_algorithm πŸ”’
default_jwt_format πŸ”’
default_ldap_search_filter πŸ”’
default_ldap_uid_attribute πŸ”’
default_login_account_burst_count πŸ”’
default_login_account_per_second πŸ”’
default_login_address_burst_count πŸ”’
default_login_address_per_second πŸ”’
default_login_failed_burst_count πŸ”’
default_login_failed_per_second πŸ”’
default_multipart_part_size πŸ”’
default_multipart_threshold πŸ”’
default_sso_grant_session_duration πŸ”’
extraction_error πŸ”’
parallelism_scaled πŸ”’
parallelism_scaled_f64 πŸ”’
parallelism_scaled_u32 πŸ”’
some_true_fn πŸ”’
true_fn πŸ”’
with_unknown πŸ”’

Type AliasesΒ§

ProviderSection
Names a storage provider section and holds its settings.
ServerUserLocalpart
Stores the configured localpart for the server’s administrative user.
StorageBucketName
Stores an object-storage bucket name inline in the common case.