Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Minor drive-by tweaks #2779

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/cli/src/commands/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ See {DOCS_BASE}/setup/homeserver.html",
if !issuer.starts_with("https://") {
warn!(
r#"⚠️ The issuer in the config (`http.issuer`/`http.public_base`) is not an HTTPS URL.
This means some client will refuse to use it."#
This means some clients will refuse to use it."#
);
}

Expand Down Expand Up @@ -391,7 +391,7 @@ Error details: {e}
} else {
warn!(
r#"⚠️ The legacy login API at "{compat_login}" is reachable, but it doesn't look to be handled by MAS.
This means legacy client won't be able to login.
This means legacy clients won't be able to login.
Make sure MAS is running.
Check your reverse proxy settings to make sure that this API is handled by MAS, not by Synapse.

Expand All @@ -413,7 +413,7 @@ See {DOCS_BASE}/setup/reverse-proxy.html
}
Err(e) => warn!(
r#"⚠️ Can't reach the legacy login API at "{compat_login}".
This means legacy client won't be able to login.
This means legacy clients won't be able to login.
Make sure MAS is running.
Check your reverse proxy settings to make sure that this API is handled by MAS, not by Synapse.

Expand Down
6 changes: 3 additions & 3 deletions crates/cli/src/commands/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use crate::{
#[allow(clippy::struct_excessive_bools)]
#[derive(Parser, Debug, Default)]
pub(super) struct Options {
/// Do not apply pending migrations on start
/// Do not apply pending database migrations on start
#[arg(long)]
no_migrate: bool,

Expand Down Expand Up @@ -88,12 +88,12 @@ impl Options {
return Err(anyhow::anyhow!("The server is running with `--no-migrate` but there are pending. Please run them first with `mas-cli database migrate`, or omit the `--no-migrate` flag to apply them automatically on startup."));
}
} else {
info!("Running pending migrations");
info!("Running pending database migrations");
MIGRATOR
.run(&pool)
.instrument(info_span!("db.migrate"))
.await
.context("could not run migrations")?;
.context("could not run database migrations")?;
}

let encrypter = config.secrets.encrypter();
Expand Down
5 changes: 3 additions & 2 deletions crates/config/src/sections/passwords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::cmp::Reverse;

use anyhow::bail;
use camino::Utf8PathBuf;
use schemars::JsonSchema;
Expand Down Expand Up @@ -104,9 +106,8 @@ impl PasswordsConfig {
&self,
) -> Result<Vec<(u16, Algorithm, Option<u32>, Option<Vec<u8>>)>, anyhow::Error> {
let mut schemes: Vec<&HashingScheme> = self.schemes.iter().collect();
schemes.sort_unstable_by_key(|a| a.version);
schemes.sort_unstable_by_key(|a| Reverse(a.version));
schemes.dedup_by_key(|a| a.version);
schemes.reverse();

if schemes.len() != self.schemes.len() {
// Some schemes had duplicated versions
Expand Down
Loading