From af25c853b9ca57ad4bc2ff65813f8a5167bd95d9 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 25 May 2022 13:07:19 +0200 Subject: Explore config file generation --- src/test.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test.rs (limited to 'src/test.rs') diff --git a/src/test.rs b/src/test.rs new file mode 100644 index 0000000..4d32a6f --- /dev/null +++ b/src/test.rs @@ -0,0 +1,31 @@ +mod config; + +use serde::Serialize; +use std::collections::HashMap; + +fn main() { + let config = config::Config { + s3_endpoint: "http://127.0.0.1:3900".to_string(), + k2v_endpoint: "http://127.0.0.1:3904".to_string(), + aws_region: "garage".to_string(), + login_static: Some(config::LoginStaticConfig { + default_bucket: Some("mailrage".to_string()), + users: HashMap::from([ + ("quentin".to_string(), config::LoginStaticUser { + password: "toto".to_string(), + aws_access_key_id: "GKxxx".to_string(), + aws_secret_access_key: "ffff".to_string(), + bucket: Some("mailrage-quentin".to_string()), + user_secret: "xxx".to_string(), + alternate_user_secrets: vec![], + master_key: None, + secret_key: None, + }), + ]), + }), + login_ldap: None, + }; + + let ser = toml::to_string(&config).unwrap(); + println!("{}", ser); +} -- cgit v1.2.3