diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-20 14:47:39 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-20 14:47:39 +0100 |
commit | 9499c195230a7d5adaebd46892b373c86c5248c2 (patch) | |
tree | ff652e9959dc2f0349a4e5aed75e8837b452e45f /base/src/lib.rs | |
parent | 730353601db9818d148c85bfe1ecb119abaab7cc (diff) | |
download | jellything-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.rs | 13 |
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 { |