From 673a1981764e963667af2838134698fab3aece78 Mon Sep 17 00:00:00 2001 From: David Knaack Date: Fri, 14 Jan 2022 13:22:36 +0100 Subject: [PATCH] fix(bug-report): remove git.io link shortening (#3425) --- .github/workflows/deploy.yml | 2 +- Cargo.lock | 190 +---------------------------------- Cargo.toml | 8 +- src/bug_report.rs | 21 +--- 4 files changed, 6 insertions(+), 215 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 19feeeed..ce59a537 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -83,7 +83,7 @@ jobs: uses: actions-rs/cargo@v1.0.3 with: command: build - args: --release --locked --features tls-vendored --target ${{ matrix.target }} + args: --release --locked --target ${{ matrix.target }} use-cross: ${{ matrix.os == 'ubuntu-latest' }} - name: Post Build | Prepare artifacts [Windows] diff --git a/Cargo.lock b/Cargo.lock index 347d9cb6..80ecf250 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,22 +57,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "attohttpc" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69e13a99a7e6e070bb114f7ff381e58c7ccc188630121fc4c2fe4bcf24cd072" -dependencies = [ - "http", - "log", - "native-tls", - "openssl", - "serde", - "serde_urlencoded", - "url", - "wildmatch", -] - [[package]] name = "atty" version = "0.2.14" @@ -287,17 +271,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ - "core-foundation-sys 0.7.0", - "libc", -] - -[[package]] -name = "core-foundation" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" -dependencies = [ - "core-foundation-sys 0.8.2", + "core-foundation-sys", "libc", ] @@ -307,12 +281,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" -[[package]] -name = "core-foundation-sys" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" - [[package]] name = "cpufeatures" version = "0.2.1" @@ -510,27 +478,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.0.1" @@ -753,17 +700,6 @@ dependencies = [ "libc", ] -[[package]] -name = "http" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" -dependencies = [ - "bytes", - "fnv", - "itoa 0.4.8", -] - [[package]] name = "idna" version = "0.2.3" @@ -810,12 +746,6 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - [[package]] name = "itoa" version = "1.0.1" @@ -987,24 +917,6 @@ dependencies = [ "syn", ] -[[package]] -name = "native-tls" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "nb-connect" version = "1.2.0" @@ -1152,49 +1064,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "openssl" -version = "0.10.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-sys", -] - -[[package]] -name = "openssl-probe" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" - -[[package]] -name = "openssl-src" -version = "111.16.0+1.1.1l" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab2173f69416cf3ec12debb5823d244127d23a9b127d5a5189aa97c5fa2859f" -dependencies = [ - "cc", -] - -[[package]] -name = "openssl-sys" -version = "0.9.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1996d2d305e561b70d1ee0c53f1542833f4e1ac6ce9a6708b6ff2738ca67dc82" -dependencies = [ - "autocfg", - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] - [[package]] name = "ordered-multimap" version = "0.3.1" @@ -1607,16 +1476,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" -[[package]] -name = "schannel" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" -dependencies = [ - "lazy_static", - "winapi", -] - [[package]] name = "scoped-tls" version = "1.0.0" @@ -1629,29 +1488,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "security-framework" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" -dependencies = [ - "bitflags", - "core-foundation 0.9.1", - "core-foundation-sys 0.8.2", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" -dependencies = [ - "core-foundation-sys 0.8.2", - "libc", -] - [[package]] name = "semver" version = "1.0.4" @@ -1684,7 +1520,7 @@ version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee2bb9cd061c5865d345bb02ca49fcef1391741b672b54a0bf7b679badec3142" dependencies = [ - "itoa 1.0.1", + "itoa", "ryu", "serde", ] @@ -1700,18 +1536,6 @@ dependencies = [ "syn", ] -[[package]] -name = "serde_urlencoded" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" -dependencies = [ - "form_urlencoded", - "itoa 0.4.8", - "ryu", - "serde", -] - [[package]] name = "sha-1" version = "0.8.2" @@ -1773,7 +1597,6 @@ name = "starship" version = "1.1.1" dependencies = [ "ansi_term", - "attohttpc", "byte-unit", "chrono", "clap", @@ -1784,7 +1607,6 @@ dependencies = [ "indexmap", "log", "mockall", - "native-tls", "nix 0.23.1", "notify-rust", "once_cell", @@ -1829,7 +1651,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3336198ad004af4447ae69be4f4e562c26814570f8f0c1e37858405a294e015d" dependencies = [ "cfg-if 1.0.0", - "core-foundation 0.7.0", + "core-foundation", "lazycell", "libc", "mach", @@ -2172,12 +1994,6 @@ dependencies = [ "libc", ] -[[package]] -name = "wildmatch" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c48bd20df7e4ced539c12f570f937c6b4884928a87fee70a479d72f031d4e0" - [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index 94f9aa21..4c96d358 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,11 +23,8 @@ is-it-maintained-open-issues = { repository = "starship/starship" } maintenance = { status = "actively-developed" } [features] -default = ["battery", "http"] -http = ["attohttpc"] +default = ["battery"] battery = ["starship-battery"] -# Vendor OpenSSL, use this if you have trouble cross-compiling starship -tls-vendored = ["native-tls/vendored"] [dependencies] clap = { version = "3.0.7", features = ["derive", "cargo", "unicode"] } @@ -75,9 +72,6 @@ toml_edit = "0.13.0" process_control = { version = "3.2.0", features = ["crossbeam-channel"] } -# Optional/http: -attohttpc = { version = "0.18.0", optional = true, default-features = false, features = ["tls", "form"] } -native-tls = { version = "0.2.8", optional = true } shell-words = "1.0.0" [target.'cfg(windows)'.dependencies] diff --git a/src/bug_report.rs b/src/bug_report.rs index c70f9a77..043b7cfc 100644 --- a/src/bug_report.rs +++ b/src/bug_report.rs @@ -6,9 +6,6 @@ use std::fs; use std::path::PathBuf; use std::time::Duration; -#[cfg(feature = "http")] -const GIT_IO_BASE_URL: &str = "https://git.io/"; - pub fn create() { println!("{}\n", shadow::version().trim()); let os_info = os_info::get(); @@ -22,7 +19,6 @@ pub fn create() { }; let link = make_github_issue_link(environment); - let short_link = shorten_link(&link); if open::that(&link).is_ok() { println!("Take a look at your browser. A GitHub issue has been populated with your configuration."); @@ -31,22 +27,7 @@ pub fn create() { println!("Click this link to create a GitHub issue populated with your configuration:\n"); } - println!(" {}", short_link.unwrap_or(link)); -} - -#[cfg(feature = "http")] -fn shorten_link(link: &str) -> Option { - attohttpc::post(&format!("{}{}", GIT_IO_BASE_URL, "create")) - .form(&[("url", link)]) - .ok() - .and_then(|r| r.send().ok()) - .and_then(|r| r.text().ok()) - .map(|slug| format!("{}{}", GIT_IO_BASE_URL, slug)) -} - -#[cfg(not(feature = "http"))] -fn shorten_link(_url: &str) -> Option { - None + println!("{}", link); } const UNKNOWN_SHELL: &str = "";