From 72ec33636b354cf621015fad7556da0fae173ad0 Mon Sep 17 00:00:00 2001 From: Paul Z Date: Wed, 18 Oct 2023 16:31:02 +0200 Subject: [PATCH] DATA_PATH env var --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 480f8fd..4104328 100644 --- a/src/main.rs +++ b/src/main.rs @@ -101,13 +101,15 @@ async fn main() { .await .expect("Oidc Authentication Client"); - let garbage_collector = GarbageCollector::new("./data".to_string()).await; + let data_path = env::var("DATA_PATH").expect("DATA_PATH env var"); + + let garbage_collector = GarbageCollector::new(data_path.clone()).await; garbage_collector.spawn(); let state: AppState = AppState { application_base, oidc_application, - data: "./data".to_string(), + data: data_path, key_salt: KeySalt::from_str(&env::var("KEY_SALT").expect("KEY_SALT env var")) .expect("KEY SALT valid hex"), id_salt: IdSalt::from_str(&env::var("ID_SALT").expect("ID_SALT env var"))