fix: remove Synapse admin API path — use admin-room reset exclusively (tuwunel only)

This commit is contained in:
atlas 2026-06-04 15:07:48 +02:00 committed by mara
commit a56badd004
2 changed files with 19 additions and 54 deletions

View file

@ -478,7 +478,6 @@ async fn matrix_reset_password(name: &str) -> Result<()> {
);
}
let admin_token = hive_c0re::matrix::read_admin_token()?;
let new_password = hive_c0re::matrix::random_password().context("generate random password")?;
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(30))
.build()
@ -486,16 +485,10 @@ async fn matrix_reset_password(name: &str) -> Result<()> {
let server_name = hive_c0re::matrix::discover_server_name(&client)
.await
.context("discover matrix server_name")?;
hive_c0re::matrix::reset_user_password(
&client,
&admin_token,
name,
&server_name,
&new_password,
)
.await
.with_context(|| format!("matrix reset-password {name}"))?;
// Password is persisted by reset_user_password (including admin-room path).
hive_c0re::matrix::reset_user_password(&client, &admin_token, name, &server_name)
.await
.with_context(|| format!("matrix reset-password {name}"))?;
// Password is persisted by reset_user_password.
let pw_path = PathBuf::from("/var/lib/hyperhive/matrix-creds").join(format!("{name}-password"));
println!("matrix: password for @{name}:{server_name} reset");
println!("password persisted at: {}", pw_path.display());