Parent [>]
1//! Application configuration set once at startup.
2//!
3//! Compile-time constants ([`PKG_NAME`], [`PKG_VERSION`]) are read from
4//! `Cargo.toml` via `env!()`.  Runtime configuration is stored in
5//! [`SiteConfig`] and threaded through [`AppState`](crate::routes::AppState)
6//! rather than held in process-global statics.
7
8/// Package name read from `Cargo.toml` at compile time.
9pub const PKG_NAME: &str = env!("CARGO_PKG_NAME");
10
11/// Package version read from `Cargo.toml` at compile time.
12pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
13
14/// Site-wide configuration set once at startup and shared across all handlers.
15#[derive(Clone)]
16pub struct SiteConfig {
17    pub site_name: String,
18    pub hostname: String,
19    pub ssh_prefix: String,
20    pub base_url: String,
21    pub favicon: Vec<u8>,
22    pub favicon_mime: &'static str,
23}