From 7b2575c646968662f29652d90aa2634948dc6f8c Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Tue, 3 Jan 2023 14:45:23 +0100 Subject: [PATCH 1/2] Master Key -> master key --- meilisearch/src/main.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/meilisearch/src/main.rs b/meilisearch/src/main.rs index e3309dde8..3bcae4671 100644 --- a/meilisearch/src/main.rs +++ b/meilisearch/src/main.rs @@ -43,7 +43,7 @@ async fn main() -> anyhow::Result<()> { anyhow::bail!( "In production mode, the master key must be of at least {MASTER_KEY_MIN_SIZE} characters, but the provided key is only {} characters long -We generated a secure Master Key for you (you can safely copy this token): +We generated a secure master key for you (you can safely copy this token): >> export MEILI_MASTER_KEY={} <<", master_key.len(), @@ -54,7 +54,7 @@ We generated a secure Master Key for you (you can safely copy this token): anyhow::bail!( "In production mode, you must provide a master key to secure your instance. It can be specified via the MEILI_MASTER_KEY environment variable or the --master-key launch option. -We generated a secure Master Key for you (you can safely copy this token): +We generated a secure master key for you (you can safely copy this token): >> export MEILI_MASTER_KEY={} << ", @@ -173,24 +173,24 @@ Anonymous telemetry:\t\"Enabled\"" match (opt.env.as_ref(), &opt.master_key) { ("production", Some(_)) => { - eprintln!("A Master Key has been set. Requests to Meilisearch won't be authorized unless you provide an authentication key."); + eprintln!("A master key has been set. Requests to Meilisearch won't be authorized unless you provide an authentication key."); } ("development", Some(master_key)) => { - eprintln!("A Master Key has been set. Requests to Meilisearch won't be authorized unless you provide an authentication key."); + eprintln!("A master key has been set. Requests to Meilisearch won't be authorized unless you provide an authentication key."); if master_key.len() < MASTER_KEY_MIN_SIZE { eprintln!(); log::warn!( - "The provided Master Key is too short (< {MASTER_KEY_MIN_SIZE} characters)" + "The provided master key is too short (< {MASTER_KEY_MIN_SIZE} characters)" ); - eprintln!("A Master Key of at least {MASTER_KEY_MIN_SIZE} characters will be required when switching to the production environment."); - eprintln!("Restart Meilisearch with the `--generate-master-key` flag to generate a secure Master Key you can use"); + eprintln!("A master key of at least {MASTER_KEY_MIN_SIZE} characters will be required when switching to the production environment."); + eprintln!("Restart Meilisearch with the `--generate-master-key` flag to generate a secure master key you can use"); } } ("development", None) => { log::warn!("No master key found; The server will accept unidentified requests"); eprintln!("If you need some protection in development mode, please export a key:\n\nexport MEILI_MASTER_KEY={}", generate_master_key()); - eprintln!("\nA Master Key of at least {MASTER_KEY_MIN_SIZE} characters will be required when switching to the production environment."); + eprintln!("\nA master key of at least {MASTER_KEY_MIN_SIZE} characters will be required when switching to the production environment."); } // unreachable because Opt::try_build above would have failed already if any other value had been produced _ => unreachable!(), From 17dac72464ad06495ed68467b233de359b46aba3 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Tue, 3 Jan 2023 14:50:50 +0100 Subject: [PATCH 2/2] Characters -> bytes --- meilisearch/src/main.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/meilisearch/src/main.rs b/meilisearch/src/main.rs index 3bcae4671..1bda54505 100644 --- a/meilisearch/src/main.rs +++ b/meilisearch/src/main.rs @@ -41,7 +41,7 @@ async fn main() -> anyhow::Result<()> { match (opt.env.as_ref(), &opt.master_key) { ("production", Some(master_key)) if master_key.len() < MASTER_KEY_MIN_SIZE => { anyhow::bail!( - "In production mode, the master key must be of at least {MASTER_KEY_MIN_SIZE} characters, but the provided key is only {} characters long + "In production mode, the master key must be of at least {MASTER_KEY_MIN_SIZE} bytes, but the provided key is only {} bytes long We generated a secure master key for you (you can safely copy this token): @@ -180,17 +180,15 @@ Anonymous telemetry:\t\"Enabled\"" if master_key.len() < MASTER_KEY_MIN_SIZE { eprintln!(); - log::warn!( - "The provided master key is too short (< {MASTER_KEY_MIN_SIZE} characters)" - ); - eprintln!("A master key of at least {MASTER_KEY_MIN_SIZE} characters will be required when switching to the production environment."); + log::warn!("The provided master key is too short (< {MASTER_KEY_MIN_SIZE} bytes)"); + eprintln!("A master key of at least {MASTER_KEY_MIN_SIZE} bytes will be required when switching to the production environment."); eprintln!("Restart Meilisearch with the `--generate-master-key` flag to generate a secure master key you can use"); } } ("development", None) => { log::warn!("No master key found; The server will accept unidentified requests"); eprintln!("If you need some protection in development mode, please export a key:\n\nexport MEILI_MASTER_KEY={}", generate_master_key()); - eprintln!("\nA master key of at least {MASTER_KEY_MIN_SIZE} characters will be required when switching to the production environment."); + eprintln!("\nA master key of at least {MASTER_KEY_MIN_SIZE} bytes will be required when switching to the production environment."); } // unreachable because Opt::try_build above would have failed already if any other value had been produced _ => unreachable!(),