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"))