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)
- AppService
Namespace - Appservice namespaces
- Config
- Global settings
- Figment
- Combiner of [
Provider]s for configuration value extraction. - Identity
Provider - Upstream identity providers (SSO)
- JwtConfig
- JSON Web Token login
- Ldap
Config - LDAP login
- Login
Account Rate Limit - Successful sign-in limit
- Login
Address Rate Limit - Per-address attempt limit
- Login
Failed Rate Limit - Wrong-password limit
- Login
Rate Limits - Password sign-in limits
- Rate
Limits - Rate limits
- Smtp
Config - Outbound email (SMTP)
- Storage
Provider Gcs - Google Cloud Storage provider
- Storage
Provider Local - Local filesystem storage provider
- Storage
Provider S3 - S3 storage provider
- Support
Contact - Support contact
- Support
Policy - Support policy document
- Support
Policy Translation - Support policy translation
- Terms
Policy - Registration terms
- Terms
Policy Translation - Registration terms translation
- TlsConfig
- Direct TLS
- Well
Known Config - Matrix discovery (well-known) responses
EnumsΒ§
- Figment
Value - An enum representing all possible figment value variants.
- Storage
Provider - 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_ STORAGEPROVIDER S3 - 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Β§
- Provider
Section - Names a storage provider section and holds its settings.
- Server
User Localpart - Stores the configured localpart for the serverβs administrative user.
- Storage
Bucket Name - Stores an object-storage bucket name inline in the common case.