mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +08:00
Remove --generate-master-key option
This commit is contained in:
parent
1f8ddb366c
commit
eb08a0fb0b
@ -271,7 +271,6 @@ impl From<Opt> for Infos {
|
|||||||
log_level,
|
log_level,
|
||||||
indexer_options,
|
indexer_options,
|
||||||
config_file_path,
|
config_file_path,
|
||||||
generate_master_key: _,
|
|
||||||
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||||
no_analytics: _,
|
no_analytics: _,
|
||||||
} = options;
|
} = options;
|
||||||
|
@ -29,11 +29,6 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
|
|
||||||
setup(&opt)?;
|
setup(&opt)?;
|
||||||
|
|
||||||
if opt.generate_master_key {
|
|
||||||
println!("{}", generate_master_key());
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
match (opt.env.as_ref(), &opt.master_key) {
|
match (opt.env.as_ref(), &opt.master_key) {
|
||||||
("production", Some(master_key)) if master_key.len() < MASTER_KEY_MIN_SIZE => {
|
("production", Some(master_key)) if master_key.len() < MASTER_KEY_MIN_SIZE => {
|
||||||
anyhow::bail!(
|
anyhow::bail!(
|
||||||
@ -178,7 +173,6 @@ Anonymous telemetry:\t\"Enabled\""
|
|||||||
eprintln!();
|
eprintln!();
|
||||||
log::warn!("The provided master key is too short (< {MASTER_KEY_MIN_SIZE} bytes)");
|
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!("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) => {
|
("development", None) => {
|
||||||
|
@ -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_IGNORE_DUMP_IF_DB_EXISTS: &str = "MEILI_IGNORE_DUMP_IF_DB_EXISTS";
|
||||||
const MEILI_DUMP_DIR: &str = "MEILI_DUMP_DIR";
|
const MEILI_DUMP_DIR: &str = "MEILI_DUMP_DIR";
|
||||||
const MEILI_LOG_LEVEL: &str = "MEILI_LOG_LEVEL";
|
const MEILI_LOG_LEVEL: &str = "MEILI_LOG_LEVEL";
|
||||||
const MEILI_GENERATE_MASTER_KEY: &str = "MEILI_GENERATE_MASTER_KEY";
|
|
||||||
#[cfg(feature = "metrics")]
|
#[cfg(feature = "metrics")]
|
||||||
const MEILI_ENABLE_METRICS_ROUTE: &str = "MEILI_ENABLE_METRICS_ROUTE";
|
const MEILI_ENABLE_METRICS_ROUTE: &str = "MEILI_ENABLE_METRICS_ROUTE";
|
||||||
|
|
||||||
@ -284,13 +283,6 @@ pub struct Opt {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub log_level: LogLevel,
|
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.
|
/// Enables Prometheus metrics and /metrics route.
|
||||||
#[cfg(feature = "metrics")]
|
#[cfg(feature = "metrics")]
|
||||||
#[clap(long, env = MEILI_ENABLE_METRICS_ROUTE)]
|
#[clap(long, env = MEILI_ENABLE_METRICS_ROUTE)]
|
||||||
@ -383,7 +375,6 @@ impl Opt {
|
|||||||
ignore_missing_snapshot: _,
|
ignore_missing_snapshot: _,
|
||||||
ignore_snapshot_if_db_exists: _,
|
ignore_snapshot_if_db_exists: _,
|
||||||
import_dump: _,
|
import_dump: _,
|
||||||
generate_master_key: _,
|
|
||||||
ignore_missing_dump: _,
|
ignore_missing_dump: _,
|
||||||
ignore_dump_if_db_exists: _,
|
ignore_dump_if_db_exists: _,
|
||||||
config_file_path: _,
|
config_file_path: _,
|
||||||
|
Loading…
Reference in New Issue
Block a user