mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
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:
8
common/env/src/lib.rs
vendored
Normal file
8
common/env/src/lib.rs
vendored
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user