1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-26 10:44:51 +03:00

Split the full config with partial configs used by some sub-commands

This commit is contained in:
Quentin Gliech
2023-06-26 17:03:16 +02:00
parent dec9310a32
commit 8c42563e61
18 changed files with 135 additions and 23 deletions

View File

@@ -15,7 +15,7 @@
use std::collections::HashSet;
use clap::Parser;
use mas_config::{ConfigurationSection, RootConfig};
use mas_config::{ConfigurationSection, RootConfig, SyncConfig};
use mas_storage::{
upstream_oauth2::UpstreamOAuthProviderRepository, Repository, RepositoryAccess, SystemClock,
};
@@ -142,7 +142,7 @@ async fn sync(root: &super::Options, prune: bool, dry_run: bool) -> anyhow::Resu
let mut rng = rand_chacha::ChaChaRng::from_entropy();
let clock = SystemClock::default();
let config: RootConfig = root.load_config()?;
let config: SyncConfig = root.load_config()?;
let encrypter = config.secrets.encrypter();
let pool = database_from_config(&config.database).await?;
let mut repo = PgRepository::from_pool(&pool).await?.boxed();