From ea72b726a4825189f2e6b5532907381a1a221fa0 Mon Sep 17 00:00:00 2001 From: Asuka Miya <68452494+KanaMiao@users.noreply.github.com> Date: Sun, 17 Sep 2023 23:50:51 +0800 Subject: [PATCH 1/3] [skip ci] Update Workflow run --- .github/workflows/ci.yml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3439635a..877074a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,13 +35,7 @@ jobs: - uses: actions/checkout@v3 - name: Build - run: | - docker run -i --rm \ - -v $PWD:/workdir \ - -v ~/.cargo/git:/root/.cargo/git \ - -v ~/.cargo/registry:/root/.cargo/registry \ - registry.gitlab.com/rust_musl_docker/image:stable-latest \ - cargo build --profile=fast -vv --target=x86_64-unknown-linux-musl + run: cargo build --profile=fast -vv --target=x86_64-unknown-linux-musl - name: Upload Build Artifact uses: actions/upload-artifact@v3.1.0 with: @@ -61,20 +55,21 @@ jobs: uses: actions/download-artifact@v3 with: name: biliroaming-rust-server-${{ github.run_number }} - - name: Delete old release assets - uses: mknejp/delete-release-assets@v1 - with: - token: ${{ github.token }} - tag: alpha-releases - assets: | - biliroaming_rust_server - - name: Release - uses: softprops/action-gh-release@v1 + - name: Update Alpha Release + uses: mini-bomba/create-github-release@v1.1.3 with: prerelease: true - tag_name: alpha-releases + tag: alpha-releases + name: Alpha-Release + body: | + This automatic prerelease is built from commit ${{ env.GIT_HASH }} and was triggered by @${{ github.actor }} + [Github Actions workflow run that built this prerelease](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + + Commit message: + ${{ env.GIT_MESSAGE }} files: | ./biliroaming_rust_server + clear_attachments: true release: name: Upload the binary file when it is released From 93660b10bde1b3fdfef50d8739237198923cb556 Mon Sep 17 00:00:00 2001 From: Asuka Miya <68452494+KanaMiao@users.noreply.github.com> Date: Sun, 17 Sep 2023 23:56:01 +0800 Subject: [PATCH 2/3] fix: unlimit longer access_key again & Add logs --- src/mods/handler.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mods/handler.rs b/src/mods/handler.rs index a4362f76..9deaec30 100644 --- a/src/mods/handler.rs +++ b/src/mods/handler.rs @@ -409,7 +409,8 @@ pub async fn handle_search_request(req: &HttpRequest, is_app: bool, is_th: bool) // detect user's access_key params.access_key = match query.get("access_key") { Some(key) => { - if key.len() != 32 && key.len() != 107 { + if key.len() < 32 { + error!("[GET SEARCH] IP {client_ip} -> Detect req with invalid access_key {key}"); build_response!(EType::UserNotLoginedError); } else { key.split_at(32).0 @@ -614,7 +615,8 @@ pub async fn handle_th_season_request( // detect user's access_key params.access_key = match query.get("access_key") { Some(key) => { - if key.len() != 32 && key.len() != 107 { + if key.len() < 32 { + error!("[GET TH SEASON] IP {client_ip} -> Detect req with invalid access_key {key}"); build_response!(EType::UserNotLoginedError); } else { key.split_at(32).0 From f6087077dde140712a7586ee261b8a2ce536edc8 Mon Sep 17 00:00:00 2001 From: KanaMiao Date: Mon, 18 Sep 2023 01:05:50 +0800 Subject: [PATCH 3/3] fix: Revert some workflow change --- .github/workflows/ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 877074a3..9ea5631f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,13 @@ jobs: - uses: actions/checkout@v3 - name: Build - run: cargo build --profile=fast -vv --target=x86_64-unknown-linux-musl + run: | + docker run -i --rm \ + -v $PWD:/workdir \ + -v ~/.cargo/git:/root/.cargo/git \ + -v ~/.cargo/registry:/root/.cargo/registry \ + registry.gitlab.com/rust_musl_docker/image:stable-latest \ + cargo build --profile=fast -vv --target=x86_64-unknown-linux-musl - name: Upload Build Artifact uses: actions/upload-artifact@v3.1.0 with: @@ -58,6 +64,7 @@ jobs: - name: Update Alpha Release uses: mini-bomba/create-github-release@v1.1.3 with: + token: ${{ secrets.GITHUB_TOKEN }} prerelease: true tag: alpha-releases name: Alpha-Release