From fc702136fc5f3c60975d1882163cee21c3bcf849 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Thu, 30 Mar 2023 23:36:33 +0300 Subject: [PATCH] fix: remove `openssl` dependency, replace with `rustls` --- .github/workflows/release-desktop.yml | 39 +++++---- ...or-arm.yml.disable => release-for-arm.yml} | 6 +- .github/workflows/release-for-mac.yml | 2 +- .github/workflows/release-for-windows.yml | 58 +++++++------- .github/workflows/release.yml | 4 +- Cargo.lock | 80 +++++++------------ addons/Cargo.toml | 4 +- 7 files changed, 81 insertions(+), 112 deletions(-) rename .github/workflows/{release-for-arm.yml.disable => release-for-arm.yml} (99%) diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 6adb0901..075c893a 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -13,9 +13,9 @@ jobs: strategy: fail-fast: false matrix: - platform: [macos-latest, ubuntu-20.04, windows-latest] + platform: [macos-latest, ubuntu-22.04, windows-latest] runs-on: ${{ matrix.platform }} - + steps: - uses: actions/checkout@v3 - name: setup node @@ -33,9 +33,9 @@ jobs: key: ${{ matrix.platform }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install dependencies (mac) only) if: matrix.platform == 'macos-latest' - run: brew install protobuf openssl + run: brew install protobuf - name: Install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-20.04' + if: matrix.platform == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev protobuf-compiler @@ -44,8 +44,6 @@ jobs: run: | choco install protoc choco install checksum - choco install openssl - vcpkg install openssl-windows:x64-windows - name: Install Node Modules run: | cd webui/musicplayer @@ -63,13 +61,13 @@ jobs: run: | cd webui/musicplayer npx @tauri-apps/cli build - - name: Build App (macos arch64-apple-darwin) + - name: Build App (macos arch64-apple-darwin) if: matrix.platform == 'macos-latest' run: | cd webui/musicplayer npx @tauri-apps/cli build --target aarch64-apple-darwin - name: List files - if: matrix.platform == 'ubuntu-20.04' || matrix.platform == 'macos-latest' + if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'macos-latest' run: | ls target/release/bundle/* - name: List files (windows) @@ -78,7 +76,7 @@ jobs: dir target\release\bundle dir target\release\bundle\* - name: Set env - if: matrix.platform == 'ubuntu-20.04' || matrix.platform == 'macos-latest' + if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'macos-latest' run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Create archive (macos) if: matrix.platform == 'macos-latest' @@ -111,16 +109,16 @@ jobs: target/aarch64-apple-darwin/release/bundle/dmg/Music_Player_${{ env.RELEASE_VERSION }}_aarch64.dmg target/aarch64-apple-darwin/release/bundle/dmg/Music_Player_${{ env.RELEASE_VERSION }}_aarch64.dmg.sha256 - name: Hash files (ubuntu) - if: matrix.platform == 'ubuntu-20.04' + if: matrix.platform == 'ubuntu-22.04' run: | - rm -f target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb - rm -f target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage - mv target/release/bundle/appimage/music-player*.AppImage target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage - mv target/release/bundle/deb/music-player*.deb target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb - shasum -a 256 target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage > target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage.sha256 - shasum -a 256 target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb > target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb.sha256 + rm -f target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb + rm -f target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage + mv target/release/bundle/appimage/music-player*.AppImage target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage + mv target/release/bundle/deb/music-player*.deb target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb + shasum -a 256 target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage > target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage.sha256 + shasum -a 256 target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb > target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb.sha256 - name: Releasing artifacts (ubuntu) - if: matrix.platform == 'ubuntu-20.04' + if: matrix.platform == 'ubuntu-22.04' uses: softprops/action-gh-release@v1 with: files: | @@ -131,9 +129,9 @@ jobs: - name: Hash files (windows) if: matrix.platform == 'windows-latest' run: | - Remove-Item -Force target/release/bundle/msi/Music Player_x64_en-US.msi - move target/release/bundle/msi/Music*.msi target/release/bundle/msi/Music Player_x64_en-US.msi - checksum -t sha256 -f="target/release/bundle/msi/Music Player_x64_en-US.msi" > target/release/bundle/msi/Music_Player_x64_en-US.msi.sha256 + Remove-Item -Force target/release/bundle/msi/Music Player_x64_en-US.msi + move target/release/bundle/msi/Music*.msi target/release/bundle/msi/Music Player_x64_en-US.msi + checksum -t sha256 -f="target/release/bundle/msi/Music Player_x64_en-US.msi" > target/release/bundle/msi/Music_Player_x64_en-US.msi.sha256 - name: Releasing artifacts (windows) if: matrix.platform == 'windows-latest' uses: softprops/action-gh-release@v1 @@ -141,4 +139,3 @@ jobs: files: | target/release/bundle/msi/Music Player_x64_en-US.msi target/release/bundle/msi/Music_Player_x64_en-US.msi.sha256 - \ No newline at end of file diff --git a/.github/workflows/release-for-arm.yml.disable b/.github/workflows/release-for-arm.yml similarity index 99% rename from .github/workflows/release-for-arm.yml.disable rename to .github/workflows/release-for-arm.yml index 0f5eec63..f16383c3 100644 --- a/.github/workflows/release-for-arm.yml.disable +++ b/.github/workflows/release-for-arm.yml @@ -5,7 +5,7 @@ on: jobs: release: name: release ${{ matrix.target }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -118,7 +118,7 @@ jobs: if: matrix.target == 'x86_64-linux-android' run: | echo "RUSTFLAGS=-C linker=x86_64-linux-android-clang -L$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/33 -lc++ -lstdc++ -lc" >> $GITHUB_ENV - + - name: Build webui run: | cd webui/musicplayer @@ -150,4 +150,4 @@ jobs: - name: "✏️ Generate release changelog" uses: heinrichreimer/github-changelog-generator-action@v2.3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-for-mac.yml b/.github/workflows/release-for-mac.yml index 6c39b2fe..786ad25a 100644 --- a/.github/workflows/release-for-mac.yml +++ b/.github/workflows/release-for-mac.yml @@ -32,7 +32,7 @@ jobs: - uses: actions-rs/cargo@v1 - name: Installing needed dependencies - run: brew install protobuf openssl + run: brew install protobuf - name: Install aarch64-apple-darwin toolchain if: matrix.target == 'aarch64-apple-darwin' run: rustup target add aarch64-apple-darwin diff --git a/.github/workflows/release-for-windows.yml b/.github/workflows/release-for-windows.yml index adc29530..e87495e6 100644 --- a/.github/workflows/release-for-windows.yml +++ b/.github/workflows/release-for-windows.yml @@ -6,34 +6,32 @@ jobs: compile: name: Compile runs-on: windows-latest - + steps: - - uses: actions/checkout@master - - name: Install dependencies - run: | - choco install protoc - choco install rust - choco install checksum - choco install archiver - choco install nodejs-lts - choco install openssl - vcpkg install openssl-windows:x64-windows - refreshenv - - name: Build - run: | - cd webui\musicplayer - npm install -g yarn - yarn install --network-timeout 1000000000 - yarn build - cd ..\.. - cargo build --release - arc archive music-player_x86_64-pc-windows-gnu.tar.gz target\release\music-player.exe - checksum -t sha256 -f="music-player_x86_64-pc-windows-gnu.tar.gz" > music-player_x86_64-pc-windows-gnu.tar.gz.sha256 - - name: Releasing assets - uses: softprops/action-gh-release@v1 - with: - files: | - music-player_x86_64-pc-windows-gnu.tar.gz - music-player_x86_64-pc-windows-gnu.tar.gz.sha256 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@master + - name: Install dependencies + run: | + choco install protoc + choco install rust + choco install checksum + choco install archiver + choco install nodejs-lts + refreshenv + - name: Build + run: | + cd webui\musicplayer + npm install -g yarn + yarn install --network-timeout 1000000000 + yarn build + cd ..\.. + cargo build --release + arc archive music-player_x86_64-pc-windows-gnu.tar.gz target\release\music-player.exe + checksum -t sha256 -f="music-player_x86_64-pc-windows-gnu.tar.gz" > music-player_x86_64-pc-windows-gnu.tar.gz.sha256 + - name: Releasing assets + uses: softprops/action-gh-release@v1 + with: + files: | + music-player_x86_64-pc-windows-gnu.tar.gz + music-player_x86_64-pc-windows-gnu.tar.gz.sha256 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76eb0692..4214b618 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: jobs: release: name: release ${{ matrix.target }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -59,4 +59,4 @@ jobs: - name: "✏️ Generate release changelog" uses: heinrichreimer/github-changelog-generator-action@v2.3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index f4792280..a3affaad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1425,18 +1425,19 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chromecast" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5453602895cb7a51331fef2f2cffd8234b8a82ff0d1e30f6125925305b878b6b" +checksum = "0a596cf19a017c7a681aac872f6701ebf2f54523e2d76dab64b8af8bf6343539" dependencies = [ "byteorder", "log", - "openssl", "protobuf 3.2.0", "protobuf-codegen 3.2.0", + "rustls 0.21.0", "serde", "serde_derive", "serde_json", + "webpki-roots 0.22.6", ] [[package]] @@ -4292,7 +4293,7 @@ dependencies = [ [[package]] name = "music-player-addons" -version = "0.1.3" +version = "0.1.4" dependencies = [ "anyhow", "async-trait", @@ -4931,61 +4932,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl" -version = "0.10.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-src" -version = "111.25.0+1.1.1t" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3173cd3626c43e3854b1b727422a276e568d9ec5fe8cec197822cf52cfb743d6" -dependencies = [ - "cc", -] - -[[package]] -name = "openssl-sys" -version = "0.9.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" -dependencies = [ - "autocfg", - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] - [[package]] name = "ordered-multimap" version = "0.4.3" @@ -6159,6 +6111,18 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "rustls" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07180898a28ed6a7f7ba2311594308f595e3dd2e3c3812fa0a80a47b45f17e5d" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct 0.7.0", +] + [[package]] name = "rustls-native-certs" version = "0.6.2" @@ -6180,6 +6144,16 @@ dependencies = [ "base64 0.21.0", ] +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.11" diff --git a/addons/Cargo.toml b/addons/Cargo.toml index e346f6ea..37651a00 100644 --- a/addons/Cargo.toml +++ b/addons/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "music-player-addons" -version = "0.1.3" +version = "0.1.4" edition = "2021" repository = "https://github.com/tsirysndr/music-player" license = "MIT" @@ -33,5 +33,5 @@ upnp-client = "0.1.7" futures = "0.3.26" tokio = { version = "1.25.0", features = ["time"] } hyper = { version = "0.14.23", features = ["runtime", "client", "stream", "tcp", "http1", "http2"] } -chromecast = { version = "0.18.1", features = ["thread_safe"] } +chromecast = { version = "0.18.2", features = ["thread_safe"] } futures-util = "0.3.26"