server/adm: Also honor ATTIC_SERVER_CONFIG_BASE64

This commit is contained in:
Zhaofeng Li 2023-01-01 20:59:02 -07:00
parent 06332b7cc3
commit 49f2ccbff8

View file

@ -34,8 +34,9 @@ async fn main() -> Result<()> {
let opts = Opts::parse();
let config = if let Some(config_path) = &opts.config {
config::load_config_from_path(config_path)
} else if let Ok(config_env) = env::var("ATTIC_SERVER_CONFIG") {
config::load_config_from_str(&config_env)
} else if let Ok(config_env) = env::var("ATTIC_SERVER_CONFIG_BASE64") {
let decoded = String::from_utf8(base64::decode(config_env.as_bytes())?)?;
config::load_config_from_str(&decoded)
} else {
config::load_config_from_path(&config::get_xdg_config_path()?)
};