From 32b67918d79c9956fdb34d4e90f77b19baa8f205 Mon Sep 17 00:00:00 2001 From: kazukazu123123 <50506519+kazukazu123123@users.noreply.github.com> Date: Sun, 28 May 2023 21:05:46 +0900 Subject: [PATCH] Release v1.0.0 (#95) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * please help (#7) * fire * a * fix url * fix errors * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * add support check * maybe fix os version * kazukazu * delete std::any * fix warnings Co-authored-by: ced * fix(deps): update rust crate sysinfo to v0.27.4 (#8) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate sysinfo to v0.27.5 (#9) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate sysinfo to v0.27.6 (#11) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Change renovate target * Fix end of line to lf * fix(deps): update rust crate rust_socketio to v0.4.1 (#12) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#13) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate sysinfo to v0.27.7 (#14) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#15) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix can't connect (#10) * fire * a * fix url * fix errors * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * add support check * maybe fix os version * kazukazu * delete std::any * fix warnings * idk * idk * update * hmm * connect done * test * add thread name * a * hmm * delete rand(tested threads) * refactaring with @hiraginoyuki * hmm * delete mimi * fix load average * hmm * to kazu Co-authored-by: ced * fix(deps): pin dependencies (#17) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Support disk usage (#16) * Support disk usage * Forgot to remove println * cargo fmt * Remove println * Added GPU (#18) * Support disk usage * Forgot to remove println * cargo fmt * Remove println * gpu testing * gpu done * fix(deps): pin dependencies (#17) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix gpu usage with not a number --------- Co-authored-by: kazukazu123123 <50506519+kazukazu123123@users.noreply.github.com> Co-authored-by: ced Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Added hostname option (#20) * hostname * hostname2 --------- Co-authored-by: ced * Specify an icon for windows (#24) * hostname * hostname2 * added icon for windows --------- Co-authored-by: ced * fix(deps): pin rust crate regex to =1.7.1 (#19) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * eo (#26) * Revert "eo (#26)" (#27) This reverts commit 15ad4aed48e15943f8cdabd1c5a9b044b201f952. * chore(deps): pin rust crate winres to =0.1.12 (#25) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Add do-not-merge action (#29) * chore(deps): lock file maintenance (#33) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde_json to v1.0.92 (#31) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde_json to v1.0.93 (#34) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#35) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#37) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate sysinfo to v0.28.0 (#36) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate sysinfo to v0.28.1 (#38) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate sysinfo to v0.28.2 (#39) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde_json to v1.0.94 (#40) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#41) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde to v1.0.153 (#42) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde to v1.0.154 (#44) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix do-not-merge action (#43) * fix(deps): update rust crate serde to v1.0.155 (#45) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde to v1.0.156 (#47) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#48) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate sysinfo to v0.28.3 (#49) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde to v1.0.157 (#50) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#51) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde to v1.0.158 (#52) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate regex to v1.7.2 (#53) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate dotenvy to v0.15.7 (#54) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate sysinfo to v0.28.4 (#55) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate regex to v1.7.3 (#56) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#57) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde to v1.0.159 (#59) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde_json to v1.0.95 (#58) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde to v1.0.160 (#60) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate serde_json to v1.0.96 (#61) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate regex to v1.8.0 (#62) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate regex to v1.8.1 (#63) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * ぜったいブランチ名とかけ離れてる (#64) * fix(deps): pin rust crate serde_derive to =1.0.160 (#65) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix env code (#66) * chore(deps): lock file maintenance (#69) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix memory usage (#73) * Fix memory usage * fix (2) * Fix target_os cfg attribute for Windows (#74) * Fix do-not-merge action (#75) * Add Security audit action (#76) * add rustls (#67) * add rust-openssl * fix package * あどれどめ (#28) * eo * Update README.md --------- Co-authored-by: kazukazu123123 <50506519+kazukazu123123@users.noreply.github.com> * fix(deps): pin rust crate rustls to =0.21.0 (#77) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate rustls to v0.21.1 (#78) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate sysinfo to v0.29.0 (#72) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#79) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Add openssl for rust_socketio (#80) remove rustls ( revert 1249115ab8f1d8587f71a77f814b41cce1db4056 ) * fix(deps): pin rust crate openssl to =0.10.52 (#81) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Add build action (#83) * Fix build action (#85) * Fix do-not-merge action (#84) * Add versioning action (#86) * chore(deps): lock file maintenance (#82) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update swatinem/rust-cache digest to ad97570 (#87) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update swatinem/rust-cache digest to bb80d0f (#88) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix versioning.yml (#89) * Update serde related crate (#90) * chore(deps): update swatinem/rust-cache digest to 988c164 (#91) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate regex to v1.8.2 (#93) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#92) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate regex to v1.8.3 (#94) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Release v1.0.0 --------- Co-authored-by: Ced <43949163+Zel9278@users.noreply.github.com> Co-authored-by: ced Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Mogyuchi Co-authored-by: あさると <34514603+Assault1892@users.noreply.github.com> Co-authored-by: Mogyuchi --- .gitattributes | 1 + .github/workflows/build.yml | 75 ++++ .github/workflows/do-not-merge.yml | 24 + .github/workflows/security-audit.yml | 16 + .github/workflows/versioning.yml | 54 +++ Cargo.lock | 627 +++++++++++++++++---------- Cargo.toml | 22 +- README.md | 30 +- assets/icon.ico | Bin 0 -> 4286 bytes build.rs | 11 + renovate.json | 1 + src/gpu.rs | 58 +++ src/main.rs | 217 +++++---- src/status.rs | 146 +++++++ src/status/mod.rs | 21 - src/thread_message/mod.rs | 4 + src/threads/mod.rs | 22 + src/unix_to_date.rs | 17 + 18 files changed, 1001 insertions(+), 345 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/do-not-merge.yml create mode 100644 .github/workflows/security-audit.yml create mode 100644 .github/workflows/versioning.yml create mode 100644 assets/icon.ico create mode 100644 build.rs create mode 100644 src/gpu.rs create mode 100644 src/status.rs delete mode 100644 src/status/mod.rs create mode 100644 src/thread_message/mod.rs create mode 100644 src/threads/mod.rs create mode 100644 src/unix_to_date.rs diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..94f480de --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..353d4fa4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,75 @@ +name: build +on: + push: + branches: + - 'develop' + pull_request: + release: + types: [published] + +jobs: + build: + permissions: + contents: write + strategy: + fail-fast: false + matrix: + target: [aarch64-unknown-linux-gnu, aarch64-unknown-linux-musl, x86_64-unknown-netbsd] + use-cross: [true] + include: + - target: x86_64-unknown-linux-gnu + use-cross: false + - target: x86_64-unknown-linux-musl + use-cross: false + - os: macos-12 + target: aarch64-apple-darwin + - os: macos-12 + target: x86_64-apple-darwin + - os: windows-2022 + target: x86_64-pc-windows-msvc + - os: windows-2022 + target: x86_64-pc-windows-gnu + runs-on: ${{ matrix.os || 'ubuntu-22.04'}} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + defaults: + run: + shell: bash -xe {0} + steps: + - name: Install musl tools + if: matrix.target == 'x86_64-unknown-linux-musl' + run: | + sudo apt-get install -y musl-tools --no-install-recommends + - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222 + - uses: actions-rs/toolchain@88dc2356392166efad76775c878094f4e83ff746 + with: + toolchain: stable + target: ${{ matrix.target }} + - uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 + with: + key: ${{ matrix.target }} + - uses: actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72 + with: + use-cross: ${{ !matrix.os && matrix.use-cross }} + command: build + args: --locked --release --target ${{ matrix.target }} + - uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05 + with: + name: ${{ matrix.target }} + path: | + target/${{ matrix.target }}/release/pcsc-rs + target/${{ matrix.target }}/release/pcsc-rs.exe + - name: Upload to release + if: github.event_name == 'release' + working-directory: target/${{ matrix.target }}/release/ + run: | + if [ -e pcsc-rs.exe ]; then + filename="pcsc-rs-${{ github.event.release.tag_name }}-${{ matrix.target }}.exe" + mv pcsc-rs.exe "$filename" + gh release upload ${{ github.event.release.tag_name }} "$filename"#${{ matrix.target }} --clobber + else + filename="pcsc-rs-${{ github.event.release.tag_name }}-${{ matrix.target }}" + mv pcsc-rs "$filename" + gh release upload ${{ github.event.release.tag_name }} "$filename"#${{ matrix.target }} --clobber + fi diff --git a/.github/workflows/do-not-merge.yml b/.github/workflows/do-not-merge.yml new file mode 100644 index 00000000..6bc0bfa2 --- /dev/null +++ b/.github/workflows/do-not-merge.yml @@ -0,0 +1,24 @@ +name: DO NOT MERGE + +on: + pull_request: + types: + - opened + - synchronize + - labeled + - unlabeled + +permissions: + pull-requests: read + +jobs: + do-not-merge: + name: '!!!' + runs-on: ubuntu-22.04 + steps: + - run: | + if ${{ contains(github.event.pull_request.labels.*.name, 'do NOT merge!!!') }}; then + false + else + true + fi diff --git a/.github/workflows/security-audit.yml b/.github/workflows/security-audit.yml new file mode 100644 index 00000000..5a60dcac --- /dev/null +++ b/.github/workflows/security-audit.yml @@ -0,0 +1,16 @@ +name: Security audit +on: + push: + paths: + - '**/Cargo.toml' + - '**/Cargo.lock' + schedule: + - cron: '0 0 * * *' +jobs: + security_audit: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222 + - uses: actions-rs/audit-check@35b7b53b1e25b55642157ac01b4adceb5b9ebef3 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/versioning.yml b/.github/workflows/versioning.yml new file mode 100644 index 00000000..398907f3 --- /dev/null +++ b/.github/workflows/versioning.yml @@ -0,0 +1,54 @@ +name: Versioning +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + versioning: + name: 'Versioning' + runs-on: ubuntu-22.04 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + steps: + - uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222 + with: + fetch-depth: 0 + - name: Setup git + run: | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "github-actions[bot]" + git config push.default current + - run: | + version_string=$(awk -F'[ ="]+' '$1 ~ /^version/ { print $2; exit }' Cargo.toml) + pr=$( (git log --oneline @...v"$version_string" || git log --oneline) | sed -nE 's/.+\((#[0-9]+)\)$/\1/p') + labels=$( echo "$pr" | xargs -n1 gh pr view --json labels -q '.labels[].name') + mapfile -t version < <(printf '%s\n' "${version_string//./$'\n'}") + if printf '%s\n' "${labels[@]}" | grep -qx 'release'; then + exit 0 + elif printf '%s\n' "${labels[@]}" | grep -qx 'semver:major'; then + ((++version[0])) + version[1]=0 + version[2]=0 + elif printf '%s\n' "${labels[@]}" | grep -qx 'semver:minor'; then + ((++version[1])) + version[2]=0 + elif printf '%s\n' "${labels[@]}" | grep -qx 'semver:patch'; then + ((++version[2])) + else + exit 0 + fi + new_version_string=$(printf ".%s" "${version[@]}") + new_version_string=${new_version_string:1} + git switch -C release + VERSION=$new_version_string perl -i -pe 's/(version = ").+/\1$ENV{VERSION}"/ if !$done; $done ||= $&' Cargo.toml + cargo update -p "$(awk -F'[ ="]+' '$1 ~ /^name/ { print $2; exit }' Cargo.toml)" + echo -e "Release v${new_version_string}\n\nPR:\n${pr}" | git commit --no-gpg-sign -a --file=- + git push -f + gh pr create --base main --fill --label release || echo -e "PR:\n${pr}" | gh pr edit --title "Release v${new_version_string}" --body-file - + gh pr merge --auto --delete-branch --squash diff --git a/Cargo.lock b/Cargo.lock index cc8dfc38..0b58e3a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,28 +10,35 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" dependencies = [ "memchr", ] +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + [[package]] name = "async-stream" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", + "pin-project-lite", ] [[package]] name = "async-stream-impl" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", @@ -40,9 +47,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.61" +version = "0.1.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", @@ -72,6 +79,18 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" + +[[package]] +name = "base64" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f1e31e207a6b8fb791a38ea3105e6cb541f55e4d029902d3039a4ad07cc4105" + [[package]] name = "bitflags" version = "1.3.2" @@ -80,18 +99,18 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte" @@ -107,15 +126,15 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cc" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cfg-if" @@ -135,24 +154,24 @@ 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.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -160,9 +179,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -171,9 +190,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" dependencies = [ "autocfg", "cfg-if", @@ -184,9 +203,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" dependencies = [ "cfg-if", ] @@ -203,9 +222,9 @@ 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", @@ -213,30 +232,51 @@ dependencies = [ [[package]] name = "dotenvy" -version = "0.15.6" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "either" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if", ] +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] @@ -273,45 +313,57 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", "futures-io", + "futures-macro", "futures-sink", "futures-task", "memchr", @@ -322,9 +374,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", @@ -332,9 +384,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "libc", @@ -343,9 +395,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.15" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" dependencies = [ "bytes", "fnv", @@ -375,11 +427,17 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -411,9 +469,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes", "futures-channel", @@ -458,9 +516,9 @@ 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", @@ -475,23 +533,34 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "io-lifetimes" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "ipnet" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ "wasm-bindgen", ] @@ -504,9 +573,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "log" @@ -525,29 +600,29 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ "autocfg", ] [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mio" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", "wasi", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -570,9 +645,9 @@ dependencies = [ [[package]] name = "ntapi" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc51db7b362b205941f71232e56c625156eb9a929f8cf74a428fd5bc094a4afc" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" dependencies = [ "winapi", ] @@ -583,21 +658,21 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] [[package]] name = "once_cell" -version = "1.17.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "openssl" -version = "0.10.45" +version = "0.10.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" +checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" dependencies = [ "bitflags", "cfg-if", @@ -610,9 +685,9 @@ 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", @@ -625,28 +700,43 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "111.25.3+1.1.1t" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924757a6a226bf60da5f7dd0311a34d2b52283dd82ddeb103208ddc66362f80c" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" -version = "0.9.80" +version = "0.9.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" +checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" dependencies = [ - "autocfg", "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] [[package]] name = "pcsc-rs" -version = "0.1.0" +version = "1.0.0" dependencies = [ + "arc-swap", + "cfg-if", "dotenvy", + "openssl", + "regex", "rust_socketio", "serde", + "serde_derive", "serde_json", "sysinfo", + "winres", ] [[package]] @@ -669,9 +759,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[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 = "ppv-lite86" @@ -681,18 +771,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" dependencies = [ "proc-macro2", ] @@ -729,9 +819,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ "either", "rayon-core", @@ -739,9 +829,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -751,18 +841,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.7.0" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" dependencies = [ "aho-corasick", "memchr", @@ -771,26 +861,17 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "reqwest" -version = "0.11.13" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "base64", + "base64 0.21.1", "bytes", "encoding_rs", "futures-core", @@ -818,20 +899,21 @@ dependencies = [ "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "winreg", ] [[package]] name = "rust_engineio" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cd434cde8795564d406eae1b13307dbe8746b70f42362b10ed8277743b5f25" +checksum = "82be271500ebf0492a4e5cf234be482f1ff09eae100b5e52dd3f247fea28f55d" dependencies = [ "adler32", "async-stream", "async-trait", - "base64", + "base64 0.20.0", "bytes", "crossbeam-utils", "futures-util", @@ -849,13 +931,13 @@ dependencies = [ [[package]] name = "rust_socketio" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bc5605d34e5a1ce22bd0d7e20180a042f95a617a461577e25fc2f29a9751b90" +checksum = "f75f9a5212781aa18fc87cb81e134de245061d407809a094b1b8869ed812b7b7" dependencies = [ "adler32", "backoff", - "base64", + "base64 0.20.0", "byte", "bytes", "crossbeam-utils", @@ -868,20 +950,33 @@ dependencies = [ "url", ] +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "schannel" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "lazy_static", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] @@ -892,9 +987,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "security-framework" -version = "2.7.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ "bitflags", "core-foundation", @@ -905,9 +1000,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" dependencies = [ "core-foundation-sys", "libc", @@ -915,18 +1010,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.152" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", @@ -935,9 +1030,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", @@ -969,18 +1064,18 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -988,9 +1083,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.107" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" dependencies = [ "proc-macro2", "quote", @@ -999,9 +1094,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.27.3" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1620f9573034c573376acc550f3b9a2be96daeb08abb3c12c8523e1cee06e80f" +checksum = "02f1dc6930a439cc5d154221b5387d153f8183529b07c19aca24ea31e0a167e1" dependencies = [ "cfg-if", "core-foundation-sys", @@ -1014,32 +1109,31 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.3.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if", "fastrand", - "libc", "redox_syscall", - "remove_dir_all", - "winapi", + "rustix", + "windows-sys 0.45.0", ] [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", @@ -1057,32 +1151,31 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.24.1" +version = "1.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", "num_cpus", "pin-project-lite", "socket2", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -1104,9 +1197,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -1116,6 +1209,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -1135,9 +1237,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] @@ -1154,7 +1256,7 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ - "base64", + "base64 0.13.1", "byteorder", "bytes", "http", @@ -1176,15 +1278,15 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-normalization" @@ -1242,9 +1344,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1252,9 +1354,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", @@ -1267,9 +1369,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" dependencies = [ "cfg-if", "js-sys", @@ -1279,9 +1381,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1289,9 +1391,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", @@ -1302,15 +1404,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" + +[[package]] +name = "wasm-streams" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" dependencies = [ "js-sys", "wasm-bindgen", @@ -1340,103 +1455,150 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] name = "windows-sys" -version = "0.42.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" [[package]] name = "windows_aarch64_msvc" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winreg" @@ -1446,3 +1608,12 @@ checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ "winapi", ] + +[[package]] +name = "winres" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" +dependencies = [ + "toml", +] diff --git a/Cargo.toml b/Cargo.toml index 89a36853..63359443 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,23 @@ [package] name = "pcsc-rs" -version = "0.1.0" +version = "1.0.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dotenvy = "=0.15.6" -rust_socketio = "=0.4.0" -serde = { version = "=1.0.152", features = ["derive"] } -serde_json = "=1.0.91" -sysinfo = "=0.27.3" +arc-swap = "=1.6.0" +cfg-if = "=1.0.0" +dotenvy = "=0.15.7" +regex = "=1.8.3" +rust_socketio = "=0.4.1" +serde = { version = "=1.0.163", features = ["derive"] } +serde_derive = "=1.0.163" +serde_json = "=1.0.96" +sysinfo = "=0.29.0" + +[target.'cfg(windows)'.build-dependencies] +winres = "=0.1.12" + +[target.'cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))'.dependencies] +openssl = { version = "=0.10.52", features = ["vendored"] } diff --git a/README.md b/README.md index 3f6c5267..41a5408e 100644 --- a/README.md +++ b/README.md @@ -1 +1,29 @@ -# pcsc-rs \ No newline at end of file +# PC Status Client - Rust +PCの状態を取得し,[PC Status](https://pc-stats.eov2.com/)に送信,表示するツールです。 + +![image](https://cdn.discordapp.com/attachments/916525261409898527/1070176168948539452/0UAAAAASUVORK5CYII.png) + +## 注意 +**ツールの性質上,以下の内容が他者に誰でも見られる状態で送信されるため,少しでも不快感を感じる人であれば使用しないでください。**\ +個人情報に繋がるような情報は**ホスト名を除き**送信される事はありませんが,必要に応じてPCのホスト名を変更するか,或いは `.env` 内に以下のKeyを追加してください。 + +```env +HOSTNAME=ホスト名として表示させたい文字列 +``` + +## 送信,表示内容 +1. PCのホスト名 (e.g. `assault-e5dmts`) + - ホスト名に個人情報などが含まれている場合は使用しない事を**強く**推奨します。 + - 64文字まで受け付けますが,32文字目以降は ... で隠されます。\ + マウスオーバーで全て表示されます。 +2. OSのバージョン (e.g. `Windows 10 Home(Windows_NT win32 x64 10.0.19044)`) +3. CPU名,CPU使用率 (全体, コアごと) (e.g. `AMD Ryzen 5 3500 6-Core Processor`) +4. メモリ使用量 +5. ストレージ占有量 (実行しているrootを参照) +6. GPU使用率 (NVIDIAのGPUのみ) +7. 起動時間 +8. Load Average (Linuxのみ) + +## 使い方 + +Coming soon... diff --git a/assets/icon.ico b/assets/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..c6c3880db58af025bcfc3692cda35749b3b13275 GIT binary patch literal 4286 zcmeH}F-`+95Je}XpadxqbvnW=XlWyn777l)ML0u5hmbe`ROz?|5;YJBYRrG^TC$8+ zQM{W~ko=>+UXOSF%#J;)m<{xsOpL4D9hx1P*;JItPDSiZaL!rbPS@aC`*WX3eB18t zn>2EPZ`=4&X`I)5t`oTlY<>+J;2Cejw{85;pM3!6hj#9<0iKE1x|;V9f2{n^L|?;j z+_e6oFPft@wV7-EQ`{ENCa2VX@ZMkIxA-LH_FR)6nrM?lst(i#Jc_COy0DQ0AXcnL zUBG`ozwvv8^FI0~j2GXR_|+Lp^*-}4;pj#cby;F zfLQUfC%-Gsy=%M@`5tviG(SXeEXMJf-?F%6ETo@`jcrf76c-}B(k0Qn5C>vY{9^CF jHrkFFrt*8f>aV`IGCO!N+h3XuD+|`mi9b5fhhzK!qqQc8 literal 0 HcmV?d00001 diff --git a/build.rs b/build.rs new file mode 100644 index 00000000..013186d3 --- /dev/null +++ b/build.rs @@ -0,0 +1,11 @@ +use std::io; +#[cfg(windows)] use winres::WindowsResource; + +fn main() -> io::Result<()> { + #[cfg(windows)] { + WindowsResource::new() + .set_icon("assets/icon.ico") + .compile()?; + } + Ok(()) +} diff --git a/renovate.json b/renovate.json index 304a37fb..102046b8 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "baseBranches": ["develop"], "extends": [ "config:js-app", ":rebaseStalePrs", diff --git a/src/gpu.rs b/src/gpu.rs new file mode 100644 index 00000000..6b536ce2 --- /dev/null +++ b/src/gpu.rs @@ -0,0 +1,58 @@ +use regex::Regex; +use cfg_if::cfg_if; + +use crate::status::{GpuData, GpuMemory}; +use std::process::Command; +#[cfg(target_os = "windows")] +use std::os::windows::process::CommandExt; + +#[cfg(target_os = "windows")] +const CREATE_NO_WINDOW: u32 = 0x08000000; + +pub fn get_info() -> Option { + let mut binding = Command::new("nvidia-smi"); + let command = binding + .args([ + "--format=csv", + "--query-gpu=name,utilization.gpu,memory.free,memory.total", + ]); + + cfg_if! { + if #[cfg(target_os = "windows")] { + command.creation_flags(CREATE_NO_WINDOW); + } + }; + + let output = command.output(); + if output.is_err() { + return None; + } else { + let res = output.expect("process error"); + + let split_seperator = Regex::new(r"\r\n|\n").expect("Invalid regex"); + let split_binding = String::from_utf8(res.stdout).unwrap(); + let splited: Vec<_> = split_seperator.split(&split_binding).into_iter().collect(); + + let replace_seperator = Regex::new(r" %| MiB| GiB|\r").expect("Invalid regex"); + let split2_seperator = Regex::new(r", ").expect("Invalid regex"); + let replaced = + replace_seperator.replace_all(splited.get(1).expect("not found at index 1"), ""); + let splited2: Vec<_> = split2_seperator.split(&replaced).into_iter().collect(); + + let usage: Option = match splited2[1] { + "[N/A]" => None, + _ => Some(splited2[1].to_string().parse::().unwrap()), + }; + + let result = Some(GpuData { + name: splited2[0].into(), + usage, + memory: GpuMemory { + free: splited2[2].to_string().parse::().unwrap(), + total: splited2[3].to_string().parse::().unwrap(), + }, + }); + + return result; + }; +} diff --git a/src/main.rs b/src/main.rs index 398c402c..326a038c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,108 +1,147 @@ +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +#[test] +fn test_function() { + if false { + panic!("Test Failed."); + } +} + +mod gpu; mod status; +mod thread_message; +mod threads; +mod unix_to_date; +use arc_swap::ArcSwap; use dotenvy::dotenv; -use rust_socketio::{ClientBuilder, Payload, RawClient}; +use rust_socketio::{ClientBuilder, Event, Payload, RawClient}; +use serde_derive::{Deserialize, Serialize}; use serde_json::json; -use std::env; -use std::time::Duration; -use sysinfo::{CpuExt, System, SystemExt}; +use std::{ + env, hint, process, + sync::{Arc, Mutex}, + thread, + time::Duration, path::Path, +}; +use sysinfo::{System, SystemExt}; + +use crate::status::SystemStatus; + +struct App { + pub finish: bool, +} + +impl App { + pub fn new() -> Self { + App { finish: false } + } + + fn on_message(&mut self, payload: Payload, _socket: RawClient) { + println!("message: {:#?}", payload); + self.finish = true; + } +} + +#[derive(Serialize, Deserialize, Debug)] +struct AppConfig { + uri: String, + password: Option, + hostname: Option, +} -use crate::status::{CpuData, CpuCoreUsage, StatusData}; +impl ::std::default::Default for AppConfig { + fn default() -> Self { + Self { + uri: "https://pcss.eov2.com".into(), + password: None, + hostname: None, + } + } +} fn main() { - dotenv().expect(".env file not found"); + let rs = Path::new(".env").exists(); + if rs { + dotenv().expect(".env file not found"); + } - /*for (key, value) in env::vars() { - println!("{key}: {value}"); - }*/ + if !System::IS_SUPPORTED { + println!("This OS isn't supported (yet?)."); + process::exit(95); + } - println!("Hello, world!"); + if !env::var("PASS").is_ok() { + println!("The environment variable Password (PASS) is not specified."); + process::exit(95); + } - let mut sys = System::new_all(); - sys.refresh_all(); + start(); +} - let cpu_name = sys.cpus()[0].brand().to_string(); - let os_name = sys.name().expect("Failed to get os name"); - let os_version = sys.os_version().expect("Failed to get os version"); - let hostname = sys.host_name().expect("Failed to get hostname"); - - println!("System OS: {} {}", os_name, os_version); - - let mut system_info = StatusData { - _os: format!("{} {}", os_name, os_version), - hostname: hostname, - version: "".to_string(), - cpu: CpuData { - model: "".to_string(), - cpus: vec![], - percent: 0, - }, - }; - - println!("{}", json!(system_info)); - - let send_system_info = |payload: Payload, socket: RawClient| match payload { - Payload::String(str) => { - println!("Received: {}", str); - //socket.emit("test", json!(system_info)).expect("Failed to emit."); - } - _ => {} - }; - - let socket = ClientBuilder::new("http://localhost:4200") - .namespace("/") - .on("connect", |_, _| println!("Connected")) - .on("disconnect", |_, _| println!("Disconnected")) - .on("hi", send_system_info) - .on("sync", send_system_info) - .on("error", |err, _| eprintln!("Error: {:#?}", err)) +fn start() { + let mut system = System::new_all(); + + let shared_data = Arc::new(ArcSwap::from_pointee(SystemStatus::get(&mut system))); + + threads::spawn_monitor(Arc::clone(&shared_data)); + + let pcsc_uri = env::var("PCSC_URI").unwrap_or_else(|_| "https://pcss.eov2.com".into()); + + println!("This OS is supported!"); + println!("Hello, world! {}", pcsc_uri); + + let app = Arc::new(Mutex::new(App::new())); + let event_app = app.clone(); + + ClientBuilder::new(pcsc_uri) + .namespace("/server") + .on(Event::Connect, |_, _| println!("Connected")) + .on(Event::Close, |_, _| println!("Disconnected")) + .on("hi", |payload, socket| { + match payload { + Payload::String(str) => println!("Received: {}", str), + Payload::Binary(bin_data) => println!("Received bytes: {:#?}", bin_data), + }; + init(socket); + }) + .on("sync", move |payload, socket| { + match payload { + Payload::String(str) => println!("Received: {}", str), + Payload::Binary(bin_data) => println!("Received bytes: {:#?}", bin_data), + }; + + let status = shared_data.load(); + if let Err(e) = socket.emit("sync", json!(status.as_ref())) { + dbg!(e); + } + }) + .on(Event::Message, move |payload, client| { + event_app.lock().unwrap().on_message(payload, client) + }) + .on(Event::Error, |err, _| match err { + Payload::String(str) => eprintln!("Error: {}", str), + Payload::Binary(bin_data) => eprintln!("Error: {:#?}", bin_data), + }) .connect() .expect("Connection failed"); - let json_payload = json!({"token": 123}); - socket - .emit("foo", json_payload) - .expect("Server unreachable"); + while !app.lock().unwrap().finish { + hint::spin_loop(); + thread::sleep(Duration::from_secs(1)); + } +} - // Update all information +fn init(socket: RawClient) { + print!("hi from server"); - let load_avg = sys.load_average(); - println!( - "one minute: {}, five minutes: {}, fifteen minutes: {}", - load_avg.one, load_avg.five, load_avg.fifteen, - ); + let mut sys = System::new_all(); + sys.refresh_all(); - // Disks - println!("=> disks:"); - for disk in sys.disks() { - println!("{:?}", disk); - } + let pass = env::var("PASS").unwrap_or_default(); - println!("=> system:"); - // RAM and swap: - println!("total memory: {} bytes", sys.total_memory()); - println!("used memory : {} bytes", sys.used_memory()); - println!("total swap : {} bytes", sys.total_swap()); - println!("used swap : {} bytes", sys.used_swap()); - - // System information: - println!( - "System host name: {}", - sys.host_name().expect("Failed to get hostname") - ); - - // Number of CPUs: - println!("NB CPUs: {}", sys.cpus().len()); - - // CPU Usage - loop { - sys.refresh_cpu(); // Refreshing CPU information. - println!("---------------"); - //println!("{}", sys.cpus()); - for cpu in sys.cpus() { - println!("{}%", cpu.cpu_usage()); - } - println!("---------------"); - std::thread::sleep(Duration::from_secs(1)); - } + let status = SystemStatus::get(&mut sys); + socket + .emit("hi", json!(status.with_pass(pass))) + .expect("Failed to emit."); } diff --git a/src/status.rs b/src/status.rs new file mode 100644 index 00000000..bf8488c7 --- /dev/null +++ b/src/status.rs @@ -0,0 +1,146 @@ +use std::env; + +use cfg_if::cfg_if; +use serde::{Deserialize, Serialize}; +use sysinfo::{Cpu, CpuExt, DiskExt, System, SystemExt}; + +use crate::{gpu, unix_to_date}; + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct CoreData { + #[serde(rename = "cpu")] + pub(crate) usage: f32, +} +impl From<&Cpu> for CoreData { + fn from(value: &Cpu) -> Self { + Self { + usage: value.cpu_usage(), + } + } +} + +#[derive(Serialize, Deserialize, Clone)] +pub struct CpuData { + pub(crate) model: String, + pub(crate) cpus: Vec, +} + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct RamData { + pub(crate) free: u64, + pub(crate) total: u64, +} + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct SwapData { + pub(crate) free: u64, + pub(crate) total: u64, +} + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct StorageData { + pub(crate) free: u64, + pub(crate) total: u64, +} + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct GpuMemory { + pub(crate) free: u64, + pub(crate) total: u64, +} + +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct GpuData { + pub(crate) name: String, + pub(crate) usage: Option, + pub(crate) memory: GpuMemory, +} + +#[derive(Serialize, Deserialize, Clone)] +pub struct SystemStatus { + pub(crate) _os: String, + pub(crate) hostname: String, + pub(crate) version: String, + pub(crate) cpu: CpuData, + pub(crate) ram: RamData, + pub(crate) swap: SwapData, + pub(crate) storage: StorageData, + #[serde(rename = "loadavg")] + pub(crate) load_average: Option<[f64; 3]>, + pub(crate) uptime: String, + pub(crate) gpu: Option, +} + +#[derive(Serialize, Deserialize, Clone)] +pub struct StatusDataWithPass { + #[serde(flatten)] + pub(crate) status: SystemStatus, + pub(crate) pass: String, +} + +impl SystemStatus { + pub fn get(sys: &mut System) -> Self { + let cpu_name = sys.cpus()[0].brand().to_string(); + let os_name = sys.name().expect("Failed to get os name"); + let os_version = sys + .os_version() + .or(sys.kernel_version()) + .expect("Failed to get os version"); + + let hostname = env::var("HOSTNAME").unwrap_or_else(|_| sys.host_name().expect("Failed to get hostname")); + + cfg_if! { + if #[cfg(target_os = "windows")] { + let load_average = None; + } else { + let load_average = sys.load_average(); + let load_average = Some([load_average.one, load_average.five, load_average.fifteen]); + } + }; + + let cpus: Vec = sys.cpus().iter().map(Into::into).collect(); + + let cpu = CpuData { + model: cpu_name.clone(), + cpus, + }; + + let ram = RamData { + free: sys.available_memory(), + total: sys.total_memory(), + }; + + let swap = SwapData { + free: sys.free_swap(), + total: sys.total_swap(), + }; + + let uptime = unix_to_date::new(sys.uptime()); + + let disk = sys.disks().iter().next(); + + let storage = StorageData { + free: disk.unwrap().available_space(), + total: disk.unwrap().total_space(), + }; + + let gpu = gpu::get_info(); + + Self { + _os: format!("{} {}", os_name.clone(), os_version.clone()), + version: "Rust".into(), + hostname, + cpu, + ram, + swap, + load_average, + uptime, + storage, + gpu, + } + } + + pub fn with_pass(self, pass: String) -> StatusDataWithPass { + StatusDataWithPass { status: self, pass } + } +} diff --git a/src/status/mod.rs b/src/status/mod.rs deleted file mode 100644 index 10c3b5dd..00000000 --- a/src/status/mod.rs +++ /dev/null @@ -1,21 +0,0 @@ -use serde::{Serialize, Deserialize}; - -#[derive(Serialize, Deserialize)] -pub struct CpuCoreUsage { - pub(crate) cpu: i16 -} - -#[derive(Serialize, Deserialize)] -pub struct CpuData { - pub(crate) model: String, - pub(crate) cpus: Vec, - pub(crate) percent: i16 -} - -#[derive(Serialize, Deserialize)] -pub struct StatusData { - pub(crate) _os: String, - pub(crate) hostname: String, - pub(crate) version: String, - pub(crate) cpu: CpuData -} diff --git a/src/thread_message/mod.rs b/src/thread_message/mod.rs new file mode 100644 index 00000000..3716b22d --- /dev/null +++ b/src/thread_message/mod.rs @@ -0,0 +1,4 @@ +#[allow(dead_code)] +pub struct ThreadMessage { + pub(crate) data: serde_json::Value, +} diff --git a/src/threads/mod.rs b/src/threads/mod.rs new file mode 100644 index 00000000..c2be79cb --- /dev/null +++ b/src/threads/mod.rs @@ -0,0 +1,22 @@ +use arc_swap::ArcSwap; +use sysinfo::{System, SystemExt}; + +use std::{sync::Arc, thread, time::Duration}; + +use crate::status::SystemStatus; + +pub fn spawn_monitor(shared_data: Arc>) { + let mut sys = System::new_all(); + let builder = thread::Builder::new(); + + builder + .name("System Monitor".into()) + .spawn(move || loop { + thread::sleep(Duration::from_secs(1)); + + sys.refresh_all(); + let current_status = SystemStatus::get(&mut sys); + shared_data.store(Arc::new(current_status)); + }) + .unwrap(); +} diff --git a/src/unix_to_date.rs b/src/unix_to_date.rs new file mode 100644 index 00000000..88c8a4dd --- /dev/null +++ b/src/unix_to_date.rs @@ -0,0 +1,17 @@ +use std::string::String; + +pub fn new(sec: u64) -> String { + let mut total_seconds = sec; + let days = total_seconds / 86400; + total_seconds %= 86400; + let hours = total_seconds / 3600; + total_seconds %= 3600; + let minutes = total_seconds / 60; + total_seconds %= 60; + let seconds = total_seconds; + + return format!( + "{} days {} hours {} minutes {} seconds", + days, hours, minutes, seconds + ); +}