aboutsummaryrefslogtreecommitdiff
path: root/base/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'base/src/lib.rs')
-rw-r--r--base/src/lib.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/base/src/lib.rs b/base/src/lib.rs
index a7b15c5..0001caa 100644
--- a/base/src/lib.rs
+++ b/base/src/lib.rs
@@ -10,7 +10,10 @@ pub mod federation;
pub mod permission;
pub mod temp;
-use jellycommon::{config::GlobalConfig, AssetLocation};
+use jellycommon::{
+ config::{GlobalConfig, SecretsConfig},
+ AssetLocation,
+};
use std::{fs::File, path::PathBuf, sync::LazyLock};
pub static CONF: LazyLock<GlobalConfig> = LazyLock::new(|| {
@@ -20,9 +23,13 @@ pub static CONF: LazyLock<GlobalConfig> = LazyLock::new(|| {
"First argument or JELLYTHING_CONFIG must specify the configuration to use.",
)
}))
- .unwrap(),
+ .expect("config cannot be read"),
)
- .unwrap()
+ .expect("config invalid")
+});
+pub static SECRETS: LazyLock<SecretsConfig> = LazyLock::new(|| {
+ serde_yaml::from_reader(File::open(&CONF.secrets_path).expect("secrets file missing"))
+ .expect("secrets config invalid")
});
pub trait AssetLocationExt {