2022-03-01 15:24:17 +01:00
|
|
|
use byte_unit::Byte;
|
|
|
|
|
2022-07-16 14:16:54 +02:00
|
|
|
// General
|
2022-03-01 15:24:17 +01:00
|
|
|
lazy_static! {
|
2022-07-16 14:16:54 +02:00
|
|
|
pub static ref VERSION: String = option_env!("CARGO_PKG_VERSION")
|
|
|
|
.unwrap_or("Unknown")
|
|
|
|
.to_string();
|
|
|
|
}
|
|
|
|
|
|
|
|
// CONFIG
|
|
|
|
lazy_static! {
|
|
|
|
pub static ref LIMIT: usize =
|
2022-03-01 15:24:17 +01:00
|
|
|
Byte::from_str(std::env::var("SIZE_LIMIT").unwrap_or("1 KiB".to_string()))
|
|
|
|
.unwrap()
|
2022-07-16 14:16:54 +02:00
|
|
|
.get_bytes() as usize;
|
2022-03-01 16:16:02 +01:00
|
|
|
pub static ref MAX_VIEWS: u32 = std::env::var("MAX_VIEWS")
|
2022-03-01 15:24:17 +01:00
|
|
|
.unwrap_or("100".to_string())
|
|
|
|
.parse()
|
|
|
|
.unwrap();
|
2022-03-01 16:16:02 +01:00
|
|
|
pub static ref MAX_EXPIRATION: u32 = std::env::var("MAX_EXPIRATION")
|
2022-03-01 15:24:17 +01:00
|
|
|
.unwrap_or("360".to_string()) // 6 hours in minutes
|
|
|
|
.parse()
|
|
|
|
.unwrap();
|
|
|
|
pub static ref ALLOW_ADVANCED: bool = std::env::var("ALLOW_ADVANCED")
|
|
|
|
.unwrap_or("true".to_string())
|
|
|
|
.parse()
|
|
|
|
.unwrap();
|
|
|
|
}
|
2022-07-16 14:16:54 +02:00
|
|
|
|
|
|
|
// THEME
|
|
|
|
lazy_static! {
|
|
|
|
pub static ref THEME_IMAGE: String = std::env::var("THEME_IMAGE")
|
|
|
|
.unwrap_or("".to_string())
|
|
|
|
.parse()
|
|
|
|
.unwrap();
|
|
|
|
pub static ref THEME_TEXT: String = std::env::var("THEME_TEXT")
|
|
|
|
.unwrap_or("".to_string())
|
|
|
|
.parse()
|
|
|
|
.unwrap();
|
|
|
|
}
|