From f18d135045b8d9d48e41200c7199992435ebcfbf Mon Sep 17 00:00:00 2001 From: wuchyi <49750312+wuchyi@users.noreply.github.com> Date: Wed, 18 Sep 2024 02:09:32 +0800 Subject: [PATCH 1/5] Update main-docker.yml (digests) (#238) Updated digest name on upload (as per 1187084) --- .github/workflows/main-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main-docker.yml b/.github/workflows/main-docker.yml index a46c5b2..134e341 100644 --- a/.github/workflows/main-docker.yml +++ b/.github/workflows/main-docker.yml @@ -78,7 +78,7 @@ jobs: name: Download digests uses: actions/download-artifact@v4.1.7 with: - name: digests + name: digests-${{ matrix.target }} path: /tmp/digests - name: Set up Docker Buildx From 7be29f609cbaf0a9ca00c078f1e8a02232072981 Mon Sep 17 00:00:00 2001 From: wuchyi <49750312+wuchyi@users.noreply.github.com> Date: Wed, 18 Sep 2024 02:37:39 +0800 Subject: [PATCH 2/5] Attempting to fix main-docker.yml for downloading digests (#243) * Update main-docker.yml (digests) Updated digest name on upload (as per 1187084) * Update main-docker.yml (digests download) Trying another fix based on the template provided here https://github.com/actions/download-artifact for downloading multiple (filtered) Artifacts to the same directory --- .github/workflows/main-docker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main-docker.yml b/.github/workflows/main-docker.yml index 134e341..9b7701a 100644 --- a/.github/workflows/main-docker.yml +++ b/.github/workflows/main-docker.yml @@ -78,8 +78,10 @@ jobs: name: Download digests uses: actions/download-artifact@v4.1.7 with: - name: digests-${{ matrix.target }} path: /tmp/digests + pattern: digests-* + merge-multiple: true + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 28f85f2599d72b10e747295f7f1f73e42abe3380 Mon Sep 17 00:00:00 2001 From: Matthew Esposito Date: Tue, 17 Sep 2024 14:39:42 -0400 Subject: [PATCH 3/5] Attempting to fix main-docker.yml for downloading digests From 3625fdfdbe149a76922a8da5a41e8245a5f5cbbe Mon Sep 17 00:00:00 2001 From: Matthew Esposito Date: Tue, 17 Sep 2024 14:42:09 -0400 Subject: [PATCH 4/5] fix(ci): temporarily disable README updates --- .github/workflows/main-docker.yml | 67 ++++++++++++------------------- 1 file changed, 26 insertions(+), 41 deletions(-) diff --git a/.github/workflows/main-docker.yml b/.github/workflows/main-docker.yml index 9b7701a..5442775 100644 --- a/.github/workflows/main-docker.yml +++ b/.github/workflows/main-docker.yml @@ -15,15 +15,13 @@ jobs: fail-fast: false matrix: include: - - { platform: linux/amd64, target: x86_64-unknown-linux-musl} - - { platform: linux/arm64, target: aarch64-unknown-linux-musl} - - { platform: linux/arm/v7, target: armv7-unknown-linux-musleabihf} + - { platform: linux/amd64, target: x86_64-unknown-linux-musl } + - { platform: linux/arm64, target: aarch64-unknown-linux-musl } + - { platform: linux/arm/v7, target: armv7-unknown-linux-musleabihf } steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v4 - - - name: Docker meta + - name: Docker meta id: meta uses: docker/metadata-action@v5 with: @@ -31,21 +29,17 @@ jobs: tags: | type=sha type=raw,value=latest,enable={{is_default_branch}} - - - name: Set up QEMU + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Login to Quay.io Container Registry + - name: Login to Quay.io Container Registry uses: docker/login-action@v3 with: registry: quay.io username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_ROBOT_TOKEN }} - - - name: Build and push + - name: Build and push id: build uses: docker/build-push-action@v5 with: @@ -55,14 +49,12 @@ jobs: outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true file: Dockerfile build-args: TARGET=${{ matrix.target }} - - - name: Export digest + - name: Export digest run: | mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" touch "/tmp/digests/${digest#sha256:}" - - - name: Upload digest + - name: Upload digest uses: actions/upload-artifact@v4 with: name: digests-${{ matrix.target }} @@ -74,19 +66,16 @@ jobs: needs: - build steps: - - - name: Download digests + - name: Download digests uses: actions/download-artifact@v4.1.7 with: path: /tmp/digests pattern: digests-* merge-multiple: true - - - - name: Set up Docker Buildx + + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Docker meta + - name: Docker meta id: meta uses: docker/metadata-action@v5 with: @@ -94,31 +83,27 @@ jobs: tags: | type=sha type=raw,value=latest,enable={{is_default_branch}} - - - name: Login to Quay.io Container Registry + - name: Login to Quay.io Container Registry uses: docker/login-action@v3 with: registry: quay.io username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_ROBOT_TOKEN }} - - - name: Create manifest list and push + - name: Create manifest list and push working-directory: /tmp/digests run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - - name: Push README to Quay.io - uses: christian-korneck/update-container-description-action@v1 - env: - DOCKER_APIKEY: ${{ secrets.APIKEY__QUAY_IO }} - with: - destination_container_repo: quay.io/redlib/redlib - provider: quay - readme_file: 'README.md' + # - name: Push README to Quay.io + # uses: christian-korneck/update-container-description-action@v1 + # env: + # DOCKER_APIKEY: ${{ secrets.APIKEY__QUAY_IO }} + # with: + # destination_container_repo: quay.io/redlib/redlib + # provider: quay + # readme_file: 'README.md' - - - name: Inspect image + - name: Inspect image run: | docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} - From 793047f63f0f603e342c919bbfc469c7569276fa Mon Sep 17 00:00:00 2001 From: Matthew Esposito Date: Wed, 18 Sep 2024 11:24:00 -0400 Subject: [PATCH 5/5] fix(client): revert to hyper-rustls=0.24.2 --- Cargo.lock | 71 ++++++++++++++++++++++----------------------------- Cargo.toml | 2 +- src/client.rs | 7 +---- 3 files changed, 33 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18750b8..a7dfbc0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -161,6 +161,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "base64" version = "0.22.1" @@ -822,9 +828,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.25.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c78f9338483cb7e630c8474b07268983c6bd5acee012e4211f9f7bb21b070" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http", @@ -832,7 +838,6 @@ dependencies = [ "log", "rustls", "rustls-native-certs", - "rustls-pki-types", "tokio", "tokio-rustls", ] @@ -1214,7 +1219,7 @@ version = "0.35.1" dependencies = [ "arc-swap", "askama", - "base64", + "base64 0.22.1", "brotli", "build_html", "cached", @@ -1379,55 +1384,44 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", - "rustls-pki-types", "rustls-webpki", - "subtle", - "zeroize", + "sct", ] [[package]] name = "rustls-native-certs" -version = "0.7.0" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile", - "rustls-pki-types", "schannel", "security-framework", ] [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64", - "rustls-pki-types", + "base64 0.21.7", ] -[[package]] -name = "rustls-pki-types" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" - [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", - "rustls-pki-types", "untrusted", ] @@ -1473,6 +1467,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sealed_test" version = "1.1.0" @@ -1634,12 +1638,6 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - [[package]] name = "syn" version = "1.0.109" @@ -1783,12 +1781,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", - "rustls-pki-types", "tokio", ] @@ -2154,9 +2151,3 @@ dependencies = [ "quote", "syn 2.0.68", ] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/Cargo.toml b/Cargo.toml index 5cf4881..451a83a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ serde = { version = "1.0.193", features = ["derive"] } cookie = "0.18.0" futures-lite = "2.2.0" hyper = { version = "0.14.28", features = ["full"] } -hyper-rustls = "0.25.0" +hyper-rustls = "0.24.2" percent-encoding = "2.3.1" route-recognizer = "0.3.1" serde_json = "1.0.108" diff --git a/src/client.rs b/src/client.rs index 33ea6fe..d4701ba 100644 --- a/src/client.rs +++ b/src/client.rs @@ -26,12 +26,7 @@ const REDDIT_URL_BASE: &str = "https://oauth.reddit.com"; const ALTERNATIVE_REDDIT_URL_BASE: &str = "https://www.reddit.com"; pub static CLIENT: Lazy>> = Lazy::new(|| { - let https = hyper_rustls::HttpsConnectorBuilder::new() - .with_native_roots() - .expect("No native root certificates found") - .https_only() - .enable_http1() - .build(); + let https = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_only().enable_http1().build(); client::Client::builder().build(https) });