//! Multithreaded: MNW-integrated forum software. //! //! # Design //! //! The competitive positioning, moderation policy, and rollback runbook live in //! the maintainer wiki; audit and fuzz findings are tracked as problems in //! GoingsOn. //! pub mod auth; pub mod chat; pub mod config; pub mod csrf; pub mod error_page; pub mod internal_auth; pub mod link_preview; pub mod maintenance; pub mod routes; pub mod seed; pub mod static_assets; pub mod storage; pub mod templates; pub mod tls; pub mod trust_store; pub mod trusted_proxy; use config::Config; use sqlx::PgPool; use std::sync::Arc; /// Shared application state available to all handlers. #[derive(Clone)] pub struct AppState { pub db: PgPool, pub config: Config, pub http: reqwest::Client, /// Link preview fetcher. `LinkPreviewFetcher::Http` in production with an /// SSRF-safe redirect policy; `LinkPreviewFetcher::Noop` in tests. pub link_preview: link_preview::LinkPreviewFetcher, pub s3: Option>, /// Live chat: the fan-out hub and the per-(user, room) send budgets. /// /// One per process. Rooms are created lazily when someone listens and /// pruned when the last listener leaves, so a deployment where no community /// has chat enabled carries an empty map and nothing else. pub chat: Arc, /// Display names and avatars for chat, cached with a TTL and a hard cap. /// Shared with the profile-update path, which invalidates on rename. pub chat_identities: chat::IdentityCache, }