wastebin is a pastebin ๐ bin.bloerg.net
pastebin
Something went wrong. Try again.
1.3 kB ยท 31 lines
Rust
at main
1234567891011121314151617181920212223242526272829303132/// Names of environment variables.pub mod vars { /// Address and port the server binds to. pub const ADDRESS_PORT: &str = "WASTEBIN_ADDRESS_PORT"; /// Base URL to use for the QR code link. pub const BASE_URL: &str = "WASTEBIN_BASE_URL"; /// Number of cached items. pub const CACHE_SIZE: &str = "WASTEBIN_CACHE_SIZE"; /// Path to the database file. pub const DATABASE_PATH: &str = "WASTEBIN_DATABASE_PATH"; /// Time before a request times out. pub const HTTP_TIMEOUT: &str = "WASTEBIN_HTTP_TIMEOUT"; /// Maximum body size. pub const MAX_BODY_SIZE: &str = "WASTEBIN_MAX_BODY_SIZE"; /// Password salt for encryption. pub const PASSWORD_SALT: &str = "WASTEBIN_PASSWORD_SALT"; /// Expirations list. pub const PASTE_EXPIRATIONS: &str = "WASTEBIN_PASTE_EXPIRATIONS"; /// Signing key for signed cookie store. pub const SIGNING_KEY: &str = "WASTEBIN_SIGNING_KEY"; /// Theme to use. pub const THEME: &str = "WASTEBIN_THEME"; /// Title. pub const TITLE: &str = "WASTEBIN_TITLE"; /// Unix socket path the server binds to. pub const SOCKET_PATH: &str = "WASTEBIN_UNIX_SOCKET_PATH";}
pub(crate) fn password_hash_salt() -> String { std::env::var(vars::PASSWORD_SALT).unwrap_or_else(|_| "somesalt".to_string())}