From eb08a0fb0bd4b55e4e25fef83a0d2003a8c95809 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Thu, 5 Jan 2023 14:55:24 +0100 Subject: [PATCH] Remove --generate-master-key option --- meilisearch/src/analytics/segment_analytics.rs | 1 - meilisearch/src/main.rs | 6 ------ meilisearch/src/option.rs | 9 --------- 3 files changed, 16 deletions(-) diff --git a/meilisearch/src/analytics/segment_analytics.rs b/meilisearch/src/analytics/segment_analytics.rs index f95594640..5782063a2 100644 --- a/meilisearch/src/analytics/segment_analytics.rs +++ b/meilisearch/src/analytics/segment_analytics.rs @@ -271,7 +271,6 @@ impl From for Infos { log_level, indexer_options, config_file_path, - generate_master_key: _, #[cfg(all(not(debug_assertions), feature = "analytics"))] no_analytics: _, } = options; diff --git a/meilisearch/src/main.rs b/meilisearch/src/main.rs index 498fa8da2..050c825a8 100644 --- a/meilisearch/src/main.rs +++ b/meilisearch/src/main.rs @@ -29,11 +29,6 @@ async fn main() -> anyhow::Result<()> { setup(&opt)?; - if opt.generate_master_key { - println!("{}", generate_master_key()); - return Ok(()); - } - match (opt.env.as_ref(), &opt.master_key) { ("production", Some(master_key)) if master_key.len() < MASTER_KEY_MIN_SIZE => { anyhow::bail!( @@ -178,7 +173,6 @@ Anonymous telemetry:\t\"Enabled\"" eprintln!(); 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) => { diff --git a/meilisearch/src/option.rs b/meilisearch/src/option.rs index f214cb3bd..ff4ab6776 100644 --- a/meilisearch/src/option.rs +++ b/meilisearch/src/option.rs @@ -47,7 +47,6 @@ const MEILI_IGNORE_MISSING_DUMP: &str = "MEILI_IGNORE_MISSING_DUMP"; const MEILI_IGNORE_DUMP_IF_DB_EXISTS: &str = "MEILI_IGNORE_DUMP_IF_DB_EXISTS"; const MEILI_DUMP_DIR: &str = "MEILI_DUMP_DIR"; const MEILI_LOG_LEVEL: &str = "MEILI_LOG_LEVEL"; -const MEILI_GENERATE_MASTER_KEY: &str = "MEILI_GENERATE_MASTER_KEY"; #[cfg(feature = "metrics")] const MEILI_ENABLE_METRICS_ROUTE: &str = "MEILI_ENABLE_METRICS_ROUTE"; @@ -284,13 +283,6 @@ pub struct Opt { #[serde(default)] pub log_level: LogLevel, - /// Generates a string of characters that can be used as a master key and exits. - /// - /// Pass the generated master key using the `--master-key` argument or the `MEILI_MASTER_KEY` environment variable in a subsequent Meilisearch invocation. - #[clap(long, env = MEILI_GENERATE_MASTER_KEY)] - #[serde(default)] - pub generate_master_key: bool, - /// Enables Prometheus metrics and /metrics route. #[cfg(feature = "metrics")] #[clap(long, env = MEILI_ENABLE_METRICS_ROUTE)] @@ -383,7 +375,6 @@ impl Opt { ignore_missing_snapshot: _, ignore_snapshot_if_db_exists: _, import_dump: _, - generate_master_key: _, ignore_missing_dump: _, ignore_dump_if_db_exists: _, config_file_path: _,