From f0910e1d29546e9e92463310bb9f60214b621337 Mon Sep 17 00:00:00 2001 From: kosay Date: Sat, 10 Feb 2024 14:51:49 +0900 Subject: [PATCH 1/3] chore(deps): deprecate openssl-tls feature --- Cargo.lock | 97 ------------------------------------------------------ Cargo.toml | 6 +--- 2 files changed, 1 insertion(+), 102 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 449861fc..c5348db6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -881,24 +881,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-openssl" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ee5d7a8f718585d1c3c61dfde28ef5b0bb14734b4db13f5ada856cdc6c612b" -dependencies = [ - "http", - "hyper", - "linked_hash_set", - "once_cell", - "openssl", - "openssl-sys", - "parking_lot", - "tokio", - "tokio-openssl", - "tower-layer", -] - [[package]] name = "hyper-rustls" version = "0.24.2" @@ -1062,13 +1044,11 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-openssl", "hyper-rustls", "hyper-timeout", "jsonpath-rust", "k8s-openapi", "kube-core", - "openssl", "pem", "pin-project", "rustls", @@ -1157,21 +1137,6 @@ version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linked_hash_set" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -1425,50 +1390,12 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" -dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "ordered-float" version = "2.10.1" @@ -1600,12 +1527,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" - [[package]] name = "png" version = "0.17.11" @@ -2256,18 +2177,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "tokio-openssl" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffab79df67727f6acf57f1ff743091873c24c579b1e2ce4d8f53e47ded4d63d" -dependencies = [ - "futures-util", - "openssl", - "openssl-sys", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.24.1" @@ -2428,12 +2337,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" diff --git a/Cargo.toml b/Cargo.toml index ac7147ed..e72368b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,6 @@ repository = "https://github.com/sarub0b0/kubetui" keywords = ["kubernetes", "tui", "terminal", "monitor"] exclude = ["assets/*", "test/*", "Makefile", "shell.nix", "screenshots/*", ".taplo.toml"] -[features] -default = ["kube/rustls-tls"] -openssl-tls = ["kube/openssl-tls"] - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -45,7 +41,7 @@ bytes = "1" futures = "0.3" http = "0.2" k8s-openapi = { version = "0.21.0", default-features = false, features = ["v1_27"] } -kube = { version = "0.88.1", default-features = false, features = ["client"] } +kube = { version = "0.88.1" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_yaml = "0.9" From 3e235cd08a15f1809c6e7b67b517a2ecf63a6d33 Mon Sep 17 00:00:00 2001 From: kosay Date: Sat, 10 Feb 2024 14:53:39 +0900 Subject: [PATCH 2/3] ci: deprecate openssl-tls feature --- .github/workflows/release.yml | 159 +------------------------- .github/workflows/upload-artifact.yml | 145 ----------------------- 2 files changed, 4 insertions(+), 300 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60724bb5..7c292f86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,6 @@ on: env: CARGO_TERM_COLOR: always - OPENSSL_VERSION: OpenSSL_1_1_1s jobs: build: @@ -53,157 +52,13 @@ jobs: - uses: actions/upload-artifact@v4 if: matrix.os == 'windows-latest' with: - name: ${{ matrix.target }}-rustls + name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/kubetui.exe - uses: actions/upload-artifact@v4 if: matrix.os != 'windows-latest' with: - name: ${{ matrix.target }}-rustls - path: target/${{ matrix.target }}/release/kubetui - - build-windows: - runs-on: windows-latest - - env: - TARGET: x86_64-pc-windows-msvc - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append - - - run: echo "OPENSSL_DIR=$env:VCPKG_ROOT\installed\x64-windows-static" | Out-File -FilePath $env:GITHUB_ENV -Append - - - run: |- - echo "OPENSSL_LIB_DIR=$env:OPENSSL_DIR\lib" | Out-File -FilePath $env:GITHUB_ENV -Append - echo "OPENSSL_INCLUDE_DIR=$env:OPENSSL_DIR\include" | Out-File -FilePath $env:GITHUB_ENV -Append - - - run: vcpkg install openssl:x64-windows-static - - - uses: dtolnay/rust-toolchain@stable - - - run: cargo build --release --no-default-features --features openssl-tls --target $env:TARGET - - - uses: actions/upload-artifact@v4 - with: - name: ${{ env.TARGET }}-openssl - path: target/${{ env.TARGET }}/release/kubetui.exe - - build-linux: - strategy: - matrix: - target: - - x86_64-unknown-linux-gnu - - x86_64-unknown-linux-musl - - runs-on: ubuntu-latest - - env: - OPENSSL_DIR: /opt/openssl - OPENSSL_INCLUDE_DIR: /opt/openssl/include - OPENSSL_LIB_DIR: /opt/openssl/lib - OPENSSL_STATIC: true - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - - name: Install Packages - run: | - sudo apt-get install libssl-dev - - - name: Make OpenSSL - if: matrix.target == 'x86_64-unknown-linux-musl' - env: - OPENSSL_DIR: /opt/openssl - OPENSSL_INCLUDE_DIR: /opt/openssl/include - OPENSSL_LIB_DIR: /opt/openssl/lib - run: | - sudo apt-get update - sudo apt-get install musl-tools linux-headers-generic - - sudo ln -sv /usr/include/linux /usr/include/x86_64-linux-musl/linux - sudo ln -sv /usr/include/x86_64-linux-gnu/asm /usr/include/x86_64-linux-musl/asm - sudo ln -sv /usr/include/asm-generic /usr/include/x86_64-linux-musl/asm-generic - - mkdir /tmp/build - cd /tmp/build - - curl -L https://github.com/openssl/openssl/archive/${{ env.OPENSSL_VERSION }}.tar.gz | tar --strip-components=1 -xzf - - - export CC=musl-gcc - - ./Configure linux-x86_64 --prefix=$OPENSSL_DIR -fPIC no-shared - - make depend - make -j - make install_sw - - - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Build - run: | - if [[ "${{ matrix.target }}" != "x86_64-unknown-linux-musl" ]]; then - unset OPENSSL_DIR - unset OPENSSL_LIB_DIR - unset OPENSSL_INCLUDE_DIR - unset OPENSSL_STATIC - fi - cargo build --release --no-default-features --features openssl-tls --target ${{ matrix.target }} - - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }}-openssl - path: target/${{ matrix.target }}/release/kubetui - - build-macos: - runs-on: macos-latest - - strategy: - matrix: - target: - - x86_64-apple-darwin - - aarch64-apple-darwin - include: - - target: x86_64-apple-darwin - openssl: darwin64-x86_64-cc - - target: aarch64-apple-darwin - openssl: darwin64-arm64-cc - env: - OPENSSL_DIR: /tmp/openssl - OPENSSL_INCLUDE_DIR: /tmp/openssl/include - OPENSSL_LIB_DIR: /tmp/openssl/lib - OPENSSL_STATIC: true - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Make OpenSSL - run: | - mkdir /tmp/openssl-build - cd /tmp/openssl-build - - curl -L https://github.com/openssl/openssl/archive/${{ env.OPENSSL_VERSION }}.tar.gz | tar --strip-components=1 -xzf - - - ./Configure ${{ matrix.openssl }} --prefix=$OPENSSL_DIR -fPIC no-shared - - make depend - make -j - make install_sw - - - run: cargo build --release --no-default-features --features openssl-tls --target ${{ matrix.target }} - - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }}-openssl + name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/kubetui release: @@ -215,9 +70,6 @@ jobs: - x86_64-pc-windows-msvc - x86_64-apple-darwin - aarch64-apple-darwin - feature: - - openssl - - rustls include: - target: x86_64-unknown-linux-gnu artifact_name: kubetui @@ -238,21 +90,18 @@ jobs: runs-on: ubuntu-latest needs: - - build-windows - - build-linux - - build-macos - build steps: - name: Download binaries uses: actions/download-artifact@v4 with: - name: ${{ matrix.target }}-${{ matrix.feature }} + name: ${{ matrix.target }} - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ matrix.artifact_name }} - asset_name: kubetui-${{ matrix.target }}-${{ matrix.feature }}${{ matrix.file_ext }} + asset_name: kubetui-${{ matrix.target }}${{ matrix.file_ext }} tag: ${{ github.ref }} diff --git a/.github/workflows/upload-artifact.yml b/.github/workflows/upload-artifact.yml index 7729faef..36e83b94 100644 --- a/.github/workflows/upload-artifact.yml +++ b/.github/workflows/upload-artifact.yml @@ -7,7 +7,6 @@ on: env: CARGO_TERM_COLOR: always - OPENSSL_VERSION: OpenSSL_1_1_1s jobs: build: @@ -61,147 +60,3 @@ jobs: with: name: ${{ matrix.target }}-rustls path: target/${{ matrix.target }}/release/kubetui - - build-windows: - runs-on: windows-latest - - env: - TARGET: x86_64-pc-windows-msvc - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append - - - run: echo "OPENSSL_DIR=$env:VCPKG_ROOT\installed\x64-windows-static" | Out-File -FilePath $env:GITHUB_ENV -Append - - - run: |- - echo "OPENSSL_LIB_DIR=$env:OPENSSL_DIR\lib" | Out-File -FilePath $env:GITHUB_ENV -Append - echo "OPENSSL_INCLUDE_DIR=$env:OPENSSL_DIR\include" | Out-File -FilePath $env:GITHUB_ENV -Append - - - run: vcpkg install openssl:x64-windows-static - - - uses: dtolnay/rust-toolchain@stable - - - run: cargo build --release --no-default-features --features openssl-tls --target $env:TARGET - - - uses: actions/upload-artifact@v4 - with: - name: ${{ env.TARGET }}-openssl - path: target/${{ env.TARGET }}/release/kubetui.exe - - build-linux: - strategy: - matrix: - target: - - x86_64-unknown-linux-gnu - - x86_64-unknown-linux-musl - - runs-on: ubuntu-latest - - env: - OPENSSL_DIR: /opt/openssl - OPENSSL_INCLUDE_DIR: /opt/openssl/include - OPENSSL_LIB_DIR: /opt/openssl/lib - OPENSSL_STATIC: true - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - - name: Install Packages - run: | - sudo apt-get install libssl-dev - - - name: Make OpenSSL - if: matrix.target == 'x86_64-unknown-linux-musl' - env: - OPENSSL_DIR: /opt/openssl - OPENSSL_INCLUDE_DIR: /opt/openssl/include - OPENSSL_LIB_DIR: /opt/openssl/lib - run: | - sudo apt-get update - sudo apt-get install musl-tools linux-headers-generic - - sudo ln -sv /usr/include/linux /usr/include/x86_64-linux-musl/linux - sudo ln -sv /usr/include/x86_64-linux-gnu/asm /usr/include/x86_64-linux-musl/asm - sudo ln -sv /usr/include/asm-generic /usr/include/x86_64-linux-musl/asm-generic - - mkdir /tmp/build - cd /tmp/build - - curl -L https://github.com/openssl/openssl/archive/${{ env.OPENSSL_VERSION }}.tar.gz | tar --strip-components=1 -xzf - - - export CC=musl-gcc - - ./Configure linux-x86_64 --prefix=$OPENSSL_DIR -fPIC no-shared - - make depend - make -j - make install_sw - - - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Build - run: | - if [[ "${{ matrix.target }}" != "x86_64-unknown-linux-musl" ]]; then - unset OPENSSL_DIR - unset OPENSSL_LIB_DIR - unset OPENSSL_INCLUDE_DIR - unset OPENSSL_STATIC - fi - cargo build --release --no-default-features --features openssl-tls --target ${{ matrix.target }} - - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }}-openssl - path: target/${{ matrix.target }}/release/kubetui - - build-macos: - runs-on: macos-latest - - strategy: - matrix: - target: - - x86_64-apple-darwin - - aarch64-apple-darwin - include: - - target: x86_64-apple-darwin - openssl: darwin64-x86_64-cc - - target: aarch64-apple-darwin - openssl: darwin64-arm64-cc - env: - OPENSSL_DIR: /tmp/openssl - OPENSSL_INCLUDE_DIR: /tmp/openssl/include - OPENSSL_LIB_DIR: /tmp/openssl/lib - OPENSSL_STATIC: true - - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Make OpenSSL - run: | - mkdir /tmp/openssl-build - cd /tmp/openssl-build - - curl -L https://github.com/openssl/openssl/archive/${{ env.OPENSSL_VERSION }}.tar.gz | tar --strip-components=1 -xzf - - - ./Configure ${{ matrix.openssl }} --prefix=$OPENSSL_DIR -fPIC no-shared - - make depend - make -j - make install_sw - - - run: cargo build --release --no-default-features --features openssl-tls --target ${{ matrix.target }} - - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }}-openssl - path: target/${{ matrix.target }}/release/kubetui From a3605c8f7027b0a11914a128695f9c1005f0c0c1 Mon Sep 17 00:00:00 2001 From: kosay Date: Sat, 10 Feb 2024 14:58:11 +0900 Subject: [PATCH 3/3] docs: remove cargo installation for the openssl-tls feature. --- .github/workflows/upload-artifact.yml | 4 ++-- README.md | 22 +++++++--------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/upload-artifact.yml b/.github/workflows/upload-artifact.yml index 36e83b94..fe6187e7 100644 --- a/.github/workflows/upload-artifact.yml +++ b/.github/workflows/upload-artifact.yml @@ -52,11 +52,11 @@ jobs: - uses: actions/upload-artifact@v4 if: matrix.os == 'windows-latest' with: - name: ${{ matrix.target }}-rustls + name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/kubetui.exe - uses: actions/upload-artifact@v4 if: matrix.os != 'windows-latest' with: - name: ${{ matrix.target }}-rustls + name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/kubetui diff --git a/README.md b/README.md index 46d46c47..3a8f74e6 100644 --- a/README.md +++ b/README.md @@ -47,27 +47,19 @@ To install Kubetui, you can use the following methods: [Kubetui](https://formulae.brew.sh/formula/kubetui) is available on [Homebrew](https://brew.sh/), the package manager for macOS and Linux. Install it by running the following command: - ```shell - brew install kubetui - ``` +```shell +brew install kubetui +``` ### Using `cargo install` Kubetui is available on [crates.io](https://crates.io/crates/kubetui), the official Rust package registry. Install it by running the following command: - ```shell - # Install with rustls version - cargo install kubetui - ``` - - or - - ```shell - # Install with openssl version - cargo install kubetui --no-default-features --features openssl-tls - ``` +```shell +cargo install kubetui +``` - Make sure you have [Rust](https://www.rust-lang.org/tools/install) and [Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) installed before running the command. If you choose the OpenSSL version, you will need to have the OpenSSL library installed as well. +Make sure you have [Rust](https://www.rust-lang.org/tools/install) and [Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) installed before running the command. ### Downloading the binary