From 9499c195230a7d5adaebd46892b373c86c5248c2 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 20 Jan 2024 14:47:39 +0100 Subject: seperate secrets config file --- base/src/lib.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'base/src/lib.rs') 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 = LazyLock::new(|| { @@ -20,9 +23,13 @@ pub static CONF: LazyLock = 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 = LazyLock::new(|| { + serde_yaml::from_reader(File::open(&CONF.secrets_path).expect("secrets file missing")) + .expect("secrets config invalid") }); pub trait AssetLocationExt { -- cgit v1.2.3-70-g09d2