main,matrix: Read file paths from variables

This commit is contained in:
George Kaklamanos 2023-12-02 14:36:46 +02:00
parent 695b152c7e
commit 9af48cfea1
Signed by: gkaklas
GPG key ID: C0CAB8A6BDC9399D
2 changed files with 3 additions and 1 deletions

View file

@ -68,9 +68,10 @@ async fn on_room_invite(event: StrippedStateEvent<RoomMemberEventContent>, room:
async fn client_login(username: String, password: String, device_id: Option<String>) -> Client {
let user = <&UserId>::try_from(username.as_str()).unwrap();
let path = "/etc/labadoor/sled_store";
let client = Client::builder()
.server_name(user.server_name())
.sled_store("./sled_store", None)
.sled_store(path, None)
.unwrap()
.build()
.await

View file

@ -24,6 +24,7 @@ fn main() -> ExitCode {
let module_result: Result<(), ()>;
let cli = cli::parse();
let path = "/etc/labadoor/config.toml";
let config = config::Config::builder()
.add_source(config::File::with_name(path).required(false))
.add_source(config::Environment::with_prefix("LABADOOR").separator("_"));