summaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/config')
-rw-r--r--src/config/environment.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/config/environment.rs b/src/config/environment.rs
index 8f91f0c..a4cb528 100644
--- a/src/config/environment.rs
+++ b/src/config/environment.rs
@@ -74,12 +74,8 @@ impl EnvironmentConfig {
};
if let Ok(seed) = env::var(ROUGHENOUGH_SEED) {
- cfg.seed = hex::decode(&seed).expect(
- format!(
- "invalid seed value: {}\n'seed' should be 32 byte hex value",
- seed
- ).as_ref(),
- );
+ cfg.seed = hex::decode(&seed)
+ .expect("invalid seed value; 'seed' should be a hex value");
};
if let Ok(batch_size) = env::var(ROUGHENOUGH_BATCH_SIZE) {
@@ -96,6 +92,12 @@ impl EnvironmentConfig {
cfg.status_interval = Duration::from_secs(val as u64);
};
+ if let Ok(key_protection) = env::var(ROUGHENOUGH_KEY_PROTECTION) {
+ cfg.key_protection = key_protection
+ .parse()
+ .expect(format!("invalid key_protection value: {}", key_protection).as_ref());
+ }
+
Ok(cfg)
}
}