Skip to main content

max / makenotwork

974 B · 37 lines History Blame Raw
1 //! Multithreaded: MNW-integrated forum software.
2 //!
3 //! # Design
4 //!
5 //! The competitive positioning, moderation policy, and rollback runbook live in
6 //! the maintainer wiki; the risk history is in the gitignored `docs/audit_review.md`.
7 //! <!-- wiki: mt-overview -->
8
9 pub mod auth;
10 pub mod config;
11 pub mod csrf;
12 pub mod error_page;
13 pub mod internal_auth;
14 pub mod link_preview;
15 pub mod maintenance;
16 pub mod routes;
17 pub mod seed;
18 pub mod storage;
19 pub mod templates;
20 pub mod trusted_proxy;
21
22 use config::Config;
23 use sqlx::PgPool;
24 use std::sync::Arc;
25
26 /// Shared application state available to all handlers.
27 #[derive(Clone)]
28 pub struct AppState {
29 pub db: PgPool,
30 pub config: Config,
31 pub http: reqwest::Client,
32 /// Link preview fetcher. `LinkPreviewFetcher::Http` in production with an
33 /// SSRF-safe redirect policy; `LinkPreviewFetcher::Noop` in tests.
34 pub link_preview: link_preview::LinkPreviewFetcher,
35 pub s3: Option<Arc<storage::S3Storage>>,
36 }
37