Files
httpserver/src/config.rs
tomoron 4de44e54e7
All checks were successful
build docker container automatically / build (push) Successful in 3m29s
put the upload storage limits back to what they're supposed to be
2026-04-23 18:24:57 +02:00

34 lines
784 B
Rust

#[cfg(feature = "server")]
pub struct ServerConfig {
pub upload_folder: String,
pub db_url: String,
pub upload_storage_limit_soft: u64,
pub upload_storage_limit_hard: u64,
}
#[cfg(feature = "server")]
impl ServerConfig {
pub fn load() -> Self {
Self {
upload_folder: "./uploads/".to_string(),
db_url: std::env::var("HTTPSERVER_DATABASE_URL").expect("missing HTTPSERVER_DATABASE_URL"),
upload_storage_limit_soft: 1024 * 1024 * 1024 * 200,
upload_storage_limit_hard: 1024 * 1024 * 1024 * 300,
}
}
}
pub struct ClientConfig {
pub upload_max_size: u64,
}
impl ClientConfig {
pub fn load() -> Self {
Self {
upload_max_size: 1024 * 1024 * 1024 * 50,
}
}
}