aboutsummaryrefslogtreecommitdiff
path: root/base/src/lib.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-01-20 14:47:39 +0100
committermetamuffin <metamuffin@disroot.org>2024-01-20 14:47:39 +0100
commit9499c195230a7d5adaebd46892b373c86c5248c2 (patch)
treeff652e9959dc2f0349a4e5aed75e8837b452e45f /base/src/lib.rs
parent730353601db9818d148c85bfe1ecb119abaab7cc (diff)
downloadjellything-9499c195230a7d5adaebd46892b373c86c5248c2.tar
jellything-9499c195230a7d5adaebd46892b373c86c5248c2.tar.bz2
jellything-9499c195230a7d5adaebd46892b373c86c5248c2.tar.zst
seperate secrets config file
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 {