Files
2026-10-07 23:16:17 +02:00

24 lines
838 B
Rust

use std::env;
pub struct Config {
pub config_dir: String,
pub archive_dir: String,
pub lrzip_path: String,
pub tar_path: String,
pub shell_path: String,
pub docker_image: String,
}
impl Config {
pub fn load() -> Self {
Self {
config_dir: env::var("DMM_CONFIG_DIR").unwrap_or_else(|_| "/home/tom/mc_servers".to_string()),
archive_dir: env::var("DMM_ARCHIVE_DIR").unwrap_or_else(|_| "/raid/crit/mc_servers_archives".to_string()),
lrzip_path: env::var("DMM_LRZIP_PATH").unwrap_or_else(|_| "lrzip".to_string()),
tar_path: env::var("DMM_TAR_PATH").unwrap_or_else(|_| "tar".to_string()),
shell_path: env::var("DMM_SHELL_PATH").unwrap_or_else(|_| "sh".to_string()),
docker_image: "itzg/minecraft-server".to_string(),
}
}
}