From 306e9c8f38b334214886089f59d8025fda49eb29 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2020 19:56:10 +0000 Subject: [PATCH 1/8] Bump clap from 2.33.1 to 2.33.2 Bumps [clap](https://github.com/clap-rs/clap) from 2.33.1 to 2.33.2. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/commits) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e58bd429e..34e890bae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,9 +297,9 @@ dependencies = [ [[package]] name = "clap" -version = "2.33.1" +version = "2.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" +checksum = "10040cdf04294b565d9e0319955430099ec3813a64c952b86a41200ad714ae48" dependencies = [ "ansi_term", "atty", diff --git a/Cargo.toml b/Cargo.toml index a640dbde2..3f02f5207 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ billboard = "0.1.0" binary-install = "0.0.3-alpha.1" chrome-devtools-rs = { version = "0.0.0-alpha.1", features = ["color"] } chrono = "0.4.13" -clap = "2.33.1" +clap = "2.33.2" cloudflare = "0.6.6" config = "0.10.1" console = "0.11.3" From 6582b8cf5cb99c794e1620ed74ba4f08f412301e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 7 Aug 2020 15:54:00 +0000 Subject: [PATCH 2/8] Bump chrono from 0.4.13 to 0.4.14 Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.13 to 0.4.14. - [Release notes](https://github.com/chronotope/chrono/releases) - [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md) - [Commits](https://github.com/chronotope/chrono/compare/v0.4.13...v0.4.14) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34e890bae..4059a33a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -285,9 +285,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" +checksum = "41194be16cf333d81c5c8cbc060d606f333f5fc9e2c44ad7315cb37fb6be2a87" dependencies = [ "num-integer", "num-traits 0.2.12", diff --git a/Cargo.toml b/Cargo.toml index 3f02f5207..993c4bde7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ base64 = "0.12.3" billboard = "0.1.0" binary-install = "0.0.3-alpha.1" chrome-devtools-rs = { version = "0.0.0-alpha.1", features = ["color"] } -chrono = "0.4.13" +chrono = "0.4.14" clap = "2.33.2" cloudflare = "0.6.6" config = "0.10.1" From a76701470996a4c07c7c225aed1cb5df36616ec2 Mon Sep 17 00:00:00 2001 From: Avery Harnish Date: Mon, 10 Aug 2020 12:10:11 -0500 Subject: [PATCH 3/8] downgrades to unyanked chrono version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 993c4bde7..3f02f5207 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ base64 = "0.12.3" billboard = "0.1.0" binary-install = "0.0.3-alpha.1" chrome-devtools-rs = { version = "0.0.0-alpha.1", features = ["color"] } -chrono = "0.4.14" +chrono = "0.4.13" clap = "2.33.2" cloudflare = "0.6.6" config = "0.10.1" From 1b2688321eee385d87d32670c1da5b699b1aebd6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:12:04 +0000 Subject: [PATCH 4/8] Bump console from 0.11.3 to 0.12.0 Bumps [console](https://github.com/mitsuhiko/console) from 0.11.3 to 0.12.0. - [Release notes](https://github.com/mitsuhiko/console/releases) - [Commits](https://github.com/mitsuhiko/console/compare/v0.11.3...v0.12.0) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 21 +++++++++++++++++++-- Cargo.toml | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4059a33a7..5cf4c0447 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -393,6 +393,23 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "console" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b1aacfaffdbff75be81c15a399b4bedf78aaefe840e8af1d299ac2ade885d2" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "regex", + "terminal_size", + "termios", + "unicode-width", + "winapi 0.3.9", + "winapi-util", +] + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -1063,7 +1080,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" dependencies = [ - "console 0.11.3", + "console 0.9.2", "lazy_static", "number_prefix 0.3.0", "regex", @@ -2772,7 +2789,7 @@ dependencies = [ "clap", "cloudflare", "config", - "console 0.11.3", + "console 0.12.0", "dirs 3.0.1", "env_logger", "eventual", diff --git a/Cargo.toml b/Cargo.toml index 3f02f5207..5259cb285 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ chrono = "0.4.13" clap = "2.33.2" cloudflare = "0.6.6" config = "0.10.1" -console = "0.11.3" +console = "0.12.0" dirs = "3.0.1" env_logger = "0.7.1" eventual = "0.1.7" From 7b7a8247aac1f4a9a22e2d5e46e2b2d24365b596 Mon Sep 17 00:00:00 2001 From: jspspike Date: Mon, 10 Aug 2020 13:01:20 -0500 Subject: [PATCH 5/8] Added wrangler login into auth errors --- src/commands/whoami.rs | 3 ++- src/main.rs | 3 ++- src/preview/upload.rs | 3 ++- src/settings/global_user.rs | 6 ++++-- src/upload/mod.rs | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/commands/whoami.rs b/src/commands/whoami.rs index b67831add..0cb5c054c 100644 --- a/src/commands/whoami.rs +++ b/src/commands/whoami.rs @@ -35,6 +35,7 @@ pub fn whoami(user: &GlobalUser) -> Result<(), failure::Error> { let mut msg = format!("{} You are logged in with {}!\n", emoji::WAVING, auth); let num_permissions_missing = missing_permissions.len(); if num_permissions_missing > 0 { + let login_msg = styles::highlight("`wrangler login`"); let config_msg = styles::highlight("`wrangler config`"); let whoami_msg = styles::highlight("`wrangler whoami`"); if missing_permissions.len() == 1 { @@ -49,7 +50,7 @@ pub fn whoami(user: &GlobalUser) -> Result<(), failure::Error> { styles::highlight(missing_permissions.get(1).unwrap()) )); } - msg.push_str(&format!("\n\nPlease generate a new token and authenticate with {}\nfor more information when running {}", config_msg, whoami_msg)); + msg.push_str(&format!("\n\nPlease generate a new token and authenticate with {} or {}\nfor more information when running {}", login_msg, config_msg, whoami_msg)); } message::billboard(&msg); if table.len() > 1 { diff --git a/src/main.rs b/src/main.rs index 0415a23ec..629d3a1b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -624,6 +624,7 @@ fn run() -> Result<(), failure::Error> { let not_recommended_msg = styles::warning("(Not Recommended)"); let recommended_cmd_msg = styles::highlight("`wrangler config --api-key`"); + let wrangler_login_msg = styles::highlight("`wrangler login`"); let api_token_url = styles::url("https://dash.cloudflare.com/profile/api-tokens"); let token_support_url = styles::url( "https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys", @@ -635,7 +636,7 @@ fn run() -> Result<(), failure::Error> { let user: GlobalUser = if default { // API Tokens are the default - message::billboard(&format!("To find your API Token, go to {}\nand create it using the \"Edit Cloudflare Workers\" template.\n\nIf you are trying to use your Global API Key instead of an API Token\n{}, run {}.", api_token_url, not_recommended_msg, recommended_cmd_msg)); + message::billboard(&format!("To find your API Token, go to {}\nand create it using the \"Edit Cloudflare Workers\" template.\n\nConsider using {} which only requires your Cloudflare username and password.\n\nIf you are trying to use your Global API Key instead of an API Token\n{}, run {}.", api_token_url, wrangler_login_msg, not_recommended_msg, recommended_cmd_msg)); let api_token: String = interactive::get_user_input("Enter API Token: "); GlobalUser::TokenAuth { api_token } } else { diff --git a/src/preview/upload.rs b/src/preview/upload.rs index c2b3ad66e..2bb01a2de 100644 --- a/src/preview/upload.rs +++ b/src/preview/upload.rs @@ -99,9 +99,10 @@ pub fn upload( } None => { let wrangler_config_msg = styles::highlight("`wrangler config`"); + let wrangler_login_msg = styles::highlight("`wrangler login`"); let docs_url_msg = styles::url("https://developers.cloudflare.com/workers/tooling/wrangler/configuration/#using-environment-variables"); message::billboard( - &format!("You have not provided your Cloudflare credentials.\n\nPlease run {} or visit\n{}\nfor info on authenticating with environment variables.", wrangler_config_msg, docs_url_msg) + &format!("You have not provided your Cloudflare credentials.\n\nPlease run {}, {}, or visit\n{}\nfor info on authenticating with environment variables.", wrangler_login_msg, wrangler_config_msg, docs_url_msg) ); message::info("Running preview without authentication."); diff --git a/src/settings/global_user.rs b/src/settings/global_user.rs index 5bb6e1d7a..72b2e5465 100644 --- a/src/settings/global_user.rs +++ b/src/settings/global_user.rs @@ -81,7 +81,7 @@ impl GlobalUser { s.merge(config::File::with_name(config_str))?; } else { failure::bail!( - "config path does not exist {}. Try running `wrangler config`", + "config path does not exist {}. Try running `wrangler login` or `wrangler config`", config_str ); } @@ -103,11 +103,13 @@ impl GlobalUser { match global_user { Ok(user) => Ok(user), Err(_) => { + let wrangler_login_msg = styles::highlight("`wrangler login`"); let wrangler_config_msg = styles::highlight("`wrangler config`"); let vars_msg = styles::url("https://developers.cloudflare.com/workers/tooling/wrangler/configuration/#using-environment-variables"); let msg = format!( - "{} Your authentication details are improperly configured.\nPlease run {} or visit\n{}\nfor info on configuring with environment variables", + "{} Your authentication details are improperly configured.\nPlease run {}, {}, or visit\n{}\nfor info on configuring with environment variables", emoji::WARN, + wrangler_login_msg, wrangler_config_msg, vars_msg ); diff --git a/src/upload/mod.rs b/src/upload/mod.rs index 1cfdf3861..f1c59c52a 100644 --- a/src/upload/mod.rs +++ b/src/upload/mod.rs @@ -40,7 +40,7 @@ fn error_msg(status: reqwest::StatusCode, text: String) -> String { if text.contains("\"code\": 10034,") { "You need to verify your account's email address before you can publish. You can do this by checking your email or logging in to https://dash.cloudflare.com.".to_string() } else if text.contains("\"code\":10000,") { - "Your user configuration is invalid, please run wrangler config and enter a new set of credentials.".to_string() + "Your user configuration is invalid, please run wrangler login or wrangler config and enter a new set of credentials.".to_string() } else { format!("Something went wrong! Status: {}, Details {}", status, text) } From c17bc4cc6c344d04bf9cbecda584e3f16cf79898 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2020 23:10:25 +0000 Subject: [PATCH 6/8] Bump serde from 1.0.114 to 1.0.115 Bumps [serde](https://github.com/serde-rs/serde) from 1.0.114 to 1.0.115. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.114...v1.0.115) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5cf4c0447..beb993bc9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,7 +200,7 @@ dependencies = [ "lazy_static", "memchr", "regex-automata", - "serde 1.0.114", + "serde 1.0.115", ] [[package]] @@ -278,7 +278,7 @@ checksum = "17d1ada6e226ee1c5a69bfe5b16a494f036151d16461904afd22edeccb93061b" dependencies = [ "console 0.11.3", "log 0.4.11", - "serde 1.0.114", + "serde 1.0.115", "serde_json", "unescape", ] @@ -291,7 +291,7 @@ checksum = "41194be16cf333d81c5c8cbc060d606f333f5fc9e2c44ad7315cb37fb6be2a87" dependencies = [ "num-integer", "num-traits 0.2.12", - "serde 1.0.114", + "serde 1.0.115", "time", ] @@ -334,7 +334,7 @@ dependencies = [ "http", "percent-encoding 1.0.1", "reqwest", - "serde 1.0.114", + "serde 1.0.115", "serde_json", "serde_qs", "serde_with", @@ -353,7 +353,7 @@ dependencies = [ "lazy_static", "nom", "rust-ini", - "serde 1.0.114", + "serde 1.0.115", "serde-hjson", "serde_json", "toml", @@ -478,7 +478,7 @@ dependencies = [ "csv-core", "itoa", "ryu", - "serde 1.0.114", + "serde 1.0.115", ] [[package]] @@ -1080,7 +1080,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" dependencies = [ - "console 0.9.2", + "console 0.12.0", "lazy_static", "number_prefix 0.3.0", "regex", @@ -1800,7 +1800,7 @@ dependencies = [ "native-tls", "percent-encoding 2.1.0", "pin-project-lite", - "serde 1.0.114", + "serde 1.0.115", "serde_json", "serde_urlencoded", "tokio", @@ -1913,9 +1913,9 @@ checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" [[package]] name = "serde" -version = "1.0.114" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" +checksum = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5" dependencies = [ "serde_derive", ] @@ -1935,9 +1935,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.114" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" +checksum = "609feed1d0a73cc36a0182a840a9b37b4a82f0b1150369f0536a9e3f2a31dc48" dependencies = [ "proc-macro2", "quote", @@ -1952,7 +1952,7 @@ checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" dependencies = [ "itoa", "ryu", - "serde 1.0.114", + "serde 1.0.115", ] [[package]] @@ -1964,7 +1964,7 @@ dependencies = [ "data-encoding", "error-chain", "percent-encoding 1.0.1", - "serde 1.0.114", + "serde 1.0.115", ] [[package]] @@ -1984,7 +1984,7 @@ checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" dependencies = [ "dtoa", "itoa", - "serde 1.0.114", + "serde 1.0.115", "url", ] @@ -1994,7 +1994,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89d3d595d64120bbbc70b7f6d5ae63298b62a3d9f373ec2f56acf5365ca8a444" dependencies = [ - "serde 1.0.114", + "serde 1.0.115", "serde_with_macros", ] @@ -2116,7 +2116,7 @@ dependencies = [ "chrono", "libflate", "regex", - "serde 1.0.114", + "serde 1.0.115", "serde_derive", "slog", "slog-async", @@ -2415,7 +2415,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" dependencies = [ - "serde 1.0.114", + "serde 1.0.115", ] [[package]] @@ -2642,7 +2642,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" dependencies = [ "cfg-if", - "serde 1.0.114", + "serde 1.0.115", "serde_json", "wasm-bindgen-macro", ] @@ -2816,7 +2816,7 @@ dependencies = [ "regex", "reqwest", "semver", - "serde 1.0.114", + "serde 1.0.115", "serde_json", "serde_with", "tempfile", From 886f12dab8338d05589cc3643c42e977cb439bef Mon Sep 17 00:00:00 2001 From: jspspike Date: Tue, 11 Aug 2020 15:27:31 -0500 Subject: [PATCH 7/8] Change open_browser to open browser in child process --- src/terminal/browser.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/terminal/browser.rs b/src/terminal/browser.rs index a8ce5bbba..d4f933a6f 100644 --- a/src/terminal/browser.rs +++ b/src/terminal/browser.rs @@ -1,16 +1,16 @@ use std::process::Command; pub fn open_browser(url: &str) -> Result<(), failure::Error> { - let _output = if cfg!(target_os = "windows") { + if cfg!(target_os = "windows") { let url_escaped = url.replace("&", "^&"); let windows_cmd = format!("start {}", url_escaped); - Command::new("cmd").args(&["/C", &windows_cmd]).output()? + Command::new("cmd").args(&["/C", &windows_cmd]).spawn()?; } else if cfg!(target_os = "linux") { let linux_cmd = format!(r#"xdg-open "{}""#, url); - Command::new("sh").arg("-c").arg(&linux_cmd).output()? + Command::new("sh").arg("-c").arg(&linux_cmd).spawn()?; } else { let mac_cmd = format!(r#"open "{}""#, url); - Command::new("sh").arg("-c").arg(&mac_cmd).output()? + Command::new("sh").arg("-c").arg(&mac_cmd).spawn()?; }; Ok(()) From a3656a974541ada6263f1901016342cbfc9fb2aa Mon Sep 17 00:00:00 2001 From: jspspike Date: Tue, 11 Aug 2020 20:26:26 -0500 Subject: [PATCH 8/8] Made stdout go to /dev/null --- src/terminal/browser.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/terminal/browser.rs b/src/terminal/browser.rs index d4f933a6f..77b4a7ddb 100644 --- a/src/terminal/browser.rs +++ b/src/terminal/browser.rs @@ -1,16 +1,27 @@ -use std::process::Command; +use std::process::{Command, Stdio}; pub fn open_browser(url: &str) -> Result<(), failure::Error> { if cfg!(target_os = "windows") { let url_escaped = url.replace("&", "^&"); let windows_cmd = format!("start {}", url_escaped); - Command::new("cmd").args(&["/C", &windows_cmd]).spawn()?; + Command::new("cmd") + .args(&["/C", &windows_cmd]) + .stdout(Stdio::null()) + .spawn()?; } else if cfg!(target_os = "linux") { let linux_cmd = format!(r#"xdg-open "{}""#, url); - Command::new("sh").arg("-c").arg(&linux_cmd).spawn()?; + Command::new("sh") + .arg("-c") + .arg(&linux_cmd) + .stdout(Stdio::null()) + .spawn()?; } else { let mac_cmd = format!(r#"open "{}""#, url); - Command::new("sh").arg("-c").arg(&mac_cmd).spawn()?; + Command::new("sh") + .arg("-c") + .arg(&mac_cmd) + .stdout(Stdio::null()) + .spawn()?; }; Ok(())