From 12538d5a441145e031934f03e3a80eda2786ae20 Mon Sep 17 00:00:00 2001 From: evpeople Date: Thu, 11 Aug 2022 21:29:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9E=20fix:=20Support=20https=20whe?= =?UTF-8?q?n=20print=5Flanuch=5Fresume?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #2660 --- meilisearch-http/src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meilisearch-http/src/main.rs b/meilisearch-http/src/main.rs index f903663eb..76df68aea 100644 --- a/meilisearch-http/src/main.rs +++ b/meilisearch-http/src/main.rs @@ -101,7 +101,11 @@ async fn run_http( pub fn print_launch_resume(opt: &Opt, user: &str) { let commit_sha = option_env!("VERGEN_GIT_SHA").unwrap_or("unknown"); let commit_date = option_env!("VERGEN_GIT_COMMIT_TIMESTAMP").unwrap_or("unknown"); - + let protocol =if opt.ssl_cert_path.is_some()&&opt.ssl_key_path.is_some(){ + "https" + }else { + "http" + }; let ascii_name = r#" 888b d888 d8b 888 d8b 888 8888b d8888 Y8P 888 Y8P 888 @@ -116,7 +120,7 @@ pub fn print_launch_resume(opt: &Opt, user: &str) { eprintln!("{}", ascii_name); eprintln!("Database path:\t\t{:?}", opt.db_path); - eprintln!("Server listening on:\t\"http://{}\"", opt.http_addr); + eprintln!("Server listening on:\t\"{}://{}\"",protocol ,opt.http_addr); eprintln!("Environment:\t\t{:?}", opt.env); eprintln!("Commit SHA:\t\t{:?}", commit_sha.to_string()); eprintln!("Commit date:\t\t{:?}", commit_date.to_string()); @@ -160,3 +164,4 @@ Anonymous telemetry:\t\"Enabled\"" eprintln!("Contact:\t\thttps://docs.meilisearch.com/resources/contact.html"); eprintln!(); } + From f21a4d61da0361574adf37e8e982a275300dd362 Mon Sep 17 00:00:00 2001 From: evpeople Date: Fri, 12 Aug 2022 16:16:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8C=88=20style(http/main.rs):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meilisearch-http/src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/meilisearch-http/src/main.rs b/meilisearch-http/src/main.rs index 76df68aea..7b99379ae 100644 --- a/meilisearch-http/src/main.rs +++ b/meilisearch-http/src/main.rs @@ -101,9 +101,9 @@ async fn run_http( pub fn print_launch_resume(opt: &Opt, user: &str) { let commit_sha = option_env!("VERGEN_GIT_SHA").unwrap_or("unknown"); let commit_date = option_env!("VERGEN_GIT_COMMIT_TIMESTAMP").unwrap_or("unknown"); - let protocol =if opt.ssl_cert_path.is_some()&&opt.ssl_key_path.is_some(){ + let protocol = if opt.ssl_cert_path.is_some() && opt.ssl_key_path.is_some() { "https" - }else { + } else { "http" }; let ascii_name = r#" @@ -120,7 +120,7 @@ pub fn print_launch_resume(opt: &Opt, user: &str) { eprintln!("{}", ascii_name); eprintln!("Database path:\t\t{:?}", opt.db_path); - eprintln!("Server listening on:\t\"{}://{}\"",protocol ,opt.http_addr); + eprintln!("Server listening on:\t\"{}://{}\"", protocol, opt.http_addr); eprintln!("Environment:\t\t{:?}", opt.env); eprintln!("Commit SHA:\t\t{:?}", commit_sha.to_string()); eprintln!("Commit date:\t\t{:?}", commit_date.to_string()); @@ -164,4 +164,3 @@ Anonymous telemetry:\t\"Enabled\"" eprintln!("Contact:\t\thttps://docs.meilisearch.com/resources/contact.html"); eprintln!(); } -