Add common crate to access env variables

In the future, we should use a proper secret store (not just env variables).
This lets us update one block of code and not n in the future.
This commit is contained in:
Luke Parker
2023-07-17 00:50:46 -04:00
parent 845c2842b5
commit 0a367bfbda
11 changed files with 54 additions and 4 deletions

8
common/env/src/lib.rs vendored Normal file
View File

@@ -0,0 +1,8 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
// Obtain a variable from the Serai environment/secret store.
pub fn var(variable: &str) -> Option<String> {
// TODO: Move this to Kubernetes
std::env::var(variable).ok()
}