server: Add an option to force reset the admin password

This commit is contained in:
Valentin Tolmer
2023-12-21 13:54:46 +01:00
committed by nitnelave
parent 9ac96e8c6e
commit ff0ea51121
4 changed files with 28 additions and 0 deletions

View File

@@ -107,6 +107,18 @@ async fn set_up_server(config: Configuration) -> Result<ServerBuilder> {
.await
.map_err(|e| anyhow!("Error setting up admin login/account: {:#}", e))
.context("while creating the admin user")?;
} else if config.force_ldap_user_pass_reset {
warn!("Forcing admin password reset to the config-provided password");
register_password(
&backend_handler,
&config.ldap_user_dn,
&config.ldap_user_pass,
)
.await
.context(format!(
"while resetting admin password for {}",
&config.ldap_user_dn
))?;
}
let server_builder = infra::ldap_server::build_ldap_server(
&config,