Parent
[>]
1//! Global application configuration set once at startup. 2//! 3//! Values are stored in `OnceLock` statics and accessed via the corresponding 4//! getter functions. All setters accept `Option` and silently skip `None`. 5 6use OnceLock; 7 8/// Package name read from `Cargo.toml` at compile time. 9pub const PKG_NAME: &str = env!; 10 11/// Package version read from `Cargo.toml` at compile time. 12pub const PKG_VERSION: &str = env!; 13 14static HOSTNAME: = new; 15static SSH_PREFIX: = new; 16static BASE_URL: = new; 17static FAVICON: = new; 18static FAVICON_MIME: = new; 19 20/// Returns the configured hostname, or `"index"` if none was provided. 21 24 25/// Returns the configured SSH prefix, or an empty string if none was provided. 26 29 30/// Returns the configured base URL path prefix, or an empty string if none was 31/// provided. 32 35 36/// Returns the favicon bytes loaded at startup. 37 40 41/// Returns the MIME type of the favicon. 42 45 46/// Sets the hostname shown in breadcrumbs and clone URLs. 47/// Silently skips `None`. 48 53 54/// Sets the path prefix used in SSH clone URLs. Silently skips `None`. 55 60 61/// Sets the URL path prefix for reverse-proxy deployments. 62/// Silently skips `None`. 63 68 69/// Sets the favicon bytes and MIME type served at `/favicon.ico`. 70