diff --git a/.dockerignore b/.dockerignore index a90d171..3ba51c6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ .env* .pre-commit-config.yaml -*.example \ No newline at end of file +*.example +target/ \ No newline at end of file diff --git a/.env.example b/.env.example index 9aae7f9..9100363 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ APP_ENV=dev +API_HOST=127.0.0.1 API_PORT=8665 DATABASE_HOST=localhost DATABASE_PORT=3306 @@ -16,6 +17,11 @@ REDIS_PORT=6379 REDIS_USERNAME= REDIS_PASSWORD= REDIS_DATABASE=0 -BEATMAPS_PATH= +REDIS_USE_SSL=false +AWS_REGION=ca-central-1 +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_ENDPOINT_URL= +AWS_BUCKET_NAME= SERVICE_READINESS_TIMEOUT=60 -RUST_LOG=performance_service=info \ No newline at end of file +RUST_LOG=performance_service=info diff --git a/.github/workflows/k8s-deploy.yml b/.github/workflows/k8s-deploy.yml new file mode 100644 index 0000000..d5c1689 --- /dev/null +++ b/.github/workflows/k8s-deploy.yml @@ -0,0 +1,91 @@ +name: k8s-deploy + +on: + push: + branches: + - main + - k8s-deploy + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + production-deploy: + runs-on: ubuntu-latest + + steps: + - name: Check out latest commit + uses: actions/checkout@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: osuAkatsuki/performance-service + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/performance-service:latest + ${{ secrets.DOCKERHUB_USERNAME }}/performance-service:${{ github.sha }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Get kubeconfig from github secrets + run: | + mkdir -p $HOME/.kube + echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config + sudo chown $(id -u):$(id -g) $HOME/.kube/config + + - name: Install helm + uses: azure/setup-helm@v3 + with: + version: "latest" + token: ${{ secrets.GITHUB_TOKEN }} + id: install + + - name: Install helm-diff + run: helm plugin install https://github.com/databus23/helm-diff + + - name: Checkout common-helm-charts repo + uses: actions/checkout@v3 + with: + repository: osuAkatsuki/common-helm-charts + token: ${{ secrets.COMMON_HELM_CHARTS_PAT }} + path: common-helm-charts + + - name: Show manifest diff since previous release + run: | + helm diff upgrade \ + --allow-unreleased \ + --values chart/values.yaml \ + performance-service-production \ + common-helm-charts/microservice-base/ + + - name: Deploy service to production cluster + run: | + helm upgrade \ + --install \ + --atomic \ + --wait --timeout 480s \ + --values chart/values.yaml \ + performance-service-production \ + common-helm-charts/microservice-base/ diff --git a/.github/workflows/production-deploy.yml b/.github/workflows/production-deploy.yml index 88046be..16f8a10 100644 --- a/.github/workflows/production-deploy.yml +++ b/.github/workflows/production-deploy.yml @@ -1,25 +1,26 @@ -name: production-deploy -on: - push: - branches: - - main +# TODO: fix production deploys +# name: production-deploy +# on: +# push: +# branches: +# - main -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Run deploy on production - uses: appleboy/ssh-action@v1.0.0 - with: - host: ${{ secrets.SSH_HOST }} - username: ${{ secrets.SSH_USERNAME }} - key: ${{ secrets.SSH_KEY }} - port: ${{ secrets.SSH_PORT }} - script_stop: true - script: | - cd /home/akatsuki/performance-service - git pull origin main - docker build -t performance-service:latest . - cd /home/akatsuki/workbench - docker-compose restart performance-service-api performance-service-processor +# jobs: +# build: +# name: Build +# runs-on: ubuntu-latest +# steps: +# - name: Run deploy on production +# uses: appleboy/ssh-action@v1.0.0 +# with: +# host: ${{ secrets.SSH_HOST }} +# username: ${{ secrets.SSH_USERNAME }} +# key: ${{ secrets.SSH_KEY }} +# port: ${{ secrets.SSH_PORT }} +# script_stop: true +# script: | +# cd /home/akatsuki/performance-service +# git pull origin main +# docker build -t performance-service:latest . +# cd /home/akatsuki/workbench +# docker-compose restart performance-service-api performance-service-processor diff --git a/Cargo.lock b/Cargo.lock index f84d12e..e4d4607 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,11 +2,26 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ "getrandom", "once_cell", @@ -14,18 +29,21 @@ dependencies = [ ] [[package]] -name = "aho-corasick" -version = "0.7.20" +name = "ahash" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ - "memchr", + "cfg-if", + "once_cell", + "version_check", + "zerocopy", ] [[package]] name = "akatsuki-pp" version = "0.9.3" -source = "git+https://github.com/osuAkatsuki/akatsuki-pp-rs?branch=conceptual-rework#a243c7efcf4a44884634c948a0fc2f502b213965" +source = "git+https://github.com/osuAkatsuki/akatsuki-pp-rs?branch=conceptual-rework#93d84455b60ecf65beedaf7de81df9d8680f7aa7" dependencies = [ "tokio", ] @@ -38,6 +56,14 @@ dependencies = [ "tokio", ] +[[package]] +name = "akatsuki-pp" +version = "0.9.4" +source = "git+https://github.com/osuAkatsuki/akatsuki-pp-rs?rev=4ae182f4f294e6ac34eca1dc2e5f676748c4fd76#4ae182f4f294e6ac34eca1dc2e5f676748c4fd76" +dependencies = [ + "tokio", +] + [[package]] name = "akatsuki-pp" version = "0.9.4" @@ -46,11 +72,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "amq-protocol" -version = "7.0.1" +version = "7.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc7cad07d1b4533fcb46f0819a6126fa201fd0385469aba75e405424f3fe009" +checksum = "1d40d8b2465c7959dd40cee32ba6ac334b5de57e9fca0cc756759894a4152a5d" dependencies = [ "amq-protocol-tcp", "amq-protocol-types", @@ -62,9 +94,9 @@ dependencies = [ [[package]] name = "amq-protocol-tcp" -version = "7.0.1" +version = "7.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8b20aba8c35a0b885e1e978eff456ced925730a4e012e63e4ff89a1deb602b" +checksum = "9cb2100adae7da61953a2c3a01935d86caae13329fadce3333f524d6d6ce12e2" dependencies = [ "amq-protocol-uri", "tcp-stream", @@ -73,9 +105,9 @@ dependencies = [ [[package]] name = "amq-protocol-types" -version = "7.0.1" +version = "7.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e245e0e9083b6a6db5f8c10013074cb382266eb9e2a37204d19c651b8d3b8114" +checksum = "156ff13c8a3ced600b4e54ed826a2ae6242b6069d00dd98466827cef07d3daff" dependencies = [ "cookie-factory", "nom", @@ -85,15 +117,21 @@ dependencies = [ [[package]] name = "amq-protocol-uri" -version = "7.0.1" +version = "7.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56987108bf48d2eb500cae8896cd9291564eedd8744776ecc5c3338a8b2ca5f8" +checksum = "751bbd7d440576066233e740576f1b31fdc6ab86cfabfbd48c548de77eca73e4" dependencies = [ "amq-protocol-types", "percent-encoding", "url", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -105,32 +143,45 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.70" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "d37875bd9915b7d67c2f117ea2c30a0989874d0b2cb694fe25403c85763c0c9e" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 3.1.0", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b" +checksum = "4b0c4a4f319e45986f347ee47fef8bf5e81c9abc3f6f58dc2391439f30df65f0" dependencies = [ - "async-lock", + "async-lock 2.8.0", "async-task", "concurrent-queue", - "fastrand", - "futures-lite", + "fastrand 2.0.1", + "futures-lite 1.13.0", "slab", ] @@ -140,12 +191,12 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-executor", "async-io", - "async-lock", + "async-lock 2.8.0", "blocking", - "futures-lite", + "futures-lite 1.13.0", "once_cell", ] @@ -166,27 +217,38 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", "polling", - "rustix 0.37.3", + "rustix 0.37.27", "slab", - "socket2", + "socket2 0.4.10", "waker-fn", ] [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "deb2ab2aa8a746e221ab826c73f48bc6ba41be6763f0855cb249eb6d154cf1d7" dependencies = [ - "event-listener", + "event-listener 3.1.0", + "event-listener-strategy", + "pin-project-lite", ] [[package]] @@ -203,19 +265,19 @@ dependencies = [ [[package]] name = "async-task" -version = "4.4.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.9", + "syn 2.0.39", ] [[package]] @@ -229,9 +291,23 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "debc29dde2e69f9e47506b525f639ed42300fc014a3e007832592448fa8e4599" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "attohttpc" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fcf00bc6d5abb29b5f97e3c61a90b6d3caa12f3faf897d4a3e3607c050a35a7" +dependencies = [ + "http", + "log", + "native-tls", + "serde", + "serde_json", + "url", +] [[package]] name = "atty" @@ -250,6 +326,32 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "aws-creds" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3776743bb68d4ad02ba30ba8f64373f1be4e082fe47651767171ce75bb2f6cf5" +dependencies = [ + "attohttpc", + "dirs", + "log", + "quick-xml", + "rust-ini", + "serde", + "thiserror", + "time", + "url", +] + +[[package]] +name = "aws-region" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42fed2b9fca70f2908268d057a607f2a906f47edbf856ea8587de9038d264e22" +dependencies = [ + "thiserror", +] + [[package]] name = "axum" version = "0.3.4" @@ -257,7 +359,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4e96976b2022b23b2199168ff9b281e9ddc1aa795607d5cb7146868ca5c101" dependencies = [ "async-trait", - "bitflags", + "bitflags 1.3.2", "bytes", "futures-util", "http", @@ -279,6 +381,21 @@ dependencies = [ "tower-service", ] +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.13.1" @@ -287,9 +404,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -315,6 +432,24 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -326,25 +461,27 @@ dependencies = [ [[package]] name = "block-padding" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a90ec2df9600c28a01c56c4784c9207a96d2451833aeceb8cc97e4c9548bb78" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" dependencies = [ "generic-array", ] [[package]] name = "blocking" -version = "1.3.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c67b173a56acffd6d2326fb7ab938ba0b00a71480e14902b2591c87bc5741e8" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel", - "async-lock", + "async-channel 2.1.0", + "async-lock 3.1.0", "async-task", - "atomic-waker", - "fastrand", - "futures-lite", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.0.1", + "piper", + "tracing", ] [[package]] @@ -359,15 +496,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytecheck" -version = "0.6.10" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13fe11640a23eb24562225322cd3e452b93a3d4091d62fab69c70542fcd17d1f" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -376,9 +513,9 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.6.10" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31225543cb46f81a7e224762764f4a6a0f097b1db0b175f69e8065efaa42de5" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ "proc-macro2", "quote", @@ -387,15 +524,15 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cbc" @@ -408,9 +545,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -420,18 +560,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "serde", - "time", "wasm-bindgen", - "winapi", + "windows-targets", ] [[package]] @@ -446,15 +585,15 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.23" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", - "bitflags", + "bitflags 1.3.2", "clap_derive", "clap_lex", - "indexmap", + "indexmap 1.9.3", "once_cell", "strsim", "termcolor", @@ -463,9 +602,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.18" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ "heck", "proc-macro-error", @@ -483,16 +622,6 @@ dependencies = [ "os_str_bytes", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "combine" version = "4.6.6" @@ -504,14 +633,14 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "tokio-util 0.7.7", + "tokio-util 0.7.10", ] [[package]] name = "concurrent-queue" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] @@ -540,15 +669,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -564,9 +693,9 @@ dependencies = [ [[package]] name = "crc-catalog" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crossbeam-queue" @@ -580,9 +709,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -607,50 +736,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "cxx" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c00419335c41018365ddf7e4d5f1c12ee3659ddcf3e01974650ba1de73d038" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb8307ad413a98fff033c8545ecf133e3257747b3bae935e7602aab8aa92d4ca" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 2.0.9", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc52e2eb08915cb12596d29d55f0b5384f00d697a646dbd269b6ecb0fbd9d31" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631569015d0d8d54e6c241733f944042623ab6df7bc3be7466874b05fcdb1c5f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.9", -] - [[package]] name = "deadpool" version = "0.9.5" @@ -677,9 +762,9 @@ dependencies = [ [[package]] name = "deadpool-runtime" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1" +checksum = "63dfa964fe2a66f3fde91fc70b267fe193d822c7e603e2a675a49a7f46ad3f49" dependencies = [ "tokio", ] @@ -695,6 +780,16 @@ dependencies = [ "pem-rfc7468", ] +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", + "serde", +] + [[package]] name = "des" version = "0.8.1" @@ -706,15 +801,41 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", "subtle", ] +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dlv-list" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" + [[package]] name = "doc-comment" version = "0.3.3" @@ -735,69 +856,70 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] -name = "env_logger" -version = "0.9.3" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] -name = "errno" -version = "0.2.8" +name = "erased-serde" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" dependencies = [ - "errno-dragonfly", - "libc", - "winapi", + "serde", ] [[package]] name = "errno" -version = "0.3.0" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" dependencies = [ - "errno-dragonfly", "libc", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" dependencies = [ - "cc", - "libc", + "concurrent-queue", + "parking", + "pin-project-lite", ] [[package]] -name = "event-listener" -version = "2.5.3" +name = "event-listener-strategy" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "d96b852f1345da36d551b9473fa1e2b1eb5c5195585c6c018118bc92a8d91160" +dependencies = [ + "event-listener 3.1.0", + "pin-project-lite", +] [[package]] name = "executor-trait" @@ -817,6 +939,18 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "finl_unicode" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" + [[package]] name = "flume" version = "0.10.14" @@ -826,7 +960,16 @@ dependencies = [ "futures-core", "futures-sink", "pin-project", - "spin 0.9.6", + "spin 0.9.8", +] + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "spin 0.9.8", ] [[package]] @@ -852,18 +995,24 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futures" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -876,9 +1025,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -886,15 +1035,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -914,17 +1063,17 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -933,34 +1082,44 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3831c2651acb5177cbd83943f3d9c8912c5ad03c76afcc0e9511ba568ec5ebb" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "futures-macro" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -976,9 +1135,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -986,20 +1145,26 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + [[package]] name = "h2" -version = "0.3.16" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -1007,10 +1172,10 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 2.1.0", "slab", "tokio", - "tokio-util 0.7.7", + "tokio-util 0.7.10", "tracing", ] @@ -1020,16 +1185,26 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.7", +] + +[[package]] +name = "hashbrown" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +dependencies = [ + "ahash 0.8.6", + "allocator-api2", ] [[package]] name = "hashlink" -version = "0.8.1" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown", + "hashbrown 0.14.2", ] [[package]] @@ -1052,18 +1227,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -1082,9 +1248,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -1104,9 +1270,9 @@ dependencies = [ [[package]] name = "http-range-header" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" @@ -1116,21 +1282,15 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1143,7 +1303,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -1165,33 +1325,32 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.54" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c17cc76786e99f8d2f055c11159e7f0091c42474dcc3189fbab96072e873e6d" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows-core", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1199,12 +1358,22 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.2", ] [[package]] @@ -1228,57 +1397,57 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi 0.3.3", "libc", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] name = "ipnet" -version = "2.7.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itertools" -version = "0.10.5" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] [[package]] name = "lapin" -version = "2.1.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd03ea5831b44775e296239a64851e2fd14a80a363d202ba147009ffc994ff0f" +checksum = "5f3067a1fcfbc3fc46455809c023e69b8f6602463201010f4ae5a3b572adb9dc" dependencies = [ "amq-protocol", "async-global-executor-trait", "async-reactor-trait", "async-trait", "executor-trait", - "flume", + "flume 0.10.14", "futures-core", "futures-io", "parking_lot 0.12.1", @@ -1300,42 +1469,44 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.140" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libm" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "link-cplusplus" -version = "1.0.8" +name = "libredox" +version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "cc", + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", ] [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.3.0" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd550e73688e6d578f0ac2119e32b797a327631a42f9433e59d02e139c8df60d" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1343,11 +1514,12 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ - "cfg-if", + "serde", + "value-bag", ] [[package]] @@ -1356,11 +1528,28 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9376a4f0340565ad675d11fc1419227faf5f60cd7ac9cb2e7185a471f30af833" +[[package]] +name = "maybe-async" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f1b8c13cb1f814b634a96b2c725449fe7ed464a7b8781de8688be5ffbd3f305" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "md5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" + [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "mime" @@ -1368,22 +1557,39 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minidom" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f45614075738ce1b77a1768912a60c0227525971b03e09122a05b8a34a2a6278" +dependencies = [ + "rxml", +] + [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + [[package]] name = "mio" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "wasi", + "windows-sys", ] [[package]] @@ -1416,9 +1622,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -1427,9 +1633,9 @@ dependencies = [ [[package]] name = "num-bigint-dig" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2399c9463abc5f909349d8aa9ba080e0b88b3ce2885389b60b993f39b1a56905" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" dependencies = [ "byteorder", "lazy_static", @@ -1465,9 +1671,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -1475,27 +1681,36 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.3", "libc", ] +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.48" +version = "0.10.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518915b97df115dd36109bfa429a48b8f737bd05508cf9588977b599648926d2" +checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" dependencies = [ - "bitflags", + "bitflags 2.4.1", "cfg-if", "foreign-types", "libc", @@ -1506,13 +1721,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] @@ -1523,22 +1738,31 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.83" +version = "0.9.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666416d899cf077260dac8698d60a60b435a46d57e82acb1be3d0dad87284e5b" +checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" dependencies = [ - "autocfg", "cc", "libc", "pkg-config", "vcpkg", ] +[[package]] +name = "ordered-multimap" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" +dependencies = [ + "dlv-list", + "hashbrown 0.12.3", +] + [[package]] name = "os_str_bytes" -version = "6.5.0" +version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" [[package]] name = "p12" @@ -1559,9 +1783,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -1581,7 +1805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.7", + "parking_lot_core 0.9.9", ] [[package]] @@ -1593,29 +1817,29 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", - "windows-sys 0.45.0", + "windows-targets", ] [[package]] name = "paste" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pem-rfc7468" @@ -1628,9 +1852,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "performance-service" @@ -1638,6 +1862,7 @@ version = "0.1.0" dependencies = [ "akatsuki-pp 0.9.3", "akatsuki-pp 0.9.4 (git+https://github.com/osuAkatsuki/akatsuki-pp-rs?branch=skill-rebalance)", + "akatsuki-pp 0.9.4 (git+https://github.com/osuAkatsuki/akatsuki-pp-rs?rev=4ae182f4f294e6ac34eca1dc2e5f676748c4fd76)", "akatsuki-pp 0.9.4 (git+https://github.com/osuAkatsuki/akatsuki-pp-rs?rev=764da0dbf42ed80441acf99d070aaedabaed4b75)", "anyhow", "async-trait", @@ -1649,17 +1874,18 @@ dependencies = [ "deadpool", "deadpool-lapin", "dotenv", - "env_logger", "futures", "lapin", "log", "redis", "reqwest", "rkyv", + "rust-s3", "serde", "serde_json", "sqlx", "strsim", + "structured-logger", "tokio", "tokio-executor-trait", "tokio-stream", @@ -1670,29 +1896,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1702,16 +1928,27 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pinky-swear" -version = "6.1.0" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d894b67aa7a4bf295db5e85349078c604edaa6fa5c8721e8eca3c7729a27f2ac" +checksum = "6cfae3ead413ca051a681152bd266438d3bfa301c9bdf836939a14c721bb2a21" dependencies = [ "doc-comment", - "flume", + "flume 0.11.0", "parking_lot 0.12.1", "tracing", ] +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkcs1" version = "0.3.3" @@ -1736,26 +1973,32 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "polling" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e1f879b2998099c2d69ab9605d145d5b661195627eccc680002c4918a7fb6fa" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", - "bitflags", + "bitflags 1.3.2", "cfg-if", "concurrent-queue", "libc", "log", "pin-project-lite", - "windows-sys 0.45.0", + "windows-sys", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1788,9 +2031,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.53" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -1815,15 +2058,31 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "quick-xml" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f50b1c63b38611e7d4d7f68b82d3ad0cc71a2ad2e7f61fc10f1328d917c93cd" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "quote" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rand" version = "0.8.5" @@ -1890,7 +2149,7 @@ dependencies = [ "ryu", "sha1_smol", "tokio", - "tokio-util 0.7.7", + "tokio-util 0.7.10", "url", ] @@ -1900,42 +2159,45 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] -name = "regex" -version = "1.7.2" +name = "redox_syscall" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce168fea28d3e05f158bda4576cf0c844d5045bc2cc3620fa0292ed5bb5814c" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "bitflags 1.3.2", ] [[package]] -name = "regex-syntax" -version = "0.6.29" +name = "redox_users" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] [[package]] name = "rend" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] [[package]] name = "reqwest" -version = "0.11.15" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ba30cc2c0cd02af1222ed216ba659cdb2f879dfe3181852fe7c50b1d0005949" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.0", + "base64 0.21.5", "bytes", "encoding_rs", "futures-core", @@ -1956,12 +2218,15 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", + "tokio-util 0.7.10", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "winreg", ] @@ -1974,38 +2239,40 @@ checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" [[package]] name = "ring" -version = "0.16.20" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", - "spin 0.5.2", + "spin 0.9.8", "untrusted", - "web-sys", - "winapi", + "windows-sys", ] [[package]] name = "rkyv" -version = "0.7.40" +version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c30f1d45d9aa61cbc8cd1eb87705470892289bb2d01943e7803b873a57404dc3" +checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" dependencies = [ + "bitvec", "bytecheck", - "hashbrown", + "hashbrown 0.12.3", "ptr_meta", "rend", "rkyv_derive", "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.40" +version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff26ed6c7c4dfc2aa9480b86a60e3c7233543a270a680e10758a507c5a4ce476" +checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" dependencies = [ "proc-macro2", "quote", @@ -2013,82 +2280,130 @@ dependencies = [ ] [[package]] -name = "rsa" -version = "0.6.1" +name = "rsa" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" +dependencies = [ + "byteorder", + "digest", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "smallvec", + "subtle", + "zeroize", +] + +[[package]] +name = "rust-ini" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" +dependencies = [ + "cfg-if", + "ordered-multimap", +] + +[[package]] +name = "rust-s3" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b2ac5ff6acfbe74226fa701b5ef793aaa054055c13ebb7060ad36942956e027" +dependencies = [ + "async-trait", + "aws-creds", + "aws-region", + "base64 0.13.1", + "bytes", + "cfg-if", + "futures", + "hex", + "hmac", + "http", + "log", + "maybe-async", + "md5", + "minidom", + "percent-encoding", + "quick-xml", + "reqwest", + "serde", + "serde_derive", + "sha2", + "thiserror", + "time", + "tokio", + "tokio-stream", + "url", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" -dependencies = [ - "byteorder", - "digest", - "num-bigint-dig", - "num-integer", - "num-iter", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core", - "smallvec", - "subtle", - "zeroize", -] +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.36.11" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ - "bitflags", - "errno 0.2.8", + "bitflags 1.3.2", + "errno", "io-lifetimes", "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", + "linux-raw-sys 0.3.8", + "windows-sys", ] [[package]] name = "rustix" -version = "0.37.3" +version = "0.38.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" +checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" dependencies = [ - "bitflags", - "errno 0.3.0", - "io-lifetimes", + "bitflags 2.4.1", + "errno", "libc", - "linux-raw-sys 0.3.0", - "windows-sys 0.45.0", + "linux-raw-sys 0.4.11", + "windows-sys", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ "log", "ring", + "rustls-webpki", "sct", - "webpki", ] [[package]] name = "rustls-connector" -version = "0.16.1" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c6a18f8d10f71bce9bca6eaeb80429460e652f3bcf0381f0c5f8954abf7b3b8" +checksum = "25da151615461c7347114b1ad1a7458b4cdebc69cb220cd140cd5cb324b1dd37" dependencies = [ "log", "rustls", "rustls-native-certs", - "webpki", + "rustls-webpki", ] [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -2098,45 +2413,66 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.0", + "base64 0.21.5", ] [[package]] -name = "ryu" -version = "1.0.13" +name = "rustls-webpki" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] [[package]] -name = "schannel" -version = "0.1.21" +name = "rxml" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "a98f186c7a2f3abbffb802984b7f1dfd65dac8be1aafdaabbca4137f53f0dff7" dependencies = [ - "windows-sys 0.42.0", + "bytes", + "rxml_validation", + "smartstring", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "rxml_validation" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22a197350ece202f19a166d1ad6d9d6de145e1d2a8ef47db299abe164dbd7530" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "schannel" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys", +] [[package]] -name = "scratch" -version = "1.0.5" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", @@ -2150,11 +2486,11 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -2163,9 +2499,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -2173,29 +2509,38 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.158" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.158" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.9", + "syn 2.0.39", +] + +[[package]] +name = "serde_fmt" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4" +dependencies = [ + "serde", ] [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -2216,9 +2561,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -2233,9 +2578,9 @@ checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -2259,29 +2604,50 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "smartstring" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" +dependencies = [ + "autocfg", + "static_assertions", + "version_check", +] [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "spin" version = "0.5.2" @@ -2290,9 +2656,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.9.6" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d6e0250b93c8427a177b849d144a96d5acc57006149479403d7861ab721e34" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ "lock_api", ] @@ -2309,9 +2675,9 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" +checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" dependencies = [ "itertools", "nom", @@ -2334,9 +2700,9 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" dependencies = [ - "ahash", + "ahash 0.7.7", "atoi", - "bitflags", + "bitflags 1.3.2", "byteorder", "bytes", "chrono", @@ -2345,7 +2711,7 @@ dependencies = [ "digest", "dotenvy", "either", - "event-listener", + "event-listener 2.5.3", "futures-channel", "futures-core", "futures-intrusive", @@ -2353,7 +2719,7 @@ dependencies = [ "generic-array", "hashlink", "hex", - "indexmap", + "indexmap 1.9.3", "itoa", "libc", "log", @@ -2406,12 +2772,19 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" dependencies = [ + "finl_unicode", "unicode-bidi", "unicode-normalization", ] @@ -2422,11 +2795,92 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "structured-logger" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16524b1ef57fd2e253216ab20ec44f0dc32b29155a4b3e6bef0a857d8c9f5f08" +dependencies = [ + "log", + "parking_lot 0.12.1", + "serde", + "serde_json", + "tokio", +] + [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "sval" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15df12a8db7c216a04b4b438f90d50d5335cd38f161b56389c9f5c9d96d0873" + +[[package]] +name = "sval_buffer" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57e80556bc8acea0446e574ce542ad6114a76a0237f28a842bc01ca3ea98f479" +dependencies = [ + "sval", + "sval_ref", +] + +[[package]] +name = "sval_dynamic" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d93d2259edb1d7b4316179f0a98c62e3ffc726f47ab200e07cfe382771f57b8" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_fmt" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532f7f882226f7a5a4656f5151224aaebf8217e0d539cb1595b831bace921343" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_json" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e03bd8aa0ae6ee018f7ae95c9714577687a4415bd1a5f19b26e34695f7e072" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_ref" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75ed054f2fb8c2a0ab5d36c1ec57b412919700099fc5e32ad8e7a38b23e1a9e1" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_serde" +version = "2.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "7ff191c4ff05b67e3844c161021427646cde5d6624597958be158357d9200586" +dependencies = [ + "serde", + "sval", + "sval_buffer", + "sval_fmt", +] [[package]] name = "syn" @@ -2441,9 +2895,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.9" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da4a3c17e109f700685ec577c0f85efd9b19bcf15c913985f14dc1ac01775aa" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -2456,11 +2910,38 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "tcp-stream" -version = "0.24.4" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a4b0a70bac0a58ca6a7659d1328e34ee462339c70b0fa49f72bad1f278910a" +checksum = "4da30af7998f51ee1aa48ab24276fe303a697b004e31ff542b192c088d5630a5" dependencies = [ "cfg-if", "p12", @@ -2470,22 +2951,22 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.4.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", - "fastrand", - "redox_syscall", - "rustix 0.36.11", - "windows-sys 0.42.0", + "fastrand 2.0.1", + "redox_syscall 0.4.1", + "rustix 0.38.24", + "windows-sys", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -2498,33 +2979,51 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.9", + "syn 2.0.39", ] [[package]] name = "time" -version = "0.1.45" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", + "deranged", + "itoa", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +dependencies = [ + "time-core", ] [[package]] @@ -2544,22 +3043,21 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] @@ -2575,13 +3073,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] @@ -2596,9 +3094,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -2621,9 +3119,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -2644,7 +3142,7 @@ dependencies = [ "pin-project", "pin-project-lite", "tokio", - "tokio-util 0.7.7", + "tokio-util 0.7.10", "tower-layer", "tower-service", "tracing", @@ -2672,7 +3170,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aba3f3efabf7fb41fae8534fc20a817013dd1c12cb45441efb6c82e6556b4cd8" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-util", @@ -2699,11 +3197,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-core", @@ -2711,9 +3208,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -2726,9 +3223,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" @@ -2738,9 +3235,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -2757,12 +3254,6 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - [[package]] name = "unicode_categories" version = "0.1.1" @@ -2771,15 +3262,15 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -2788,13 +3279,49 @@ dependencies = [ [[package]] name = "uuid" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" dependencies = [ "getrandom", ] +[[package]] +name = "value-bag" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" +dependencies = [ + "value-bag-serde1", + "value-bag-sval2", +] + +[[package]] +name = "value-bag-serde1" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ba39dc791ecb35baad371a3fc04c6eab688c04937d2e0ac6c22b612c0357bf" +dependencies = [ + "erased-serde", + "serde", + "serde_fmt", +] + +[[package]] +name = "value-bag-sval2" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e06c10810a57bbf45778d023d432a50a1daa7d185991ae06bcfb6c654d0945" +dependencies = [ + "sval", + "sval_buffer", + "sval_dynamic", + "sval_fmt", + "sval_json", + "sval_ref", + "sval_serde", +] + [[package]] name = "vcpkg" version = "0.2.15" @@ -2809,26 +3336,19 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2837,9 +3357,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2847,24 +3367,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -2874,9 +3394,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2884,41 +3404,44 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] -name = "web-sys" -version = "0.3.61" +name = "wasm-streams" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" dependencies = [ + "futures-util", "js-sys", "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", ] [[package]] -name = "webpki" -version = "0.22.0" +name = "web-sys" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ - "ring", - "untrusted", + "js-sys", + "wasm-bindgen", ] [[package]] @@ -2939,9 +3462,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -2953,43 +3476,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.46.0" +name = "windows-core" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ "windows-targets", ] [[package]] name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -3002,63 +3510,93 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys", ] [[package]] -name = "yasna" +name = "wyz" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed2e7a52e3744ab4d0c05c20aa065258e84c49fd4226f5191b2ed29712710b4" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] [[package]] name = "zeroize" -version = "1.5.7" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml index b756bf4..a973ea4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,14 +14,17 @@ dotenv = "0.15.0" clap = { version = "3.0.0-beta.5", features = ["derive", "env"] } serde = { version = "1.0.130", features = ["derive"] } serde_json = "1.0.87" -env_logger = "0.9.0" anyhow = "1.0.48" log = "0.4.14" tower = "0.4.11" tower-http = { version = "0.2.0", features = ["trace"] } axum = { version = "0.3.4", features = ["tower-log"] } chrono = { version = "0.4.22", features = ["serde"] } -sqlx = { version = "0.6.2", features = ["runtime-tokio-native-tls", "mysql", "chrono"] } +sqlx = { version = "0.6.2", features = [ + "runtime-tokio-native-tls", + "mysql", + "chrono", +] } lapin = "2.1.1" deadpool = { version = "0.9.5", features = ["rt_tokio_1"] } deadpool-lapin = "0.10.0" @@ -34,12 +37,25 @@ bcrypt = "0.13.0" uuid = { version = "1.2.1", features = ["v4"] } futures = "0.3.17" strsim = "0.10.0" -akatsuki-pp-rs = { package = "akatsuki-pp", git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", rev = "764da0dbf42ed80441acf99d070aaedabaed4b75", features = ["async_tokio"] } +akatsuki-pp-rs = { package = "akatsuki-pp", git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", rev = "764da0dbf42ed80441acf99d070aaedabaed4b75", features = [ + "async_tokio", +] } reqwest = "0.11" -conceptual-rework = { package = "akatsuki-pp", git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", branch = "conceptual-rework", features = ["async_tokio"] } +conceptual-rework = { package = "akatsuki-pp", git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", branch = "conceptual-rework", features = [ + "async_tokio", +] } async-trait = "0.1.62" -skill-rebalance = { package = "akatsuki-pp", git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", branch = "skill-rebalance", features = ["async_tokio"] } +skill-rebalance = { package = "akatsuki-pp", git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", branch = "skill-rebalance", features = [ + "async_tokio", +] } +rust-s3 = "0.33.0" +structured-logger = "1.0.3" +the = { package = "akatsuki-pp", git = "https://github.com/osuAkatsuki/akatsuki-pp-rs", rev = "4ae182f4f294e6ac34eca1dc2e5f676748c4fd76", features = [ + "async_tokio", +] } + [profile.release] lto = "fat" -codegen-units = 1 +codegen-units = 16 +opt-level = 3 panic = "abort" diff --git a/Dockerfile b/Dockerfile index 306efdb..b5ee61f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,22 @@ -FROM lukemathwalker/cargo-chef:latest-rust-bookworm AS chef +# syntax=docker/dockerfile:1.3-labs + +FROM rust:latest AS build + +RUN cargo new --lib /performance-service +COPY Cargo.toml Cargo.lock /performance-service/ + WORKDIR /performance-service +RUN --mount=type=cache,target=/usr/local/cargo/registry cargo build --release -FROM chef AS prepare -COPY . . -RUN cargo chef prepare --recipe-path recipe.json +COPY . /performance-service + +RUN --mount=type=cache,target=/usr/local/cargo/registry < = Result; + +impl IntoResponse for AppError { + type Body = Body; + type BodyError = ::Error; + + fn into_response(self) -> Response { + Response::builder() + .status(axum::http::StatusCode::INTERNAL_SERVER_ERROR) + .body(Body::from("internal server error")) + .unwrap() + } +} + +impl From for AppError +where + E: Into, +{ + fn from(err: E) -> Self { + Self(err.into()) + } +} diff --git a/src/api/mod.rs b/src/api/mod.rs index 515b589..1acfad3 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -6,6 +6,7 @@ use tower_http::trace::TraceLayer; use crate::context::Context; +mod error; mod routes; fn api_router() -> Router { @@ -17,10 +18,12 @@ fn api_router() -> Router { .merge(routes::reworks::leaderboard::router()) .merge(routes::reworks::sessions::router()) .merge(routes::reworks::search::router()) + .merge(routes::health::router()) } pub async fn serve(ctx: Context) -> anyhow::Result<()> { let server_port = ctx.config.api_port.unwrap(); + let server_host = ctx.config.api_host.clone().unwrap(); let app = api_router().layer( ServiceBuilder::new() @@ -28,8 +31,11 @@ pub async fn serve(ctx: Context) -> anyhow::Result<()> { .layer(AddExtensionLayer::new(Arc::new(ctx))), ); - log::info!("serving on {}", server_port); - axum::Server::bind(&format!("127.0.0.1:{}", server_port).parse()?) + log::info!( + port = server_port; + "Serving API", + ); + axum::Server::bind(&format!("{}:{}", server_host, server_port).parse()?) .serve(app.into_make_service()) .await?; diff --git a/src/api/routes/calculate.rs b/src/api/routes/calculate.rs index 5d68897..8d86880 100644 --- a/src/api/routes/calculate.rs +++ b/src/api/routes/calculate.rs @@ -1,10 +1,8 @@ use crate::context::Context; +use crate::usecases; use akatsuki_pp_rs::{Beatmap, BeatmapExt, GameMode, PerformanceAttributes}; use axum::{extract::Extension, routing::post, Json, Router}; -use std::io::Cursor; -use std::path::{Path, PathBuf}; use std::sync::Arc; -use tokio::fs::File; pub fn router() -> Router { Router::new().route("/api/v1/calculate", post(calculate_play)) @@ -35,21 +33,12 @@ fn round(x: f32, decimals: u32) -> f32 { } async fn calculate_relax_pp( - beatmap_path: PathBuf, request: &CalculateRequest, -) -> CalculateResponse { - let beatmap = match Beatmap::from_path(beatmap_path).await { - Ok(beatmap) => beatmap, - Err(_) => { - return CalculateResponse { - stars: 0.0, - pp: 0.0, - ar: 0.0, - od: 0.0, - max_combo: 0, - } - } - }; + context: Arc, +) -> anyhow::Result { + let beatmap_bytes = + usecases::beatmaps::fetch_beatmap_osu_file(request.beatmap_id, context).await?; + let beatmap = Beatmap::from_bytes(&beatmap_bytes).await?; let result = akatsuki_pp_rs::osu_2019::OsuPP::new(&beatmap) .mods(request.mods as u32) @@ -60,36 +49,32 @@ async fn calculate_relax_pp( let mut pp = round(result.pp as f32, 2); if pp.is_infinite() || pp.is_nan() { + log::warn!("Calculated pp is infinite or NaN, setting to 0"); pp = 0.0; } let mut stars = round(result.difficulty.stars as f32, 2); if stars.is_infinite() || stars.is_nan() { + log::warn!("Calculated star rating is infinite or NaN, setting to 0"); stars = 0.0; } - CalculateResponse { + Ok(CalculateResponse { stars, pp, ar: result.difficulty.ar as f32, od: result.difficulty.od as f32, max_combo: result.difficulty.max_combo as i32, - } + }) } -async fn calculate_rosu_pp(beatmap_path: PathBuf, request: &CalculateRequest) -> CalculateResponse { - let beatmap = match Beatmap::from_path(beatmap_path).await { - Ok(beatmap) => beatmap, - Err(_) => { - return CalculateResponse { - stars: 0.0, - pp: 0.0, - ar: 0.0, - od: 0.0, - max_combo: 0, - } - } - }; +async fn calculate_rosu_pp( + request: &CalculateRequest, + context: Arc, +) -> anyhow::Result { + let beatmap_bytes = + usecases::beatmaps::fetch_beatmap_osu_file(request.beatmap_id, context).await?; + let beatmap = Beatmap::from_bytes(&beatmap_bytes).await?; let result = beatmap .pp() @@ -108,15 +93,17 @@ async fn calculate_rosu_pp(beatmap_path: PathBuf, request: &CalculateRequest) -> let mut pp = round(result.pp() as f32, 2); if pp.is_infinite() || pp.is_nan() { + log::warn!("Calculated pp is infinite or NaN, setting to 0"); pp = 0.0; } let mut stars = round(result.stars() as f32, 2); if stars.is_infinite() || stars.is_nan() { + log::warn!("Calculated star rating is infinite or NaN, setting to 0"); stars = 0.0; } - match result { + Ok(match result { PerformanceAttributes::Osu(result) => CalculateResponse { stars, pp, @@ -145,23 +132,11 @@ async fn calculate_rosu_pp(beatmap_path: PathBuf, request: &CalculateRequest) -> od: 0.0, max_combo: result.difficulty.max_combo as i32, }, - } + }) } const RX: i32 = 1 << 7; -async fn download_beatmap(beatmap_path: PathBuf, request: &CalculateRequest) -> anyhow::Result<()> { - let response = reqwest::get(&format!("https://old.ppy.sh/osu/{}", request.beatmap_id)) - .await? - .error_for_status()?; - - let mut file = File::create(&beatmap_path).await?; - let mut content = Cursor::new(response.bytes().await?); - tokio::io::copy(&mut content, &mut file).await?; - - Ok(()) -} - async fn calculate_play( Extension(ctx): Extension>, Json(requests): Json>, @@ -169,32 +144,37 @@ async fn calculate_play( let mut results = Vec::new(); for request in requests { - let beatmap_path = - Path::new(&ctx.config.beatmaps_path).join(format!("{}.osu", request.beatmap_id)); - - if !beatmap_path.exists() { - match download_beatmap(beatmap_path.clone(), &request).await { - Ok(_) => {} - Err(_) => { - results.push(CalculateResponse { - stars: 0.0, - pp: 0.0, - ar: 0.0, - od: 0.0, - max_combo: 0, - }); - - continue; + let raw_result = if request.mods & RX > 0 && request.mode == 0 { + calculate_relax_pp(&request, ctx.clone()).await + } else { + calculate_rosu_pp(&request, ctx.clone()).await + }; + + let result = match raw_result { + Ok(result) => result, + Err(e) => { + log::error!( + beatmap_id = request.beatmap_id, + error = e.to_string(); + "Performance calculation failed for beatmap", + ); + + CalculateResponse { + stars: 0.0, + pp: 0.0, + ar: 0.0, + od: 0.0, + max_combo: 0, } } - } - - let result = if request.mods & RX > 0 && request.mode == 0 { - calculate_relax_pp(beatmap_path, &request).await - } else { - calculate_rosu_pp(beatmap_path, &request).await }; + log::info!( + performance_points = result.pp, + star_rating = result.stars, + beatmap_id = request.beatmap_id; + "Calculated performance for beatmap.", + ); results.push(result); } diff --git a/src/api/routes/health.rs b/src/api/routes/health.rs new file mode 100644 index 0000000..a17ce94 --- /dev/null +++ b/src/api/routes/health.rs @@ -0,0 +1,44 @@ +use axum::{extract::Extension, http, routing::get, Router}; +use redis::{aio::ConnectionLike, Cmd}; +use sqlx::MySql; +use std::{ops::DerefMut, sync::Arc}; + +use crate::context::Context; + +pub fn router() -> Router { + Router::new().route("/_health", get(health)) +} + +async fn health(Extension(ctx): Extension>) -> http::StatusCode { + let mut is_redis_ok = false; + let mut is_database_ok = false; + + if let Ok(mut conn) = ctx.redis.get_async_connection().await { + if let Ok(_result) = conn + .req_packed_command(&Cmd::new().arg("PING").arg(1)) + .await + { + is_redis_ok = true; + } + } + + if let Ok(_result) = sqlx::query_scalar::("SELECT 1") + .fetch_one(ctx.database.get().await.unwrap().deref_mut()) + .await + { + is_database_ok = true; + } + + let is_ok = is_redis_ok && is_database_ok; + match is_ok { + true => http::StatusCode::OK, + false => { + log::error!( + redis_healthy = is_redis_ok, + database_healthy = is_database_ok; + "Failed health check.", + ); + return http::StatusCode::INTERNAL_SERVER_ERROR; + } + } +} diff --git a/src/api/routes/mod.rs b/src/api/routes/mod.rs index 45a61a9..3260e4e 100644 --- a/src/api/routes/mod.rs +++ b/src/api/routes/mod.rs @@ -1,2 +1,3 @@ pub mod calculate; +pub mod health; pub mod reworks; diff --git a/src/api/routes/reworks/leaderboard.rs b/src/api/routes/reworks/leaderboard.rs index 5819846..f67c61a 100644 --- a/src/api/routes/reworks/leaderboard.rs +++ b/src/api/routes/reworks/leaderboard.rs @@ -6,7 +6,7 @@ use axum::{ Json, Router, }; -use crate::{context::Context, models::leaderboard::Leaderboard, usecases}; +use crate::{api::error::AppResult, context::Context, models::leaderboard::Leaderboard, usecases}; pub fn router() -> Router { Router::new().route( @@ -25,15 +25,14 @@ async fn get_rework_leaderboards( Extension(ctx): Extension>, Path(rework_id): Path, Query(query): Query, -) -> Json> { +) -> AppResult>> { let leaderboard = usecases::leaderboards::fetch_one( rework_id, (query.page.max(1) - 1) * query.amount, query.amount, ctx.clone(), ) - .await - .unwrap(); + .await?; - Json(leaderboard) + Ok(Json(leaderboard)) } diff --git a/src/api/routes/reworks/queue.rs b/src/api/routes/reworks/queue.rs index de0a284..db90f53 100644 --- a/src/api/routes/reworks/queue.rs +++ b/src/api/routes/reworks/queue.rs @@ -6,7 +6,7 @@ use axum::{ Json, Router, }; -use crate::{context::Context, models::queue::QueueResponse, usecases}; +use crate::{api::error::AppResult, context::Context, models::queue::QueueResponse, usecases}; pub fn router() -> Router { Router::new().route("/api/v1/reworks/:rework_id/queue", post(send_to_queue)) @@ -21,10 +21,8 @@ async fn send_to_queue( Extension(ctx): Extension>, Path(rework_id): Path, Query(query): Query, -) -> Json { - let response = usecases::sessions::enqueue(query.session, rework_id, ctx.clone()) - .await - .unwrap(); +) -> AppResult> { + let response = usecases::sessions::enqueue(query.session, rework_id, ctx.clone()).await?; - Json(response) + Ok(Json(response)) } diff --git a/src/api/routes/reworks/reworks.rs b/src/api/routes/reworks/reworks.rs index fe3050d..3fa2580 100644 --- a/src/api/routes/reworks/reworks.rs +++ b/src/api/routes/reworks/reworks.rs @@ -6,7 +6,7 @@ use axum::{ Json, Router, }; -use crate::{context::Context, models::rework::Rework, usecases}; +use crate::{api::error::AppResult, context::Context, models::rework::Rework, usecases}; pub fn router() -> Router { Router::new() @@ -14,18 +14,15 @@ pub fn router() -> Router { .route("/api/v1/reworks/:rework_id", get(get_rework)) } -async fn get_reworks(Extension(ctx): Extension>) -> Json> { - let reworks = usecases::reworks::fetch_all(ctx.clone()).await.unwrap(); - Json(reworks) +async fn get_reworks(Extension(ctx): Extension>) -> AppResult>> { + let reworks = usecases::reworks::fetch_all(ctx.clone()).await?; + Ok(Json(reworks)) } async fn get_rework( Extension(ctx): Extension>, Path(rework_id): Path, -) -> Json> { - let rework = usecases::reworks::fetch_one(rework_id, ctx.clone()) - .await - .unwrap(); - - Json(rework) +) -> AppResult>> { + let rework = usecases::reworks::fetch_one(rework_id, ctx.clone()).await?; + Ok(Json(rework)) } diff --git a/src/api/routes/reworks/scores.rs b/src/api/routes/reworks/scores.rs index 4b3e5f5..110abe2 100644 --- a/src/api/routes/reworks/scores.rs +++ b/src/api/routes/reworks/scores.rs @@ -7,6 +7,7 @@ use axum::{ }; use crate::{ + api::error::AppResult, context::Context, models::{ beatmap::Beatmap, @@ -24,10 +25,11 @@ pub fn router() -> Router { async fn get_rework_scores( ctx: Extension>, Path((rework_id, user_id)): Path<(i32, i32)>, -) -> Json>> { +) -> AppResult>>> { let base_scores: Vec = sqlx::query_as( - "SELECT user_id, rework_scores.beatmap_id, rework_scores.beatmapset_id, rework_id, score_id, rework_scores.max_combo, mods, accuracy, score, num_300s, num_100s, num_50s, num_gekis, + "SELECT user_id, rework_scores.beatmap_id, rework_scores.beatmapset_id, beatmaps.song_name, rework_id, + score_id, rework_scores.max_combo, mods, accuracy, score, num_300s, num_100s, num_50s, num_gekis, num_katus, num_misses, old_pp, new_pp, DENSE_RANK() OVER (ORDER BY old_pp DESC) old_rank, DENSE_RANK() OVER (ORDER BY new_pp DESC) new_rank FROM @@ -42,26 +44,23 @@ async fn get_rework_scores( ) .bind(user_id) .bind(rework_id) - .fetch_all(ctx.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .fetch_all(ctx.database.get().await?.deref_mut()) + .await?; let mut scores: Vec = Vec::new(); for base_score in base_scores { - let beatmap: Beatmap = sqlx::query_as( - "SELECT beatmap_id, beatmapset_id, song_name FROM beatmaps WHERE beatmap_id = ?", - ) - .bind(base_score.beatmap_id) - .fetch_one(ctx.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + let beatmap: Beatmap = Beatmap { + beatmap_id: base_score.beatmap_id, + beatmapset_id: base_score.beatmapset_id, + song_name: base_score.song_name.clone(), + }; let score = APIReworkScore::from_base(base_score, beatmap); scores.push(score); } - match scores.is_empty() { + Ok(match scores.is_empty() { true => Json(None), false => Json(Some(scores)), - } + }) } diff --git a/src/api/routes/reworks/search.rs b/src/api/routes/reworks/search.rs index acbac95..12a8ed9 100644 --- a/src/api/routes/reworks/search.rs +++ b/src/api/routes/reworks/search.rs @@ -5,7 +5,7 @@ use axum::{ }; use std::{ops::DerefMut, sync::Arc}; -use crate::context::Context; +use crate::{api::error::AppResult, context::Context}; pub fn router() -> Router { Router::new().route("/api/v1/reworks/:rework_id/users/search", get(search_users)) @@ -26,7 +26,7 @@ async fn search_users( ctx: Extension>, Path(rework_id): Path, Query(query): Query, -) -> Json> { +) -> AppResult>> { let users: Vec = sqlx::query_as( "SELECT id user_id, username user_name FROM users WHERE username_safe LIKE ?", ) @@ -38,9 +38,8 @@ async fn search_users( .replace(" ", "_") .replace(|c: char| !c.is_ascii(), "") )) - .fetch_all(ctx.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .fetch_all(ctx.database.get().await?.deref_mut()) + .await?; let mut to_remove: Vec = Vec::new(); for user in &users { @@ -48,9 +47,8 @@ async fn search_users( sqlx::query_scalar("SELECT 1 FROM rework_stats WHERE user_id = ? AND rework_id = ?") .bind(user.user_id) .bind(rework_id) - .fetch_optional(ctx.database.get().await.unwrap().deref_mut()) - .await - .unwrap() + .fetch_optional(ctx.database.get().await?.deref_mut()) + .await? .unwrap_or(false); if !in_rework { @@ -73,5 +71,5 @@ async fn search_users( .unwrap() }); - Json(users) + Ok(Json(users)) } diff --git a/src/api/routes/reworks/sessions.rs b/src/api/routes/reworks/sessions.rs index d7f9705..bbdd549 100644 --- a/src/api/routes/reworks/sessions.rs +++ b/src/api/routes/reworks/sessions.rs @@ -6,7 +6,7 @@ use axum::{ use std::sync::Arc; use crate::context::Context; -use crate::usecases; +use crate::{api::error::AppResult, usecases}; pub fn router() -> Router { Router::new() @@ -23,15 +23,17 @@ struct CreateSessionRequest { async fn create_session( Extension(ctx): Extension>, Json(request): Json, -) -> Json { +) -> AppResult> { let response = - usecases::sessions::create(request.username, request.password_md5, ctx.clone()).await; + usecases::sessions::create(request.username, request.password_md5, ctx.clone()).await?; - Json(response) + Ok(Json(response)) } -async fn delete_session(Extension(ctx): Extension>, Path(session): Path) { - let _ = usecases::sessions::delete(session, ctx.clone()) - .await - .unwrap(); +async fn delete_session( + Extension(ctx): Extension>, + Path(session): Path, +) -> AppResult<()> { + let _ = usecases::sessions::delete(session, ctx.clone()).await?; + Ok(()) } diff --git a/src/api/routes/reworks/user.rs b/src/api/routes/reworks/user.rs index 8bcb9b7..f06b74d 100644 --- a/src/api/routes/reworks/user.rs +++ b/src/api/routes/reworks/user.rs @@ -8,6 +8,7 @@ use axum::{ }; use crate::{ + api::error::AppResult, context::Context, models::{ rework::Rework, @@ -28,17 +29,16 @@ pub fn router() -> Router { async fn get_rework_user( ctx: Extension>, Path(user_id): Path, -) -> Json> { +) -> AppResult>> { let stats: Option<(String, String)> = sqlx::query_as( "SELECT users.username, country FROM users INNER JOIN users_stats USING(id) WHERE id = ?", ) .bind(user_id) - .fetch_optional(ctx.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .fetch_optional(ctx.database.get().await?.deref_mut()) + .await?; if stats.is_none() { - return Json(None); + return Ok(Json(None)); } let (user_name, country) = stats.unwrap(); @@ -46,9 +46,8 @@ async fn get_rework_user( let rework_stats: Vec = sqlx::query_as("SELECT * FROM rework_stats WHERE user_id = ?") .bind(user_id) - .fetch_all(ctx.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .fetch_all(ctx.database.get().await?.deref_mut()) + .await?; let rework_ids = rework_stats .iter() @@ -59,36 +58,34 @@ async fn get_rework_user( for rework_id in rework_ids { let rework: Rework = sqlx::query_as("SELECT * FROM reworks WHERE rework_id = ?") .bind(rework_id) - .fetch_one(ctx.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .fetch_one(ctx.database.get().await?.deref_mut()) + .await?; reworks.push(rework); } - Json(Some(ReworkUser { + Ok(Json(Some(ReworkUser { user_id, user_name, country, reworks, - })) + }))) } async fn get_rework_stats( ctx: Extension>, Path((rework_id, user_id)): Path<(i32, i32)>, -) -> Json> { +) -> AppResult>> { let stats: Option = sqlx::query_as( "SELECT user_id, rework_id, old_pp, new_pp FROM rework_stats WHERE user_id = ? AND rework_id = ?" ) .bind(user_id) .bind(rework_id) - .fetch_optional(ctx.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .fetch_optional(ctx.database.get().await?.deref_mut()) + .await?; if stats.is_none() { - return Json(None); + return Ok(Json(None)); } let stats = stats.unwrap(); @@ -97,17 +94,15 @@ async fn get_rework_stats( "SELECT users_stats.country, users.username FROM users_stats INNER JOIN users USING(id) WHERE users_stats.id = ?" ) .bind(user_id) - .fetch_one(ctx.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .fetch_one(ctx.database.get().await?.deref_mut()) + .await?; - let mut redis_connection = ctx.redis.get_async_connection().await.unwrap(); + let mut redis_connection = ctx.redis.get_async_connection().await?; let rework: Rework = sqlx::query_as("SELECT * FROM reworks WHERE rework_id = ?") .bind(rework_id) - .fetch_one(ctx.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .fetch_one(ctx.database.get().await?.deref_mut()) + .await?; let redis_leaderboard = match rework.rx { 0 => "leaderboard".to_string(), @@ -129,13 +124,11 @@ async fn get_rework_stats( format!("ripple:{}:{}", redis_leaderboard, stats_prefix), user_id, ) - .await - .unwrap(); + .await?; let new_rank_idx: Option = redis_connection .zrevrank(format!("rework:leaderboard:{}", rework.rework_id), user_id) - .await - .unwrap(); + .await?; let api_user = APIReworkStats::from_stats( stats, @@ -144,5 +137,5 @@ async fn get_rework_stats( (old_rank_idx.unwrap_or(-1) + 1) as u64, (new_rank_idx.unwrap_or(-1) + 1) as u64, ); - Json(Some(api_user)) + Ok(Json(Some(api_user))) } diff --git a/src/config.rs b/src/config.rs index 34485db..6af8cb7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -3,6 +3,9 @@ pub struct Config { #[clap(long, env)] pub app_component: String, + #[clap(long, env)] + pub api_host: Option, + #[clap(long, env)] pub api_port: Option, @@ -55,5 +58,20 @@ pub struct Config { pub redis_database: i64, #[clap(long, env)] - pub beatmaps_path: String, + pub redis_use_ssl: bool, + + #[clap(long, env)] + pub aws_access_key_id: String, + + #[clap(long, env)] + pub aws_bucket_name: String, + + #[clap(long, env)] + pub aws_endpoint_url: String, + + #[clap(long, env)] + pub aws_region: String, + + #[clap(long, env)] + pub aws_secret_access_key: String, } diff --git a/src/context.rs b/src/context.rs index a26abf1..0a75e3c 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1,6 +1,7 @@ use deadpool::managed::Pool; use lapin::Channel; use redis::Client; +use s3::Bucket; use crate::{config::Config, models::pool::DbPool}; @@ -10,4 +11,5 @@ pub struct Context { pub database: Pool, pub amqp_channel: Channel, pub redis: Client, + pub bucket: Bucket, } diff --git a/src/deploy/mod.rs b/src/deploy/mod.rs index 62a7560..697fc54 100644 --- a/src/deploy/mod.rs +++ b/src/deploy/mod.rs @@ -1,17 +1,9 @@ -use crate::{context::Context, models::score::RippleScore}; +use crate::{context::Context, models::score::RippleScore, usecases}; use akatsuki_pp_rs::{Beatmap, BeatmapExt, GameMode}; use redis::AsyncCommands; -use std::{ - collections::HashMap, - io::Cursor, - ops::DerefMut, - path::{Path, PathBuf}, - sync::Arc, - time::SystemTime, -}; +use std::{collections::HashMap, ops::DerefMut, sync::Arc, time::SystemTime}; use std::io::Write; -use tokio::fs::File; use tokio::sync::Mutex; #[derive(serde::Serialize, serde::Deserialize)] @@ -39,10 +31,10 @@ const RX: i32 = 1 << 7; const AP: i32 = 1 << 13; async fn calculate_special_pp( - beatmap_path: PathBuf, request: &CalculateRequest, + context: Arc, recalc_ctx: &Arc>, -) -> CalculateResponse { +) -> anyhow::Result { let mut recalc_mutex = recalc_ctx.lock().await; let beatmap = if recalc_mutex.beatmaps.contains_key(&request.beatmap_id) { @@ -52,21 +44,15 @@ async fn calculate_special_pp( .unwrap() .clone() } else { - match Beatmap::from_path(beatmap_path).await { - Ok(beatmap) => { - recalc_mutex - .beatmaps - .insert(request.beatmap_id, beatmap.clone()); + let beatmap_bytes = + usecases::beatmaps::fetch_beatmap_osu_file(request.beatmap_id, context.clone()).await?; + let beatmap = Beatmap::from_bytes(&beatmap_bytes).await?; - beatmap - } - Err(_) => { - return CalculateResponse { - stars: 0.0, - pp: 0.0, - } - } - } + recalc_mutex + .beatmaps + .insert(request.beatmap_id, beatmap.clone()); + + beatmap }; drop(recalc_mutex); @@ -88,14 +74,14 @@ async fn calculate_special_pp( stars = 0.0; } - CalculateResponse { stars, pp } + Ok(CalculateResponse { stars, pp }) } async fn calculate_rosu_pp( - beatmap_path: PathBuf, request: &CalculateRequest, + context: Arc, recalc_ctx: &Arc>, -) -> CalculateResponse { +) -> anyhow::Result { let mut recalc_mutex = recalc_ctx.lock().await; let beatmap = if recalc_mutex.beatmaps.contains_key(&request.beatmap_id) { @@ -105,21 +91,15 @@ async fn calculate_rosu_pp( .unwrap() .clone() } else { - match Beatmap::from_path(beatmap_path).await { - Ok(beatmap) => { - recalc_mutex - .beatmaps - .insert(request.beatmap_id, beatmap.clone()); + let beatmap_bytes = + usecases::beatmaps::fetch_beatmap_osu_file(request.beatmap_id, context.clone()).await?; + let beatmap = Beatmap::from_bytes(&beatmap_bytes).await?; - beatmap - } - Err(_) => { - return CalculateResponse { - stars: 0.0, - pp: 0.0, - } - } - } + recalc_mutex + .beatmaps + .insert(request.beatmap_id, beatmap.clone()); + + beatmap }; drop(recalc_mutex); @@ -149,12 +129,11 @@ async fn calculate_rosu_pp( stars = 0.0; } - CalculateResponse { stars, pp } + Ok(CalculateResponse { stars, pp }) } async fn recalculate_score( score: RippleScore, - beatmap_path: PathBuf, ctx: Arc, recalc_ctx: Arc>, ) -> anyhow::Result<()> { @@ -168,9 +147,9 @@ async fn recalculate_score( }; let response = if score.mods & RX > 0 && score.play_mode == 0 { - calculate_special_pp(beatmap_path, &request, &recalc_ctx).await + calculate_special_pp(&request, ctx.clone(), &recalc_ctx).await? } else { - calculate_rosu_pp(beatmap_path, &request, &recalc_ctx).await + calculate_rosu_pp(&request, ctx.clone(), &recalc_ctx).await? }; let rx = if score.mods & RX > 0 { @@ -214,11 +193,11 @@ async fn recalculate_score( } log::info!( - "Recalculated score ID {} (mode: {}) | {} -> {}", - score.id, - score.play_mode, - score.pp, - response.pp, + score_id = score.id, + score_mode = score.play_mode, + old_pp = score.pp, + new_pp = score.pp; + "Recalculated score", ); Ok(()) @@ -241,7 +220,7 @@ async fn recalculate_mode_scores( &format!( "SELECT s.id, s.beatmap_md5, s.userid, s.score, s.max_combo, s.full_combo, s.mods, s.300_count, s.100_count, s.50_count, s.katus_count, s.gekis_count, s.misses_count, s.time, s.play_mode, s.completed, - s.accuracy, s.pp, s.checksum, s.patcher, s.pinned, b.beatmap_id, b.beatmapset_id + s.accuracy, s.pp, s.checksum, s.patcher, s.pinned, b.beatmap_id, b.beatmapset_id, b.song_name FROM {} s INNER JOIN beatmaps b @@ -261,31 +240,7 @@ async fn recalculate_mode_scores( let mut futures = Vec::new(); for score in score_chunk { - let beatmap_path = - Path::new(&ctx.config.beatmaps_path).join(format!("{}.osu", score.beatmap_id)); - - if !beatmap_path.exists() { - log::info!( - "Beatmap {} doesn't exist, fetching from bancho", - score.beatmap_id - ); - - let response = - reqwest::get(&format!("https://old.ppy.sh/osu/{}", score.beatmap_id)) - .await? - .error_for_status()?; - - let mut file = File::create(&beatmap_path).await?; - let mut content = Cursor::new(response.bytes().await?); - tokio::io::copy(&mut content, &mut file).await?; - } - - let future = tokio::spawn(recalculate_score( - score, - beatmap_path, - ctx.clone(), - recalc_ctx.clone(), - )); + let future = tokio::spawn(recalculate_score(score, ctx.clone(), recalc_ctx.clone())); futures.push(future); } @@ -422,7 +377,7 @@ async fn recalculate_user( &format!( "SELECT s.id, s.beatmap_md5, s.userid, s.score, s.max_combo, s.full_combo, s.mods, s.300_count, s.100_count, s.50_count, s.katus_count, s.gekis_count, s.misses_count, s.time, s.play_mode, s.completed, - s.accuracy, s.pp, s.checksum, s.patcher, s.pinned, b.beatmap_id, b.beatmapset_id + s.accuracy, s.pp, s.checksum, s.patcher, s.pinned, b.beatmap_id, b.beatmapset_id, b.song_name FROM {} s INNER JOIN beatmaps b @@ -495,14 +450,12 @@ async fn recalculate_user( .bind(user_id) .bind(mode) .fetch_optional(ctx.database.get().await?.deref_mut()) - .await - .unwrap_or(None); + .await?; let inactive_days = match last_score_time { Some(time) => { ((SystemTime::now() - .duration_since(SystemTime::UNIX_EPOCH) - .unwrap() + .duration_since(SystemTime::UNIX_EPOCH)? .as_secs() as i32) - time) / 60 @@ -550,11 +503,11 @@ async fn recalculate_user( .await?; log::info!( - "Recalculated user {} in mode {} (rx: {}) | pp: {}", - user_id, - mode, - rx, - new_pp + user_id = user_id, + mode = mode, + relax = rx, + new_pp = new_pp; + "Recalculated user", ); Ok(()) @@ -585,32 +538,32 @@ struct RecalculateContext { pub async fn serve(context: Context) -> anyhow::Result<()> { print!("Enter the modes (comma delimited) to deploy: "); - std::io::stdout().flush().unwrap(); + std::io::stdout().flush()?; let mut modes_str = String::new(); std::io::stdin().read_line(&mut modes_str)?; let modes = modes_str .trim() .split(',') - .map(|s| s.parse::().unwrap()) + .map(|s| s.parse::().expect("failed to parse mode")) .collect::>(); print!("\n"); - std::io::stdout().flush().unwrap(); + std::io::stdout().flush()?; print!("Enter the relax bits (comma delimited) to deploy: "); - std::io::stdout().flush().unwrap(); + std::io::stdout().flush()?; let mut relax_str = String::new(); std::io::stdin().read_line(&mut relax_str)?; let relax_bits = relax_str .trim() .split(',') - .map(|s| s.parse::().unwrap()) + .map(|s| s.parse::().expect("failed to parse relax bits")) .collect::>(); print!("\n"); - std::io::stdout().flush().unwrap(); + std::io::stdout().flush()?; let recalculate_context = Arc::new(Mutex::new(RecalculateContext { beatmaps: HashMap::new(), diff --git a/src/main.rs b/src/main.rs index 0f08d6c..f3b924f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,7 +5,9 @@ use performance_service::{ api, config::Config, context::Context, deploy, mass_recalc, models::pool::DbPool, processor, }; use redis::{Client, ConnectionAddr, ConnectionInfo, RedisConnectionInfo}; -use sqlx::mysql::MySqlConnectOptions; +use s3::{creds::Credentials, Bucket, Region}; +use sqlx::{mysql::MySqlConnectOptions, ConnectOptions}; +use structured_logger::{async_json::new_writer, Builder}; fn amqp_dsn(username: &str, password: &str, host: &str, port: u16) -> String { return format!("amqp://{}:{}@{}:{}", username, password, host, port); @@ -14,7 +16,10 @@ fn amqp_dsn(username: &str, password: &str, host: &str, port: u16) -> String { #[tokio::main] async fn main() -> anyhow::Result<()> { dotenv::dotenv().ok(); - env_logger::init(); + + Builder::new() + .with_target_writer("*", new_writer(tokio::io::stdout())) + .init(); let config = Config::parse(); @@ -23,8 +28,10 @@ async fn main() -> anyhow::Result<()> { .port(config.database_port) .username(&config.database_username) .password(&config.database_password) - .database(&config.database_name); - let database = DbPool::new(database_options, config.database_pool_max_size); + .database(&config.database_name) + .disable_statement_logging() + .clone(); + let database = DbPool::new(database_options, config.database_pool_max_size)?; let amqp_url = amqp_dsn( &config.amqp_username, @@ -39,7 +46,14 @@ async fn main() -> anyhow::Result<()> { let amqp_channel = amqp.get().await?.create_channel().await?; let redis_connection_options = ConnectionInfo { - addr: ConnectionAddr::Tcp(config.redis_host.clone(), config.redis_port), + addr: match config.redis_use_ssl { + true => ConnectionAddr::TcpTls { + host: config.redis_host.clone(), + port: config.redis_port, + insecure: false, + }, + false => ConnectionAddr::Tcp(config.redis_host.clone(), config.redis_port), + }, redis: RedisConnectionInfo { db: config.redis_database, password: config.redis_password.clone(), @@ -48,11 +62,28 @@ async fn main() -> anyhow::Result<()> { }; let redis = Client::open(redis_connection_options)?; + let custom_region = Region::Custom { + region: config.aws_region.clone(), + endpoint: config.aws_endpoint_url.clone(), + }; + let bucket = Bucket::new( + &config.aws_bucket_name, + custom_region, + Credentials { + access_key: Some(config.aws_access_key_id.clone()), + secret_key: Some(config.aws_secret_access_key.clone()), + security_token: None, + session_token: None, + expiration: None, + }, + )?; + let context = Context { config, database, amqp_channel, redis, + bucket, }; match context.config.app_component.as_str() { diff --git a/src/mass_recalc/mod.rs b/src/mass_recalc/mod.rs index 52a6e82..cfca765 100644 --- a/src/mass_recalc/mod.rs +++ b/src/mass_recalc/mod.rs @@ -11,7 +11,7 @@ use crate::{ use lapin::{options::BasicPublishOptions, BasicProperties}; use redis::AsyncCommands; -async fn queue_user(user_id: i32, rework: &Rework, context: &Context) { +async fn queue_user(user_id: i32, rework: &Rework, context: &Context) -> anyhow::Result<()> { let scores_table = match rework.rx { 0 => "scores", 1 => "scores_relax", @@ -27,15 +27,13 @@ async fn queue_user(user_id: i32, rework: &Rework, context: &Context) { )) .bind(user_id) .bind(rework.mode) - .fetch_optional(context.database.get().await.unwrap().deref_mut()) - .await - .unwrap_or(None); + .fetch_optional(context.database.get().await?.deref_mut()) + .await?; let inactive_days = match last_score_time { Some(time) => { ((SystemTime::now() - .duration_since(SystemTime::UNIX_EPOCH) - .unwrap() + .duration_since(SystemTime::UNIX_EPOCH)? .as_secs() as i32) - time) / 60 @@ -46,7 +44,7 @@ async fn queue_user(user_id: i32, rework: &Rework, context: &Context) { }; if inactive_days >= 60 { - return; + return Ok(()); } let in_queue: Option = sqlx::query_scalar( @@ -55,20 +53,18 @@ async fn queue_user(user_id: i32, rework: &Rework, context: &Context) { .bind(user_id) .bind(rework.rework_id) .bind(rework.updated_at) - .fetch_optional(context.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .fetch_optional(context.database.get().await?.deref_mut()) + .await?; if in_queue.is_some() { - return; + return Ok(()); } sqlx::query(r#"REPLACE INTO rework_queue (user_id, rework_id) VALUES (?, ?)"#) .bind(user_id) .bind(rework.rework_id) - .execute(context.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .execute(context.database.get().await?.deref_mut()) + .await?; context .amqp_channel @@ -79,32 +75,37 @@ async fn queue_user(user_id: i32, rework: &Rework, context: &Context) { &rkyv::to_bytes::<_, 256>(&QueueRequest { user_id, rework_id: rework.rework_id, - }) - .unwrap(), + })?, BasicProperties::default(), ) - .await - .unwrap(); + .await?; - log::info!("Queued user ID {}", user_id); + log::info!( + user_id = user_id; + "Queued user", + ); + Ok(()) } pub async fn serve(context: Context) -> anyhow::Result<()> { print!("Enter a rework ID to mass recalculate: "); - std::io::stdout().flush().unwrap(); + std::io::stdout().flush()?; let mut rework_id_str = String::new(); std::io::stdin().read_line(&mut rework_id_str)?; let rework_id = rework_id_str.trim().parse::()?; print!("\n"); - std::io::stdout().flush().unwrap(); + std::io::stdout().flush()?; - log::info!("Mass recalculating on rework ID {}", rework_id); + log::info!( + rework_id = rework_id; + "Mass recalculating on rework", + ); let rework = usecases::reworks::fetch_one(rework_id, Arc::from(context.clone())) .await? - .unwrap(); + .expect("failed to find rework"); sqlx::query("DELETE FROM rework_scores WHERE rework_id = ?") .bind(rework_id) @@ -146,7 +147,7 @@ pub async fn serve(context: Context) -> anyhow::Result<()> { .await?; for (user_id,) in user_ids { - queue_user(user_id, &rework, &context).await; + queue_user(user_id, &rework, &context).await?; } Ok(()) diff --git a/src/models/pool.rs b/src/models/pool.rs index 40b7760..9f487ff 100644 --- a/src/models/pool.rs +++ b/src/models/pool.rs @@ -26,10 +26,7 @@ impl Manager for DbPool { type Pool = deadpool::managed::Pool; impl DbPool { - pub fn new(options: MySqlConnectOptions, max_size: usize) -> Pool { - Pool::builder(Self { options }) - .max_size(max_size) - .build() - .unwrap() + pub fn new(options: MySqlConnectOptions, max_size: usize) -> anyhow::Result { + Ok(Pool::builder(Self { options }).max_size(max_size).build()?) } } diff --git a/src/models/score.rs b/src/models/score.rs index 9c4adef..c207002 100644 --- a/src/models/score.rs +++ b/src/models/score.rs @@ -5,6 +5,7 @@ pub struct ReworkScore { pub score_id: i64, pub beatmap_id: i32, pub beatmapset_id: i32, + pub song_name: String, pub user_id: i32, pub rework_id: i32, pub max_combo: i32, @@ -27,6 +28,7 @@ impl ReworkScore { score_id: score.id, beatmap_id: score.beatmap_id, beatmapset_id: score.beatmapset_id, + song_name: score.song_name.clone(), user_id: score.userid, rework_id, max_combo: score.max_combo, @@ -50,6 +52,7 @@ pub struct APIBaseReworkScore { pub score_id: i64, pub beatmap_id: i32, pub beatmapset_id: i32, + pub song_name: String, pub user_id: i32, pub rework_id: i32, pub max_combo: i32, @@ -74,6 +77,7 @@ impl APIBaseReworkScore { score_id: score.score_id, beatmap_id: score.beatmap_id, beatmapset_id: score.beatmapset_id, + song_name: score.song_name, user_id: score.user_id, rework_id: score.rework_id, max_combo: score.max_combo, @@ -187,4 +191,5 @@ pub struct RippleScore { pub beatmap_id: i32, pub beatmapset_id: i32, + pub song_name: String, } diff --git a/src/processor/mod.rs b/src/processor/mod.rs index ed905a9..83ed01b 100644 --- a/src/processor/mod.rs +++ b/src/processor/mod.rs @@ -1,9 +1,4 @@ -use std::{ - ops::DerefMut, - path::{Path, PathBuf}, - sync::Arc, - time::Duration, -}; +use std::{ops::DerefMut, sync::Arc, time::Duration}; use lapin::{ options::{BasicAckOptions, BasicConsumeOptions, QueueDeclareOptions}, @@ -24,19 +19,28 @@ use crate::{ usecases, }; -use conceptual_rework::{Beatmap as ConceptualBeatmap, BeatmapExt as ConceptualBeatmapExt, GameMode as ConceptualGameMode}; -use skill_rebalance::{Beatmap as SkillRebalanceBeatmap, BeatmapExt as SkillRebalanceBeatmapExt, GameMode as SkillRebalanceGameMode}; +use conceptual_rework::{ + Beatmap as ConceptualBeatmap, BeatmapExt as ConceptualBeatmapExt, + GameMode as ConceptualGameMode, +}; +use skill_rebalance::{ + Beatmap as SkillRebalanceBeatmap, BeatmapExt as SkillRebalanceBeatmapExt, + GameMode as SkillRebalanceGameMode, +}; +use the::Beatmap as TheBeatmap; fn round(x: f32, decimals: u32) -> f32 { let y = 10i32.pow(decimals) as f32; (x * y).round() / y } -async fn calculate_conceptual_pp(beatmap_path: PathBuf, score: &RippleScore) -> f32 { - let beatmap = match ConceptualBeatmap::from_path(beatmap_path).await { - Ok(beatmap) => beatmap, - Err(_) => return 0.0, - }; +async fn calculate_conceptual_pp( + score: &RippleScore, + context: Arc, +) -> anyhow::Result { + let beatmap_bytes = + usecases::beatmaps::fetch_beatmap_osu_file(score.beatmap_id, context).await?; + let beatmap = ConceptualBeatmap::from_bytes(&beatmap_bytes).await?; let result = beatmap .pp() @@ -58,14 +62,16 @@ async fn calculate_conceptual_pp(beatmap_path: PathBuf, score: &RippleScore) -> pp = 0.0; } - pp + Ok(pp) } -async fn calculate_skill_rebalance_pp(beatmap_path: PathBuf, score: &RippleScore) -> f32 { - let beatmap = match SkillRebalanceBeatmap::from_path(beatmap_path).await { - Ok(beatmap) => beatmap, - Err(_) => return 0.0, - }; +async fn calculate_skill_rebalance_pp( + score: &RippleScore, + context: Arc, +) -> anyhow::Result { + let beatmap_bytes = + usecases::beatmaps::fetch_beatmap_osu_file(score.beatmap_id, context).await?; + let beatmap = SkillRebalanceBeatmap::from_bytes(&beatmap_bytes).await?; let result = beatmap .pp() @@ -87,54 +93,50 @@ async fn calculate_skill_rebalance_pp(beatmap_path: PathBuf, score: &RippleScore pp = 0.0; } - pp + Ok(pp) +} + +async fn calculate_the_pp(score: &RippleScore, context: Arc) -> anyhow::Result { + let beatmap_bytes = + usecases::beatmaps::fetch_beatmap_osu_file(score.beatmap_id, context).await?; + let beatmap = TheBeatmap::from_bytes(&beatmap_bytes).await?; + + let result = the::osu_2019::OsuPP::new(&beatmap) + .mods(score.mods as u32) + .combo(score.max_combo as usize) + .misses(score.count_misses as usize) + .accuracy(score.accuracy) + .calculate(); + + let mut pp = round(result.pp as f32, 2); + if pp.is_infinite() || pp.is_nan() { + pp = 0.0; + } + + Ok(pp) } async fn process_scores( rework: &Rework, scores: Vec, - context: &Arc, + context: Arc, ) -> anyhow::Result> { let mut rework_scores: Vec = Vec::new(); for score in &scores { let new_pp = match rework.rework_id { - 10 => { - calculate_conceptual_pp( - Path::new(&context.config.beatmaps_path) - .join(format!("{}.osu", score.beatmap_id)), - score, - ) - .await - } - 11 => { - calculate_conceptual_pp( - Path::new(&context.config.beatmaps_path) - .join(format!("{}.osu", score.beatmap_id)), - score, - ) - .await - } - 12 => { - calculate_conceptual_pp( - Path::new(&context.config.beatmaps_path) - .join(format!("{}.osu", score.beatmap_id)), - score, - ) - .await - }, - 13 => { - calculate_skill_rebalance_pp( - Path::new(&context.config.beatmaps_path) - .join(format!("{}.osu", score.beatmap_id)), - score, - ) - .await - } + 10 => calculate_conceptual_pp(score, context.clone()).await?, + 11 => calculate_conceptual_pp(score, context.clone()).await?, + 12 => calculate_conceptual_pp(score, context.clone()).await?, + 13 => calculate_skill_rebalance_pp(score, context.clone()).await?, + 14 => calculate_the_pp(score, context.clone()).await?, _ => unreachable!(), }; - log::info!("Recalculated PP for score ID {}", score.id); + log::info!( + score_id = score.id; + "Recalculated PP for score", + ); let rework_score = ReworkScore::from_ripple_score(score, rework.rework_id, new_pp); rework_scores.push(rework_score); @@ -161,10 +163,12 @@ async fn handle_queue_request( context: Arc, delivery_tag: u64, ) -> anyhow::Result<()> { - let rework = usecases::reworks::fetch_one(request.rework_id, context.clone()) - .await? - .unwrap(); + let rework = usecases::reworks::fetch_one(request.rework_id, context.clone()).await?; + if rework.is_none() { + anyhow::bail!("failed to find rework"); + } + let rework = rework.unwrap(); let scores_table = match rework.rx { 0 => "scores", 1 => "scores_relax", @@ -176,7 +180,7 @@ async fn handle_queue_request( &format!( "SELECT s.id, s.beatmap_md5, s.userid, s.score, s.max_combo, s.full_combo, s.mods, s.300_count, s.100_count, s.50_count, s.katus_count, s.gekis_count, s.misses_count, s.time, s.play_mode, s.completed, - s.accuracy, s.pp, s.checksum, s.patcher, s.pinned, b.beatmap_id, b.beatmapset_id + s.accuracy, s.pp, s.checksum, s.patcher, s.pinned, b.beatmap_id, b.beatmapset_id, b.song_name FROM {} s INNER JOIN beatmaps b @@ -207,7 +211,7 @@ async fn handle_queue_request( .fetch_one(context.database.get().await?.deref_mut()) .await?; - let rework_scores = process_scores(&rework, scores, &context).await?; + let rework_scores = process_scores(&rework, scores, context.clone()).await?; let new_pp = calculate_new_pp(&rework_scores, score_count); for rework_score in rework_scores { @@ -298,9 +302,9 @@ async fn handle_queue_request( .await?; log::info!( - "Processed recalculation for user ID {} on rework {}", - request.user_id, - rework.rework_name + user_id = request.user_id, + rework_name = rework.rework_name; + "Processed recalculation for user on rework", ); Ok(()) @@ -330,14 +334,13 @@ async fn rmq_listen(context: Arc) -> anyhow::Result<()> { if let Ok(delivery) = delivery { let deserialized_data: QueueRequest = rkyv::check_archived_root::(&delivery.data) - .unwrap() - .deserialize(&mut rkyv::Infallible) - .unwrap(); + .expect("failed to check archived root?") + .deserialize(&mut rkyv::Infallible)?; log::info!( - "Received recalculation request for user ID {} on rework ID {}", - deserialized_data.user_id, - deserialized_data.rework_id + user_id = deserialized_data.user_id, + rework_id = deserialized_data.rework_id; + "Received recalculation request for user on rework", ); let context_clone = context.clone(); @@ -350,7 +353,7 @@ async fn rmq_listen(context: Arc) -> anyhow::Result<()> { .await; if result.is_err() { - panic!("Error processing queue request: {:?}", result); + log::error!(error = result.unwrap_err().to_string(); "Error processing queue request"); } }); } diff --git a/src/repositories/leaderboards.rs b/src/repositories/leaderboards.rs index c0020e4..6855332 100644 --- a/src/repositories/leaderboards.rs +++ b/src/repositories/leaderboards.rs @@ -32,8 +32,7 @@ impl LeaderboardsRepository { sqlx::query_scalar("SELECT COUNT(*) FROM rework_stats WHERE rework_id = ?") .bind(rework.rework_id) .fetch_one(self.context.database.get().await?.deref_mut()) - .await - .unwrap(); + .await?; let rework_users: Vec = sqlx::query_as( "SELECT user_id, users_stats.country, users.username user_name, rework_id, old_pp, new_pp, @@ -56,8 +55,7 @@ impl LeaderboardsRepository { .bind(offset) .bind(limit) .fetch_all(self.context.database.get().await?.deref_mut()) - .await - .unwrap(); + .await?; let leaderboard = Leaderboard { total_count: leaderboard_count, diff --git a/src/repositories/sessions.rs b/src/repositories/sessions.rs index 59e114e..205a437 100644 --- a/src/repositories/sessions.rs +++ b/src/repositories/sessions.rs @@ -16,8 +16,7 @@ impl SessionsRepository { let mut redis_conn = self.context.redis.get_async_connection().await?; let mut session_token: Option = redis_conn .get(format!("rework:sessions:ids:{}", user_id)) - .await - .unwrap_or(None); + .await?; if session_token.is_none() { session_token = Some(Uuid::new_v4().to_string()); @@ -28,8 +27,7 @@ impl SessionsRepository { session_token.clone().unwrap(), 3600 * 2, // 2 hours ) - .await - .unwrap(); + .await?; let _: () = redis_conn .set_ex( @@ -37,8 +35,7 @@ impl SessionsRepository { user_id, 3600 * 2, // 2 hours ) - .await - .unwrap(); + .await?; } Ok(session_token.unwrap()) @@ -48,8 +45,7 @@ impl SessionsRepository { let mut connection = self.context.redis.get_async_connection().await?; let user_id: Option = connection .get(format!("rework:sessions:{}", session_token)) - .await - .unwrap(); + .await?; if user_id.is_none() { return Ok(()); @@ -59,13 +55,11 @@ impl SessionsRepository { let _: () = connection .del(format!("rework:sessions:{}", session_token)) - .await - .unwrap(); + .await?; let _: () = connection .del(format!("rework:sessions:ids:{}", user_id)) - .await - .unwrap(); + .await?; Ok(()) } diff --git a/src/usecases/beatmaps.rs b/src/usecases/beatmaps.rs new file mode 100644 index 0000000..ca212ec --- /dev/null +++ b/src/usecases/beatmaps.rs @@ -0,0 +1,34 @@ +use std::sync::Arc; + +use s3::error::S3Error; + +use crate::context::Context; + +pub async fn fetch_beatmap_osu_file( + beatmap_id: i32, + context: Arc, +) -> anyhow::Result> { + let beatmap_path = &format!("beatmaps/{beatmap_id}.osu"); + + let existing_file = match context.bucket.get_object(beatmap_path).await { + Ok(existing_file) => Ok(Some(existing_file)), + Err(S3Error::Http(status_code, _)) if status_code == 404 => Ok(None), + Err(e) => Err(e), + }?; + if existing_file.is_some() { + return Ok(existing_file.unwrap().to_vec()); + } + + let osu_response = reqwest::get(&format!("https://old.ppy.sh/osu/{beatmap_id}")) + .await? + .error_for_status()?; + + let response_bytes = osu_response.bytes().await?.to_vec(); + + context + .bucket + .put_object(beatmap_path, &response_bytes) + .await?; + + Ok(response_bytes) +} diff --git a/src/usecases/mod.rs b/src/usecases/mod.rs index 17b7efb..c8b676e 100644 --- a/src/usecases/mod.rs +++ b/src/usecases/mod.rs @@ -1,3 +1,4 @@ +pub mod beatmaps; pub mod leaderboards; pub mod reworks; pub mod sessions; diff --git a/src/usecases/sessions.rs b/src/usecases/sessions.rs index 688b171..cf503dd 100644 --- a/src/usecases/sessions.rs +++ b/src/usecases/sessions.rs @@ -19,41 +19,40 @@ pub async fn create( username: String, password_md5: String, context: Arc, -) -> CreateSessionResponse { +) -> anyhow::Result { let user_info: Option<(i32, String)> = sqlx::query_as("SELECT id, password_md5 FROM users WHERE username_safe = ?") .bind(&username.to_lowercase().replace(" ", "_")) - .fetch_optional(context.database.get().await.unwrap().deref_mut()) - .await - .unwrap(); + .fetch_optional(context.database.get().await?.deref_mut()) + .await?; if user_info.is_none() { - return CreateSessionResponse { + return Ok(CreateSessionResponse { success: false, user_id: None, session_token: None, - }; + }); } let (user_id, database_bcrypt) = user_info.unwrap(); - let correct_password = bcrypt::verify(&password_md5, &database_bcrypt).unwrap_or(false); + let correct_password = bcrypt::verify(&password_md5, &database_bcrypt)?; if !correct_password { - return CreateSessionResponse { + return Ok(CreateSessionResponse { success: false, user_id: None, session_token: None, - }; + }); } let repo = repositories::sessions::SessionsRepository::new(context); - let session_token = repo.create(user_id).await.unwrap(); + let session_token = repo.create(user_id).await?; - CreateSessionResponse { + Ok(CreateSessionResponse { success: true, user_id: Some(user_id), session_token: Some(session_token), - } + }) } pub async fn delete(session_token: String, context: Arc) -> anyhow::Result<()> { @@ -68,25 +67,25 @@ pub async fn enqueue( rework_id: i32, context: Arc, ) -> anyhow::Result { - let mut redis_conn = context.redis.get_async_connection().await.unwrap(); - let user_id: i32 = redis_conn + let mut redis_conn = context.redis.get_async_connection().await?; + let user_id: Option = redis_conn .get(format!("rework:sessions:{}", session_token)) - .await - .unwrap_or(0); + .await?; - if user_id == 0 { + if user_id.is_none() { return Ok(QueueResponse { success: false, message: Some("Invalid session token".to_string()), }); } + let user_id = user_id.unwrap(); + let user_privileges: Option<(i32,)> = sqlx::query_as(r#"SELECT privileges FROM users WHERE id = ?"#) .bind(user_id) .fetch_optional(context.database.get().await?.deref_mut()) - .await - .unwrap(); + .await?; if user_privileges.is_none() { return Ok(QueueResponse { @@ -105,8 +104,7 @@ pub async fn enqueue( let rework: Rework = sqlx::query_as(r#"SELECT * FROM reworks WHERE rework_id = ?"#) .bind(rework_id) .fetch_one(context.database.get().await?.deref_mut()) - .await - .unwrap(); + .await?; let in_queue: Option<(i32,)> = sqlx::query_as( r#"SELECT 1 FROM rework_queue WHERE user_id = ? AND rework_id = ? AND processed_at < ?"#, @@ -115,8 +113,7 @@ pub async fn enqueue( .bind(rework_id) .bind(rework.updated_at) .fetch_optional(context.database.get().await?.deref_mut()) - .await - .unwrap(); + .await?; if in_queue.is_some() { return Ok(QueueResponse { @@ -129,8 +126,7 @@ pub async fn enqueue( .bind(user_id) .bind(rework_id) .execute(context.database.get().await?.deref_mut()) - .await - .unwrap(); + .await?; context .amqp_channel @@ -138,11 +134,10 @@ pub async fn enqueue( "", "rework_queue", BasicPublishOptions::default(), - &rkyv::to_bytes::<_, 256>(&QueueRequest { user_id, rework_id }).unwrap(), + &rkyv::to_bytes::<_, 256>(&QueueRequest { user_id, rework_id })?, BasicProperties::default(), ) - .await - .unwrap(); + .await?; Ok(QueueResponse { success: true,