Skip to main content

max / makenotwork

693 B · 28 lines History Blame Raw
1 //! Multithreaded — MNW-integrated forum software.
2
3 pub mod auth;
4 pub mod config;
5 pub mod csrf;
6 pub mod internal_auth;
7 pub mod link_preview;
8 pub mod routes;
9 pub mod seed;
10 pub mod storage;
11 pub mod templates;
12
13 use config::Config;
14 use sqlx::PgPool;
15 use std::sync::Arc;
16
17 /// Shared application state available to all handlers.
18 #[derive(Clone)]
19 pub struct AppState {
20 pub db: PgPool,
21 pub config: Config,
22 pub http: reqwest::Client,
23 /// Link preview fetcher. `LinkPreviewFetcher::Http` in production with an
24 /// SSRF-safe redirect policy; `LinkPreviewFetcher::Noop` in tests.
25 pub link_preview: link_preview::LinkPreviewFetcher,
26 pub s3: Option<Arc<storage::S3Storage>>,
27 }
28