summaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorStuart Stock <stuart@int08h.com>2018-10-09 20:54:49 -0500
committerStuart Stock <stuart@int08h.com>2018-10-09 20:54:49 -0500
commitc66513b606f6aacf61bab1434c1f512c24981b2b (patch)
tree8f5374f9163366bfd845cd796c087f68f9f9baf2 /src/config
parentbab728c1c5eea847e06e13400dc40a522f2b4d25 (diff)
downloadroughenough-c66513b606f6aacf61bab1434c1f512c24981b2b.zip
continue work on kms
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)
}
}