diff --git a/.env b/.env new file mode 100644 index 0000000..e69de29 diff --git a/.envrc b/.envrc deleted file mode 100644 index eca1fc7..0000000 --- a/.envrc +++ /dev/null @@ -1,3 +0,0 @@ -use flake . --accept-flake-config; - -# source .envrc-local \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index efa9251..c001aaa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,12 +17,36 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - run: docker buildx create --use --driver=docker-container - run: | - TAG_LATEST_IF_MASTER=$(if [ "$GITHUB_REF_NAME" = "main" ]; then echo "-t ghcr.io/${{ github.repository }}/${{ matrix.service }}:latest"; else echo ""; fi) - docker buildx build . \ + docker build . \ --build-arg SERVICE=${{ matrix.service }} \ - -t ghcr.io/${{ github.repository }}/${{ matrix.service }}:${{ github.sha }} $TAG_LATEST_IF_MASTER \ - --push \ - --cache-to type=gha,scope=$GITHUB_REF_NAME-${{ matrix.service }} \ - --cache-from type=gha,scope=$GITHUB_REF_NAME-${{ matrix.service }} + -t ghcr.io/${{ github.repository }}/${{ matrix.service }}:${{ github.sha }} + - run: | + docker tag ghcr.io/${{ github.repository }}/${{ matrix.service }}:${{ github.sha }} \ + ghcr.io/${{ github.repository }}/${{ matrix.service }}:latest + if: github.ref == 'refs/heads/main' + - run: | + docker push ghcr.io/${{ github.repository }}/${{ matrix.service }} + deploy: + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/main' + environment: + name: production + url: https://saerro.harasse.rs + permissions: + contents: "read" + id-token: "write" + steps: + - id: "auth" + uses: "google-github-actions/auth@v1" + with: + workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.SERVICE_ACCOUNT }} + + - name: "Set up Cloud SDK" + uses: "google-github-actions/setup-gcloud@v1" + + - name: "Deploy" + run: | + gcloud compute ssh ${{ secrets.VM_NAME }} --zone=us-central1-a --command "cd /opt && sudo docker compose pull && sudo docker compose up -d" diff --git a/.gitignore b/.gitignore index 8e2b7b7..ea8c4bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1 @@ /target -.DS_Store -*/.DS_Store -.envrc-local -/.vscode -/.direnv -/result \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 602ef43..4429ee7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,55 +12,26 @@ dependencies = [ "regex", ] -[[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.8.8" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "cfg-if", "getrandom", "once_cell", "version_check", - "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.1.2" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[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" @@ -75,11 +46,9 @@ name = "api" version = "0.1.0" dependencies = [ "async-graphql", + "async-graphql-axum", "axum", - "chrono", "lazy_static", - "openssl", - "prometheus", "reqwest", "serde", "serde_json", @@ -96,22 +65,20 @@ checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a" [[package]] name = "async-graphql" -version = "6.0.11" +version = "5.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298a5d587d6e6fdb271bf56af2dc325a80eb291fd0fc979146584b9a05494a8c" +checksum = "42bb92ffef089e5b61e90bcc004c9689554dfb5a150d88e81c7f6fef9e76eeae" dependencies = [ "async-graphql-derive", "async-graphql-parser", "async-graphql-value", "async-stream", "async-trait", - "base64 0.13.1", + "base64", "bytes", - "chrono", "fast_chemail", "fnv", "futures-util", - "handlebars", "http", "indexmap", "mime", @@ -129,10 +96,27 @@ dependencies = [ ] [[package]] -name = "async-graphql-derive" -version = "6.0.11" +name = "async-graphql-axum" +version = "5.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f329c7eb9b646a72f70c9c4b516c70867d356ec46cb00dcac8ad343fd006b0" +checksum = "077bf197d54397cff2324b79d86a7a21b2a83260e62e33eccae33009427897c9" +dependencies = [ + "async-graphql", + "async-trait", + "axum", + "bytes", + "futures-util", + "http-body", + "serde_json", + "tokio-util", + "tower-service", +] + +[[package]] +name = "async-graphql-derive" +version = "5.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa579c7cea32030600994d579554b257e10d5ad87705f3d150b49ee08bd629d" dependencies = [ "Inflector", "async-graphql-parser", @@ -140,16 +124,15 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "strum", - "syn 2.0.49", + "syn", "thiserror", ] [[package]] name = "async-graphql-parser" -version = "6.0.11" +version = "5.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6139181845757fd6a73fbb8839f3d036d7150b798db0e9bb3c6e83cdd65bd53b" +checksum = "3b67a5bea60997ca72908854655ae87f7970dc7d786d9a42fd1d17069fa42ebc" dependencies = [ "async-graphql-value", "pest", @@ -159,9 +142,9 @@ dependencies = [ [[package]] name = "async-graphql-value" -version = "6.0.11" +version = "5.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "323a5143f5bdd2030f45e3f2e0c821c9b1d36e79cf382129c64299c50a7f3750" +checksum = "79c2721eb88245ca055e148a3f03cb11a88535c206ac5a7c59e9edb22816320a" dependencies = [ "bytes", "indexmap", @@ -171,35 +154,34 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" dependencies = [ "async-stream-impl", "futures-core", - "pin-project-lite", ] [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] [[package]] @@ -210,23 +192,13 @@ checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" [[package]] name = "atoi" -version = "2.0.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" dependencies = [ "num-traits", ] -[[package]] -name = "atomic-write-file" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" -dependencies = [ - "nix", - "rand", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -235,15 +207,17 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.6.20" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "08b108ad2665fa3f6e6a517c3d80ec3e77d224c47d605167aefaa5d7ef97fa48" dependencies = [ "async-trait", "axum-core", - "bitflags 1.3.2", + "base64", + "bitflags", "bytes", "futures-util", + "headers", "http", "http-body", "hyper", @@ -258,18 +232,21 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", + "sha-1", "sync_wrapper", "tokio", + "tokio-tungstenite 0.17.2", "tower", + "tower-http", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.3.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "79b8558f5a0581152dc94dcd289132a1d377494bdeafcd41869b3258e3e2ad92" dependencies = [ "async-trait", "bytes", @@ -282,92 +259,62 @@ 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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" -dependencies = [ - "serde", -] - [[package]] name = "block-buffer" -version = "0.10.4" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ "generic-array", ] [[package]] -name = "bumpalo" -version = "3.15.0" +name = "bstr" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "memchr", +] + +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "byteorder" -version = "1.5.0" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.5.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" dependencies = [ "serde", ] [[package]] name = "cc" -version = "1.0.83" +version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" [[package]] name = "cfg-if" @@ -377,29 +324,59 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ - "android-tzdata", "iana-time-zone", - "js-sys", + "num-integer", "num-traits", - "wasm-bindgen", - "windows-targets 0.52.0", + "winapi", ] [[package]] -name = "const-oid" -version = "0.9.6" +name = "codegen" +version = "0.1.0" +dependencies = [ + "futures", + "lazy_static", + "regex", + "reqwest", + "serde", + "serde_json", + "tera", + "tokio", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", + "tokio-util", +] [[package]] name = "core-foundation" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -407,48 +384,52 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.0.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.4.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" [[package]] name = "crossbeam-queue" -version = "0.3.11" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" dependencies = [ + "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if", +] [[package]] name = "crypto-common" @@ -461,10 +442,54 @@ dependencies = [ ] [[package]] -name = "darling" -version = "0.20.6" +name = "cxx" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955" +checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" dependencies = [ "darling_core", "darling_macro", @@ -472,109 +497,81 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.6" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.49", + "syn", ] [[package]] name = "darling_macro" -version = "0.20.6" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" dependencies = [ "darling_core", "quote", - "syn 2.0.49", -] - -[[package]] -name = "data-encoding" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" - -[[package]] -name = "der" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", + "syn", ] [[package]] name = "digest" -version = "0.10.7" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ "block-buffer", - "const-oid", "crypto-common", "subtle", ] [[package]] -name = "dotenvy" -version = "0.15.7" +name = "dirs" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +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 = "dotenvy" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" [[package]] name = "either" -version = "1.10.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" -dependencies = [ - "serde", -] +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ "cfg-if", ] -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "etcetera" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" -dependencies = [ - "cfg-if", - "home", - "windows-sys 0.48.0", -] - [[package]] name = "event-listener" version = "2.5.3" @@ -592,25 +589,11 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "1.8.0" 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.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ - "futures-core", - "futures-sink", - "spin 0.9.8", + "instant", ] [[package]] @@ -636,18 +619,18 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ "percent-encoding", ] [[package]] name = "futures" -version = "0.3.30" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -660,9 +643,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -670,15 +653,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -687,49 +670,49 @@ dependencies = [ [[package]] name = "futures-intrusive" -version = "0.5.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" dependencies = [ "futures-core", "lock_api", - "parking_lot", + "parking_lot 0.11.2", ] [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-channel", "futures-core", @@ -745,9 +728,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.7" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -755,9 +738,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", @@ -765,16 +748,34 @@ dependencies = [ ] [[package]] -name = "gimli" -version = "0.28.1" +name = "globset" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "globwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +dependencies = [ + "bitflags", + "ignore", + "walkdir", +] [[package]] name = "h2" -version = "0.3.24" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ "bytes", "fnv", @@ -789,53 +790,66 @@ dependencies = [ "tracing", ] -[[package]] -name = "handlebars" -version = "4.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" -dependencies = [ - "log", - "pest", - "pest_derive", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash", - "allocator-api2", ] [[package]] name = "hashlink" -version = "0.8.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" dependencies = [ "hashbrown", ] [[package]] -name = "heck" -version = "0.4.1" +name = "headers" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +dependencies = [ + "base64", + "bitflags", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] [[package]] name = "hex" @@ -845,9 +859,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" -version = "0.12.4" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" dependencies = [ "hmac", ] @@ -861,20 +875,11 @@ dependencies = [ "digest", ] -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "http" -version = "0.2.11" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", @@ -883,9 +888,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", @@ -894,9 +899,9 @@ dependencies = [ [[package]] name = "http-range-header" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" [[package]] name = "httparse" @@ -906,15 +911,15 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" dependencies = [ "bytes", "futures-channel", @@ -934,20 +939,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - [[package]] name = "hyper-tls" version = "0.5.0" @@ -963,25 +954,26 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "winapi", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" dependencies = [ - "cc", + "cxx", + "cxx-build", ] [[package]] @@ -992,51 +984,78 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ "unicode-bidi", "unicode-normalization", ] [[package]] -name = "indexmap" -version = "2.2.3" +name = "ignore" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" dependencies = [ - "equivalent", + "crossbeam-utils", + "globset", + "lazy_static", + "log", + "memchr", + "regex", + "same-file", + "thread_local", + "walkdir", + "winapi-util", +] + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", "hashbrown", "serde", ] [[package]] -name = "ipnet" -version = "2.9.0" +name = "instant" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" [[package]] name = "itertools" -version = "0.12.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -1046,44 +1065,27 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin 0.5.2", -] [[package]] name = "libc" -version = "0.2.153" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] -name = "libm" -version = "0.2.8" +name = "link-cplusplus" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libsqlite3-sys" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" dependencies = [ "cc", - "pkg-config", - "vcpkg", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -1091,37 +1093,39 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] [[package]] name = "matchit" -version = "0.7.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" [[package]] name = "md-5" -version = "0.10.6" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "cfg-if", "digest", ] [[package]] name = "memchr" -version = "2.7.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mime" -version = "0.3.17" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "minimal-lexical" @@ -1129,31 +1133,23 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" -dependencies = [ - "adler", -] - [[package]] name = "mio" -version = "0.8.10" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", + "log", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.42.0", ] [[package]] name = "multer" -version = "2.1.0" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" +checksum = "6ed4198ce7a4cbd2a57af78d28c6fbb57d81ac5f1d6ad79ac6c5587419cbdf22" dependencies = [ "bytes", "encoding_rs", @@ -1163,7 +1159,7 @@ dependencies = [ "log", "memchr", "mime", - "spin 0.9.8", + "spin", "version_check", ] @@ -1185,106 +1181,58 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nix" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" -dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "libc", -] - [[package]] name = "nom" -version = "7.1.3" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" dependencies = [ "memchr", "minimal-lexical", ] -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "smallvec", - "zeroize", -] - [[package]] name = "num-integer" -version = "0.1.46" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", - "num-integer", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", - "libm", ] [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ "hermit-abi", "libc", ] -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" -version = "1.19.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "openssl" -version = "0.10.63" +version = "0.10.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" dependencies = [ - "bitflags 2.4.2", + "bitflags", "cfg-if", "foreign-types", "libc", @@ -1295,13 +1243,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] [[package]] @@ -1311,25 +1259,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] -name = "openssl-src" -version = "300.2.3+3.2.1" +name = "openssl-sys" +version = "0.9.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cff92b6f71555b61bb9315f7c64da3ca43d87531622120fea0195fc761b4843" +checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" dependencies = [ + "autocfg", "cc", + "libc", + "pkg-config", + "vcpkg", ] [[package]] -name = "openssl-sys" -version = "0.9.99" +name = "parking_lot" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", + "instant", + "lock_api", + "parking_lot_core 0.8.5", ] [[package]] @@ -1339,59 +1289,63 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.4", ] [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-sys 0.42.0", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.7.7" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" +checksum = "5f400b0f7905bf702f9f3dc3df5a121b16c54e9e8012c082905fdf09a931861a" dependencies = [ - "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.7" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1288dbd7786462961e69bfd4df7848c1e37e8b74303dbdab82c3a9cdd2809" +checksum = "423c2ba011d6e27b02b482a3707c773d19aec65cc024637aec44e19652e66f63" dependencies = [ "pest", "pest_generator", @@ -1399,53 +1353,53 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.7" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1381c29a877c6d34b8c176e734f35d7f7f5b3adaefe940cb4d1bb7af94678e2e" +checksum = "3e64e6c2c85031c02fdbd9e5c72845445ca0a724d419aa0bc068ac620c9935c1" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] [[package]] name = "pest_meta" -version = "2.7.7" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0934d6907f148c22a3acbda520c7eed243ad7487a30f51f6ce52b58b7077a8a" +checksum = "57959b91f0a133f89a68be874a5c88ed689c19cd729ecdb5d762ebf16c64d662" dependencies = [ "once_cell", "pest", - "sha2", + "sha1", ] [[package]] name = "pin-project" -version = "1.1.4" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1453,32 +1407,11 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkcs1" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" -dependencies = [ - "der", - "pkcs8", - "spki", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "ppv-lite86" @@ -1488,65 +1421,44 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ "once_cell", - "toml_edit", + "thiserror", + "toml", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] -[[package]] -name = "prometheus" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" -dependencies = [ - "cfg-if", - "fnv", - "lazy_static", - "memchr", - "parking_lot", - "protobuf", - "thiserror", -] - -[[package]] -name = "prometheus-static-metric" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f30cdb09c39930b8fa5e0f23cbb895ab3f766b187403a0ba0956fc1ef4f0e5" -dependencies = [ - "lazy_static", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "protobuf" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" - [[package]] name = "quote" -version = "1.0.35" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] +[[package]] +name = "r2d2" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93" +dependencies = [ + "log", + "parking_lot 0.12.1", + "scheduled-thread-pool", +] + [[package]] name = "rand" version = "0.8.5" @@ -1578,31 +1490,51 @@ dependencies = [ ] [[package]] -name = "redox_syscall" -version = "0.4.1" +name = "redis" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "513b3649f1a111c17954296e4a3b9eecb108b766c803e2b99f179ebe27005985" dependencies = [ - "bitflags 1.3.2", + "async-trait", + "bytes", + "combine", + "futures-util", + "itoa", + "percent-encoding", + "pin-project-lite", + "r2d2", + "ryu", + "sha1_smol", + "tokio", + "tokio-util", + "url", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", @@ -1611,17 +1543,26 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +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", +] [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" dependencies = [ - "base64 0.21.7", + "base64", "bytes", "encoding_rs", "futures-core", @@ -1630,7 +1571,6 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -1640,154 +1580,78 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", - "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", "winreg", ] -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin 0.9.8", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rsa" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" -dependencies = [ - "const-oid", - "digest", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core", - "signature", - "spki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustix" -version = "0.38.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" -dependencies = [ - "bitflags 2.4.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ - "windows-sys 0.52.0", + "lazy_static", + "windows-sys 0.36.1", +] + +[[package]] +name = "scheduled-thread-pool" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "977a7519bff143a44f842fd07e80ad1329295bd71686457f18e496736f4bf9bf" +dependencies = [ + "parking_lot 0.12.1", ] [[package]] name = "scopeguard" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "sct" -version = "0.7.1" +name = "scratch" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" [[package]] name = "security-framework" -version = "2.9.2" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ - "bitflags 1.3.2", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -1796,9 +1660,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys", "libc", @@ -1806,18 +1670,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.196" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" dependencies = [ "serde_derive", ] [[package]] name = "serde-aux" -version = "4.4.0" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a86348501c129f3ad50c2f4635a01971f76974cd8a3f335988a0f1581c082765" +checksum = "c599b3fd89a75e0c18d6d2be693ddb12cccaf771db4ff9e39097104808a014c0" dependencies = [ "chrono", "serde", @@ -1826,20 +1690,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" dependencies = [ "itoa", "ryu", @@ -1848,11 +1712,10 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.15" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +checksum = "184c643044780f7ceb59104cef98a5a6f12cb2288a7bc701ab93a362b49fd47d" dependencies = [ - "itoa", "serde", ] @@ -1869,21 +1732,38 @@ dependencies = [ ] [[package]] -name = "sha1" -version = "0.10.6" +name = "sha-1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ "cfg-if", "cpufeatures", "digest", ] +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", @@ -1891,70 +1771,50 @@ dependencies = [ ] [[package]] -name = "signature" -version = "2.2.0" +name = "signal-hook-registry" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ - "digest", - "rand_core", + "libc", ] [[package]] name = "slab" -version = "0.4.9" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.13.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.5.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", - "windows-sys 0.48.0", + "winapi", ] [[package]] name = "spin" -version = "0.5.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] +checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" [[package]] name = "sqlformat" -version = "0.2.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +checksum = "f87e292b4291f154971a43c3774364e2cbcaec599d3f5bf6fa9d122885dbc38a" dependencies = [ "itertools", "nom", @@ -1963,206 +1823,93 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" +checksum = "9249290c05928352f71c077cc44a464d880c63f26f7534728cca008e135c0428" dependencies = [ "sqlx-core", "sqlx-macros", - "sqlx-mysql", - "sqlx-postgres", - "sqlx-sqlite", ] [[package]] name = "sqlx-core" -version = "0.7.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" +checksum = "dcbc16ddba161afc99e14d1713a453747a2b07fc097d2009f4c300ec99286105" dependencies = [ "ahash", "atoi", + "base64", + "bitflags", "byteorder", "bytes", - "chrono", "crc", "crossbeam-queue", + "dirs", "dotenvy", "either", "event-listener", "futures-channel", "futures-core", "futures-intrusive", - "futures-io", "futures-util", "hashlink", "hex", + "hkdf", + "hmac", "indexmap", + "itoa", + "libc", "log", + "md-5", "memchr", "once_cell", "paste", "percent-encoding", - "rustls", - "rustls-pemfile", + "rand", "serde", "serde_json", + "sha1", "sha2", "smallvec", "sqlformat", + "sqlx-rt", + "stringprep", "thiserror", - "tokio", "tokio-stream", - "tracing", "url", - "webpki-roots", + "whoami", ] [[package]] name = "sqlx-macros" -version = "0.7.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" +checksum = "b850fa514dc11f2ee85be9d055c512aa866746adfacd1cb42d867d68e6a5b0d9" dependencies = [ - "proc-macro2", - "quote", - "sqlx-core", - "sqlx-macros-core", - "syn 1.0.109", -] - -[[package]] -name = "sqlx-macros-core" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" -dependencies = [ - "atomic-write-file", "dotenvy", "either", "heck", - "hex", "once_cell", "proc-macro2", "quote", - "serde", - "serde_json", "sha2", "sqlx-core", - "sqlx-mysql", - "sqlx-postgres", - "sqlx-sqlite", - "syn 1.0.109", - "tempfile", + "sqlx-rt", + "syn", + "url", +] + +[[package]] +name = "sqlx-rt" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24c5b2d25fa654cc5f841750b8e1cdedbe21189bf9a9382ee90bfa9dd3562396" +dependencies = [ + "native-tls", + "once_cell", "tokio", - "url", -] - -[[package]] -name = "sqlx-mysql" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" -dependencies = [ - "atoi", - "base64 0.21.7", - "bitflags 2.4.2", - "byteorder", - "bytes", - "chrono", - "crc", - "digest", - "dotenvy", - "either", - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "generic-array", - "hex", - "hkdf", - "hmac", - "itoa", - "log", - "md-5", - "memchr", - "once_cell", - "percent-encoding", - "rand", - "rsa", - "serde", - "sha1", - "sha2", - "smallvec", - "sqlx-core", - "stringprep", - "thiserror", - "tracing", - "whoami", -] - -[[package]] -name = "sqlx-postgres" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" -dependencies = [ - "atoi", - "base64 0.21.7", - "bitflags 2.4.2", - "byteorder", - "chrono", - "crc", - "dotenvy", - "etcetera", - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "hex", - "hkdf", - "hmac", - "home", - "itoa", - "log", - "md-5", - "memchr", - "once_cell", - "rand", - "serde", - "serde_json", - "sha1", - "sha2", - "smallvec", - "sqlx-core", - "stringprep", - "thiserror", - "tracing", - "whoami", -] - -[[package]] -name = "sqlx-sqlite" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" -dependencies = [ - "atoi", - "chrono", - "flume", - "futures-channel", - "futures-core", - "futures-executor", - "futures-intrusive", - "futures-util", - "libsqlite3-sys", - "log", - "percent-encoding", - "serde", - "sqlx-core", - "tracing", - "url", - "urlencoding", + "tokio-native-tls", ] [[package]] @@ -2173,11 +1920,10 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stringprep" -version = "0.1.4" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", ] @@ -2188,50 +1934,17 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.49", -] - [[package]] name = "subtle" -version = "2.5.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.109" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.49" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" dependencies = [ "proc-macro2", "quote", @@ -2240,71 +1953,89 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "0.1.1" 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", -] +checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" [[package]] name = "tasks" version = "0.1.0" dependencies = [ "async_once", + "dotenvy", "lazy_static", + "once_cell", + "redis", "sqlx", "tokio", ] [[package]] name = "tempfile" -version = "3.10.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if", "fastrand", - "rustix", - "windows-sys 0.52.0", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "tera" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df578c295f9ec044ff1c829daf31bb7581d5b3c2a7a3d87419afe1f2531438c" +dependencies = [ + "globwalk", + "lazy_static", + "pest", + "pest_derive", + "regex", + "serde", + "serde_json", + "unic-segment", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", ] [[package]] @@ -2318,63 +2049,56 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.36.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" dependencies = [ - "backtrace", + "autocfg", "bytes", "libc", + "memchr", "mio", "num_cpus", + "parking_lot 0.12.1", "pin-project-lite", + "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.42.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] [[package]] name = "tokio-native-tls" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", "pin-project-lite", @@ -2383,27 +2107,39 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.20.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" dependencies = [ "futures-util", "log", - "rustls", "tokio", - "tokio-rustls", - "tungstenite", - "webpki-roots", + "tungstenite 0.17.3", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" +dependencies = [ + "futures-util", + "log", + "native-tls", + "tokio", + "tokio-native-tls", + "tungstenite 0.18.0", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -2411,20 +2147,12 @@ dependencies = [ ] [[package]] -name = "toml_datetime" -version = "0.6.5" +name = "toml" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ - "indexmap", - "toml_datetime", - "winnow", + "serde", ] [[package]] @@ -2445,11 +2173,11 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" dependencies = [ - "bitflags 2.4.2", + "bitflags", "bytes", "futures-core", "futures-util", @@ -2457,6 +2185,7 @@ dependencies = [ "http-body", "http-range-header", "pin-project-lite", + "tower", "tower-layer", "tower-service", ] @@ -2475,56 +2204,64 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ + "cfg-if", "log", "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.49", -] - [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", ] [[package]] name = "try-lock" -version = "0.2.5" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "tungstenite" -version = "0.20.1" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ + "base64", "byteorder", "bytes", - "data-encoding", "http", "httparse", "log", "rand", - "rustls", + "sha-1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +dependencies = [ + "base64", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "native-tls", + "rand", "sha1", "thiserror", "url", @@ -2533,27 +2270,77 @@ dependencies = [ [[package]] name = "typenum" -version = "1.17.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-segment" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ed5d26be57f84f176157270c112ef57b86debac9cd21daaabbe56db0f88f23" +dependencies = [ + "unic-ucd-segment", +] + +[[package]] +name = "unic-ucd-segment" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2079c122a62205b421f499da10f3ee0f7697f012f55b675e002483c73ea34700" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-normalization" @@ -2566,9 +2353,15 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode_categories" @@ -2576,29 +2369,17 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - [[package]] name = "url" -version = "2.5.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - [[package]] name = "utf-8" version = "0.7.6" @@ -2618,11 +2399,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "want" -version = "0.3.1" +name = "walkdir" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", "try-lock", ] @@ -2634,9 +2427,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2644,24 +2437,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.49", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if", "js-sys", @@ -2671,9 +2464,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2681,39 +2474,33 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "websocket" version = "0.1.0" @@ -2723,205 +2510,163 @@ dependencies = [ "futures", "futures-util", "lazy_static", - "prometheus", - "prometheus-static-metric", + "redis", "serde", "serde-aux", "serde_json", "sqlx", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.18.0", "url", ] [[package]] name = "whoami" -version = "1.4.1" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "d6631b6a2fd59b1841b622e8f1a7ad241ef0a46f2d580464ce8140ac94cbd571" +dependencies = [ + "bumpalo", + "wasm-bindgen", + "web-sys", +] [[package]] -name = "windows-core" -version = "0.52.0" +name = "winapi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "windows-targets 0.52.0", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +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", ] [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.0", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" -dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "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", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" [[package]] name = "winreg" -version = "0.50.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "winapi", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.49", -] - -[[package]] -name = "zeroize" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml index 49091a0..b180b7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] -members = ["services/*"] -exclude = ["hack/codegen"] -resolver = "2" +members = [ + "services/*", + "hack/*" +] \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a5397a3..4710ed4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,18 @@ -FROM rust:1.76.0-bullseye as rust-base +FROM rust:1.65.0-bullseye AS builder +ARG SERVICE + WORKDIR /app -RUN apt-get update && apt-get install -y --no-install-recommends curl clang -ARG MOLD_VERSION=1.11.0 -RUN curl -sSL https://github.com/rui314/mold/releases/download/v${MOLD_VERSION}/mold-${MOLD_VERSION}-x86_64-linux.tar.gz | tar xzv && \ - mv mold-${MOLD_VERSION}-x86_64-linux/bin/mold /mold && \ - rm -rf mold-${MOLD_VERSION}-x86_64-linux -ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang -ENV RUSTFLAGS="-C link-arg=-fuse-ld=/mold" +COPY Cargo.toml Cargo.lock ./ +COPY services ./services +COPY hack ./hack -FROM rust-base as builder -COPY . . -ARG SERVICE -ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang -ENV RUSTFLAGS="-C link-arg=-fuse-ld=/mold" -RUN cargo build --release --bin ${SERVICE} +RUN cargo build --bin ${SERVICE} --release -FROM debian:bullseye-slim as runtime + +FROM debian:bullseye-slim AS target ARG SERVICE +RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* COPY --from=builder /app/target/release/${SERVICE} /app -ENTRYPOINT ["/app"] \ No newline at end of file + +RUN chmod a+x /app +CMD /app diff --git a/README.md b/README.md index af7c6c1..beeaff9 100644 --- a/README.md +++ b/README.md @@ -2,35 +2,33 @@ PlanetSide 2 live population API. This API is free and open for anyone to use. -https://saerro.ps2.live +https://saerro.harasse.rs -tl;dr: Watch for specific events, transform and add them to a timeseries set, and query that set for the last 15 minutes. - -We're built on 3 core types, `players`, `classes`, and `vehicles`. Each can be filtered by Continent/Zone, Faction, and World. +Our methodology is to add any player ID seen on the Census websockets to a time-sorted set, and returning the number of player IDs seen within 15 minutes. --- +The one and only goal of this app is to provide a current "point-in-time" population status for PlanetSide 2, per world, per faction, (and later, per continent.) Historical info is _not_ a goal; you may implement this on your end. + Please open an issue here or get in touch with Pomf (okano#0001) on the PS2 Discord if you have complex use cases for this data; it may be trivial/easy to implement APIs tailored to your needs. The main use case is for [Medkit](https://github.com/kayteh/medkit2) bot to have an in-house source of population data, without relying too heavily on any third-party stats service, like Fisu, Honu, or Voidwell; which all have different population tracking needs and goals (and thus, different data.) -An example of how it can be used on [pstop](https://pstop.harasse.rs) ([GitHub](https://github.com/genudine/pstop)). - ## Architecture -- GraphQL API - - Serves https://saerro.ps2.live - - Built on a "stacking filter" graph model, where each dimension adds a filter to lower dimensions. -- Event Streaming Service (ESS) Ingest - - WebSocket listening to https://push.nanite-systems.net (which is a resilient mirror to https://push.planetside2.com) - - Listens for `Death`, `VehicleDestroy`, and a number of `GainExperience` events. -- Postgres with TimescaleDB - - Holds `players` and `analytics` tables as hypertables. - - Timescale makes this way too fast, mind-blowing :) -- Tasks - - Occasional jobs that prune the database past what we actually want to retain, - - Core data tables are kept to about 20 mins max of data, analytics to 1 week - - Can do database resets/migrations. +- Websocket processors + - A pair per PC, PS4US, PS4EU + - Connects to [wss://push.nanite-systems.net](https://nanite-systems.net) and Census Websocket + - Primary will connect to NS. + - Backup will connect to Census. It will wait for 60 seconds before deciding the primary is dead, and then start processing events. +- API + - Serves https://saerro.harasse.rs + - Built on axum and async-graphql +- Redis + - Using ZADD with score as timestamp, ZCOUNTBYSCORE by timestamp in 15 minute windows, and cleaned up with SCAN+ZREMBYSCORE, population data is tracked. + - There is deliberately no persistence. +- Redis "Tender" + - Cleans up Redis every 5 mins. # Developing @@ -39,27 +37,48 @@ This app is built with Rust. You can set up a build environment via https://rust To run, ```sh -# Start backing services +# Start Redis/backing services docker compose up -d -# Run database migrations (required first step on a freshly up'd database) -cargo run --bin tasks migrate - -# Start NSS ingest. Use push.planetside2.com if NSS isn't quite working... +# Start Websocket for PC env \ - WS_ADDR="wss://push.nanite-systems.net/streaming?environment=all&service-id=s:$SERVICE_ID" \ - WORLDS=all \ + WS_ADDR="wss://push.planetside2.com/streaming?environment=ps2&service-id=s:$SERVICE_ID" \ + PAIR=pc \ + ROLE=primary \ + WORLDS=1,10,13,17,19,40 \ + cargo run --bin websocket + +# (Optional:) Start redundant websocket for PC +env \ + WS_ADDR="wss://push.planetside2.com/streaming?environment=ps2&service-id=s:$SERVICE_ID" \ + PAIR=pc \ + ROLE=backup \ + WORLDS=1,10,13,17,19,40 \ + cargo run --bin websocket + +# (Optional:) Start PS4US websocket +env \ + WS_ADDR="wss://push.planetside2.com/streaming?environment=ps2ps4us&service-id=s:$SERVICE_ID" \ + PAIR=ps4us \ + WORLDS=1000 \ + cargo run --bin websocket + +# (Optional:) Start PS4EU websocket +env \ + WS_ADDR="wss://push.planetside2.com/streaming?environment=ps2ps4eu&service-id=s:$SERVICE_ID" \ + PAIR=ps4eu \ + WORLDS=2000 \ cargo run --bin websocket # Start API cargo run --bin api # Run prune tool -cargo run --bin tasks prune +cargo run --bin tools prune # Build containers docker build . --build-arg SERVICE=api -t saerro:api -docker build . --build-arg SERVICE=tasks -t saerro:tasks +docker build . --build-arg SERVICE=tools -t saerro:tools docker build . --build-arg SERVICE=websocket -t saerro:websocket ``` @@ -75,4 +94,4 @@ Currently, the entire stack runs on Docker. You may deploy it to any server via: docker compose up -d -f docker-compose.live.yaml ``` -It listens on port 80, it's up to you from here. Make sure to change passwords present in the file. It's not _that secret_ of data, but why risk it? +It listens on port 80, it's up to you from here. diff --git a/docker-compose.live.yaml b/docker-compose.live.yaml index a3e9dfd..fa2d310 100644 --- a/docker-compose.live.yaml +++ b/docker-compose.live.yaml @@ -16,7 +16,7 @@ services: image: ghcr.io/genudine/saerro/api:latest pull_policy: always ports: - - 80:8000 + - 8000:80 links: - tsdb restart: always diff --git a/docker-compose.yaml b/docker-compose.yaml index e88dfb1..6d53195 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,7 @@ version: "3" services: tsdb: - image: docker.io/timescale/timescaledb:latest-pg14 + image: timescale/timescaledb-ha:pg14-latest environment: POSTGRES_PASSWORD: saerro321 POSTGRES_USER: saerrouser diff --git a/flake.lock b/flake.lock deleted file mode 100644 index fdcaef8..0000000 --- a/flake.lock +++ /dev/null @@ -1,103 +0,0 @@ -{ - "nodes": { - "fenix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1708150887, - "narHash": "sha256-lyEaeShLZqQtFO+ULLfxF9fYaYpTal0Ck1B+iKYBOMs=", - "owner": "nix-community", - "repo": "fenix", - "rev": "761431323e30846bae160e15682cfa687c200606", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1706830856, - "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1707956935, - "narHash": "sha256-ZL2TrjVsiFNKOYwYQozpbvQSwvtV/3Me7Zwhmdsfyu4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a4d4fe8c5002202493e87ec8dbc91335ff55552c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "dir": "lib", - "lastModified": 1706550542, - "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", - "type": "github" - }, - "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "fenix": "fenix", - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" - } - }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1708018577, - "narHash": "sha256-B75VUqKvQeIqAUnYw4bGjY3xxrCqzRBJHLbmD0MAWEw=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "b9b0d29b8e69b02457cfabe20c4c69cdb45f3cc5", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index ad5728a..0000000 --- a/flake.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ - description = "PlanetSide 2 Metagame Harvesting Service"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - flake-parts.url = "github:hercules-ci/flake-parts"; - fenix = { - url = "github:nix-community/fenix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - nixConfig = { - extra-substituters = [ - "https://nix-community.cachix.org" - ]; - - extra-trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; - - outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } { - systems = [ "x86_64-linux" "aarch64-linux" ]; - perSystem = { config, self', pkgs, lib, system, ... }: let - fenix = inputs.fenix.packages.${system}.minimal; - cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); - - buildDeps = [ - pkgs.openssl - ]; - - devDeps = [ - fenix.toolchain - pkgs.docker-compose - pkgs.cargo-watch - ]; - PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; - in { - packages.default = (pkgs.makeRustPlatform { - cargo = fenix.toolchain; - rustc = fenix.toolchain; - }).buildRustPackage { - inherit (cargoToml.package) name version; - cargoLock.lockFile = ./Cargo.lock; - src = ./.; - nativeBuildInputs = [ pkgs.pkg-config ]; - buildInputs = buildDeps ++ devDeps; - }; - - devShells.default = pkgs.mkShell { - nativeBuildInputs = buildDeps ++ devDeps; - }; - }; - }; -} \ No newline at end of file diff --git a/hack/codegen/.gitignore b/hack/codegen/.gitignore deleted file mode 100644 index 1de5659..0000000 --- a/hack/codegen/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target \ No newline at end of file diff --git a/hack/codegen/Cargo.lock b/hack/codegen/Cargo.lock deleted file mode 100644 index c3ec357..0000000 --- a/hack/codegen/Cargo.lock +++ /dev/null @@ -1,1411 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "memchr", -] - -[[package]] -name = "bumpalo" -version = "3.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" - -[[package]] -name = "bytes" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" - -[[package]] -name = "cc" -version = "1.0.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "codegen" -version = "0.1.0" -dependencies = [ - "lazy_static", - "regex", - "reqwest", - "serde", - "serde_json", - "tera", - "tokio", -] - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "encoding_rs" -version = "0.8.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures-channel" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" - -[[package]] -name = "futures-sink" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" - -[[package]] -name = "futures-task" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" - -[[package]] -name = "futures-util" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" -dependencies = [ - "futures-core", - "futures-task", - "pin-project-lite", - "pin-utils", -] - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "globset" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" -dependencies = [ - "aho-corasick", - "bstr", - "fnv", - "log", - "regex", -] - -[[package]] -name = "globwalk" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" -dependencies = [ - "bitflags", - "ignore", - "walkdir", -] - -[[package]] -name = "h2" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "http" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" - -[[package]] -name = "hyper" -version = "0.14.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "ignore" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" -dependencies = [ - "crossbeam-utils", - "globset", - "lazy_static", - "log", - "memchr", - "regex", - "same-file", - "thread_local", - "walkdir", - "winapi-util", -] - -[[package]] -name = "indexmap" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "ipnet" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" - -[[package]] -name = "itoa" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" - -[[package]] -name = "js-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.138" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" - -[[package]] -name = "lock_api" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "mime" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" - -[[package]] -name = "mio" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.42.0", -] - -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "num_cpus" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" - -[[package]] -name = "openssl" -version = "0.10.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-sys 0.42.0", -] - -[[package]] -name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - -[[package]] -name = "pest" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc8bed3549e0f9b0a2a78bf7c0018237a2cdf085eecbbc048e52612438e4e9d0" -dependencies = [ - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc078600d06ff90d4ed238f0119d84ab5d43dbaad278b0e33a8820293b32344" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a1af60b1c4148bb269006a750cff8e2ea36aff34d2d96cf7be0b14d1bed23c" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pest_meta" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec8605d59fc2ae0c6c1aefc0c7c7a9769732017c0ce07f7a9cfffa7b4404f20" -dependencies = [ - "once_cell", - "pest", - "sha1", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - -[[package]] -name = "proc-macro2" -version = "1.0.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.28" -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", -] - -[[package]] -name = "reqwest" -version = "0.11.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - -[[package]] -name = "ryu" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" -dependencies = [ - "lazy_static", - "windows-sys 0.36.1", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "security-framework" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "serde" -version = "1.0.150" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.150" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" -dependencies = [ - "libc", -] - -[[package]] -name = "slab" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "socket2" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "syn" -version = "1.0.105" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - -[[package]] -name = "tera" -version = "1.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df578c295f9ec044ff1c829daf31bb7581d5b3c2a7a3d87419afe1f2531438c" -dependencies = [ - "globwalk", - "lazy_static", - "pest", - "pest_derive", - "regex", - "serde", - "serde_json", - "unic-segment", -] - -[[package]] -name = "thiserror" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "tokio" -version = "1.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" -dependencies = [ - "autocfg", - "bytes", - "libc", - "memchr", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.42.0", -] - -[[package]] -name = "tokio-macros" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "ucd-trie" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" - -[[package]] -name = "unic-char-property" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" -dependencies = [ - "unic-char-range", -] - -[[package]] -name = "unic-char-range" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" - -[[package]] -name = "unic-common" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" - -[[package]] -name = "unic-segment" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ed5d26be57f84f176157270c112ef57b86debac9cd21daaabbe56db0f88f23" -dependencies = [ - "unic-ucd-segment", -] - -[[package]] -name = "unic-ucd-segment" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2079c122a62205b421f499da10f3ee0f7697f012f55b675e002483c73ea34700" -dependencies = [ - "unic-char-property", - "unic-char-range", - "unic-ucd-version", -] - -[[package]] -name = "unic-ucd-version" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" -dependencies = [ - "unic-common", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" - -[[package]] -name = "unicode-ident" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "url" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -dependencies = [ - "log", - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" - -[[package]] -name = "web-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -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", -] - -[[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 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", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" - -[[package]] -name = "winreg" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] diff --git a/hack/codegen/Cargo.toml b/hack/codegen/Cargo.toml index 9abb83a..450f2e5 100644 --- a/hack/codegen/Cargo.toml +++ b/hack/codegen/Cargo.toml @@ -8,6 +8,7 @@ reqwest = { version="0.11.13", features = ["json"] } tera = { version = "1.17.1", default-features = false } lazy_static = "1.4.0" regex = "1.7.0" +futures = "0.3.25" tokio = { version = "1.22.0", features = ["full"] } serde = { version = "1.0.147", features = ["derive"] } serde_json = "1.0.89" \ No newline at end of file diff --git a/hack/codegen/src/main.rs b/hack/codegen/src/main.rs index 390f0d1..012931c 100644 --- a/hack/codegen/src/main.rs +++ b/hack/codegen/src/main.rs @@ -1,4 +1,5 @@ use std::process; + use lazy_static::lazy_static; use regex::{Regex, RegexBuilder}; use serde::{Deserialize, Serialize}; @@ -45,9 +46,6 @@ async fn translators_rs() { "mosquito", "galaxy", "valkyrie", - "wasp", - "deliverer", - "lodestar", "liberator", "ant", "harasser", @@ -109,16 +107,11 @@ async fn translators_rs() { .find(&item.name.as_ref().unwrap().en.as_ref().unwrap()) .unwrap(); - let name = matched - .as_str() - .to_lowercase() - .replace("wasp", "valkyrie") - .replace("deliverer", "ant") - .replace("lodestar", "galaxy"); - Vehicle { vehicle_id: item.vehicle_id, - name: Some(LangEn { en: Some(name) }), + name: Some(LangEn { + en: Some(matched.as_str().to_string().to_lowercase()), + }), propulsion_type: item.propulsion_type, } }) diff --git a/services/api/Cargo.toml b/services/api/Cargo.toml index a5ae404..08997d5 100644 --- a/services/api/Cargo.toml +++ b/services/api/Cargo.toml @@ -6,25 +6,13 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -serde_json = "1.0.105" -serde = "1.0.188" -async-graphql = { version = "6.0.5", features = ["chrono"] } -axum = "0.6.20" -sqlx = { version = "0.7.1", default_features = false, features = [ - "runtime-tokio-rustls", - "postgres", - "chrono", -] } -tokio = { version = "1.28.1", features = ["macros", "rt-multi-thread"] } -tower-http = { version = "0.4.4", features = ["cors"] } +serde_json = "1.0.89" +serde = "1.0.149" +async-graphql = { version = "5.0.3" } +async-graphql-axum = "5.0.3" +axum = "0.6.1" +sqlx = { version = "0.6.2", features = [ "runtime-tokio-native-tls", "postgres" ] } +tokio = { version = "1.23.0", features = [ "full" ] } +tower-http = { version = "0.3.5", features = ["cors"] } lazy_static = "1.4.0" -reqwest = { version = "0.11.20", features = [ - "rustls-tls-webpki-roots", - "rustls", -] } -chrono = "0.4.28" -prometheus = "0.13.3" - -[dependencies.openssl] -version = "0.10.57" -features = ["vendored"] +reqwest = "0.11.13" \ No newline at end of file diff --git a/services/api/src/analytics.rs b/services/api/src/analytics.rs deleted file mode 100644 index 859fbd5..0000000 --- a/services/api/src/analytics.rs +++ /dev/null @@ -1,86 +0,0 @@ -use async_graphql::{futures_util::TryStreamExt, Context, Object, SimpleObject}; -use chrono::{DateTime, Utc}; -use sqlx::{query, Pool, Postgres, Row}; -use crate::telemetry; - -pub struct Analytics {} - -#[derive(SimpleObject, Debug, Clone)] -pub struct Event { - pub time: DateTime, - pub event_name: String, - pub world_id: i32, - pub count: i64, -} - -#[Object] -impl Analytics { - /// Get all events in analytics, bucket_size is in seconds - async fn events<'ctx>( - &self, - ctx: &Context<'ctx>, - #[graphql(default = 60)] bucket_size: u64, - world_id: Option, - #[graphql(default = false)] hi_precision: bool, - ) -> Vec { - telemetry::graphql_query("Analytics", "events"); - let pool = ctx.data::>().unwrap(); - - telemetry::db_read("analytics", "events"); - let sql = format!(" - SELECT - time_bucket_gapfill('{} seconds', time, start => now() - '{}'::interval, finish => now()) AS bucket, - CASE WHEN count(*) IS NULL THEN 0 ELSE count(*) END AS count, - event_name, - world_id - FROM analytics - WHERE time > now() - '{}'::interval {} - GROUP BY bucket, world_id, event_name - ORDER BY bucket ASC", - if hi_precision { - 5 - } else { - bucket_size - }, - if hi_precision { - "1 hour" - } else { - "1 day" - }, - if hi_precision { - "1 hour" - } else { - "1 day" - }, - if let Some(world_id) = world_id { - format!("AND world_id = {}", world_id) - } else { - "".to_string() - } - ); - - let mut result = query(sql.as_str()).fetch(pool); - - let mut events = Vec::new(); - while let Some(row) = result.try_next().await.unwrap() { - events.push(Event { - time: row.get("bucket"), - event_name: row.get("event_name"), - world_id: row.get("world_id"), - count: row.get("count"), - }); - } - - events - } -} - -#[derive(Default)] -pub struct AnalyticsQuery; - -#[Object] -impl AnalyticsQuery { - async fn analytics(&self) -> Analytics { - Analytics {} - } -} diff --git a/services/api/src/classes.rs b/services/api/src/classes.rs index 987e147..8629bfd 100644 --- a/services/api/src/classes.rs +++ b/services/api/src/classes.rs @@ -1,8 +1,4 @@ -use crate::{ - factions::{NC, TR, VS}, - utils::{Filters, IdOrNameBy}, - telemetry -}; +use crate::utils::{Filters, IdOrNameBy}; use async_graphql::{Context, Object}; use sqlx::{Pool, Postgres, Row}; @@ -14,11 +10,10 @@ pub struct Class { impl Class { async fn fetch<'ctx>(&self, ctx: &Context<'ctx>, filters: Filters) -> i64 { - telemetry::db_read("players", "fetch"); let pool = ctx.data::>().unwrap(); let sql = format!( - "SELECT count(*) FROM players WHERE last_updated > now() - interval '15 minutes' AND class_name = $1 {};", + "SELECT count(distinct character_id) FROM classes WHERE time > now() - interval '15 minutes' AND class_id = $1 {};", filters.sql(), ); @@ -38,38 +33,33 @@ impl Class { #[Object] impl Class { async fn total<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Class", "total"); - self.fetch(ctx, self.filters.clone()).await } async fn nc<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Class", "nc"); self.fetch( ctx, Filters { - faction: Some(IdOrNameBy::Id(NC)), + faction: Some(IdOrNameBy::Id(1)), ..self.filters.clone() }, ) .await } async fn tr<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Class", "tr"); self.fetch( ctx, Filters { - faction: Some(IdOrNameBy::Id(TR)), + faction: Some(IdOrNameBy::Id(2)), ..self.filters.clone() }, ) .await } async fn vs<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Class", "vs"); self.fetch( ctx, Filters { - faction: Some(IdOrNameBy::Id(VS)), + faction: Some(IdOrNameBy::Id(3)), ..self.filters.clone() }, ) @@ -93,42 +83,36 @@ impl Classes { #[Object] impl Classes { async fn infiltrator(&self) -> Class { - telemetry::graphql_query("Classes", "infiltrator"); Class { filters: self.filters.clone(), class_name: "infiltrator".to_string(), } } async fn light_assault(&self) -> Class { - telemetry::graphql_query("Classes", "light_assault"); Class { filters: self.filters.clone(), class_name: "light_assault".to_string(), } } async fn combat_medic(&self) -> Class { - telemetry::graphql_query("Classes", "combat_medic"); Class { filters: self.filters.clone(), class_name: "combat_medic".to_string(), } } async fn engineer(&self) -> Class { - telemetry::graphql_query("Classes", "engineer"); Class { filters: self.filters.clone(), class_name: "engineer".to_string(), } } async fn heavy_assault(&self) -> Class { - telemetry::graphql_query("Classes", "heavy_assault"); Class { filters: self.filters.clone(), class_name: "heavy_assault".to_string(), } } async fn max(&self) -> Class { - telemetry::graphql_query("Classes", "max"); Class { filters: self.filters.clone(), class_name: "max".to_string(), @@ -148,7 +132,6 @@ impl ClassesQuery { /// Get a specific class pub async fn class(&self, filter: Option, class_name: String) -> Class { - telemetry::graphql_query("Classes", ""); Class { filters: filter.unwrap_or_default(), class_name, diff --git a/services/api/src/factions.rs b/services/api/src/factions.rs deleted file mode 100644 index b542087..0000000 --- a/services/api/src/factions.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub const VS: i32 = 1; -pub const NC: i32 = 2; -pub const TR: i32 = 3; -pub const NSO: i32 = 4; diff --git a/services/api/src/health.rs b/services/api/src/health.rs index 79cc45a..84eca16 100644 --- a/services/api/src/health.rs +++ b/services/api/src/health.rs @@ -1,13 +1,8 @@ -use crate::{telemetry, utils::ID_TO_WORLD}; -use async_graphql::{Context, Enum, Object, SimpleObject}; +use async_graphql::{Context, Enum, Object}; use axum::{http::StatusCode, response::IntoResponse, Extension, Json}; -use chrono::{DateTime, Utc}; use sqlx::{query, Pool, Postgres, Row}; pub async fn get_health(Extension(pool): Extension>) -> impl IntoResponse { - telemetry::http_request("/health", "GET"); - - telemetry::db_read("analytics", "get_health"); let events_resp = query("SELECT count(*) FROM analytics WHERE time > now() - interval '5 minutes'") .fetch_one(&pool) @@ -58,48 +53,13 @@ enum UpDown { pub struct Health {} -impl Health { - async fn most_recent_event_time<'ctx>( - &self, - ctx: &Context<'ctx>, - world_id: i32, - ) -> (UpDown, Option>) { - let pool = ctx.data::>().unwrap(); - - telemetry::db_read("analytics", "most_recent_event_time"); - let events_resp = - query("SELECT time FROM analytics WHERE world_id = $1 ORDER BY time DESC LIMIT 1") - .bind(world_id) - .fetch_one(pool) - .await; - - match events_resp { - Ok(row) => { - let last_event: DateTime = row.get(0); - - if last_event < Utc::now() - chrono::Duration::minutes(5) { - return (UpDown::Down, Some(last_event)); - } else { - return (UpDown::Up, Some(last_event)); - } - } - Err(_) => { - return (UpDown::Down, None); - } - } - } -} - /// Reports on the health of Saerro Listening Post #[Object] impl Health { /// Did a ping to Postgres (our main datastore) succeed? async fn database<'ctx>(&self, ctx: &Context<'ctx>) -> UpDown { - telemetry::graphql_query("Health", "database"); - let pool = ctx.data::>().unwrap(); - telemetry::db_read("analytics", "database_health"); let events_resp = query("SELECT count(*) FROM analytics WHERE time > now() - interval '5 minutes'") .fetch_one(pool) @@ -113,11 +73,8 @@ impl Health { /// Is the websocket processing jobs? async fn ingest<'ctx>(&self, ctx: &Context<'ctx>) -> UpDown { - telemetry::graphql_query("Health", "ingest"); - let pool = ctx.data::>().unwrap(); - telemetry::db_read("analytics", "ingest_health"); let events_resp = query("SELECT count(*) FROM analytics WHERE time > now() - interval '5 minutes'") .fetch_one(pool) @@ -139,46 +96,14 @@ impl Health { /// Is the websocket actually turned on? async fn ingest_reachable(&self) -> UpDown { - telemetry::graphql_query("Health", "ingest_reachable"); - reqwest::get( std::env::var("WEBSOCKET_HEALTHCHECK") - .unwrap_or("http://127.0.0.1:8999/healthz".to_string()), + .unwrap_or("http://localhost:8999/health".to_string()), ) .await .map(|_| UpDown::Up) .unwrap_or(UpDown::Down) } - - /// Shows a disclaimer for the worlds check - async fn worlds_disclaimer(&self) -> String { - "This is a best-effort check. A world reports `DOWN` when it doesn't have new events for 5 minutes. It could be broken, it could be the reality of the game state.".to_string() - } - - /// Checks if a world has had any events for the last 5 minutes - async fn worlds<'ctx>(&self, ctx: &Context<'ctx>) -> Vec { - telemetry::graphql_query("Health", "worlds"); - - let mut worlds = Vec::new(); - for (id, name) in ID_TO_WORLD.iter() { - let (status, last_event) = self.most_recent_event_time(ctx, *id).await; - worlds.push(WorldUpDown { - id: *id, - name: name.to_string(), - status, - last_event, - }); - } - worlds - } -} - -#[derive(SimpleObject)] -struct WorldUpDown { - id: i32, - name: String, - status: UpDown, - last_event: Option>, } #[derive(Default)] diff --git a/services/api/src/html/404.html b/services/api/src/html/404.html index bfda5d1..3e1f179 100644 --- a/services/api/src/html/404.html +++ b/services/api/src/html/404.html @@ -17,4 +17,6 @@

404 Not Found

-

[home]

+

+ [home] [graphql playground] +

diff --git a/services/api/src/html/index.html b/services/api/src/html/index.html index 5d66b66..ee8fbed 100644 --- a/services/api/src/html/index.html +++ b/services/api/src/html/index.html @@ -14,256 +14,47 @@ color: #cead42; text-decoration: none; } - - .hidden { - display: none; - } - - .query { - list-style-type: none; - padding-left: 0; - background-color: #131313; - width: fit-content; - padding: 2rem; - margin: 2rem; - border-radius: 10px; - border-left: #918b79 3px solid; - font-size: 1rem; - } - - .query pre { - margin: 0; - }

Saerro Listening Post

Live Population Stats API for PlanetSide 2

-

- This is a GraphQL API, which means you can query for exactly the data you - need. You can also use the GraphiQL interface to explore the data and build - your queries. -

-

- This API supports two query methods, - GET - and - POST. - To view the JSON outputs without fancy UIs, you can use a browser plugin like - JSONView for Firefox - or - JSONVue for Chrome. -

All data is an aggregate of the last 15 minutes of Death and VehicleDestroy events, including both attacker and victim.

-
+

This API is provided by Genudine Dynamics.
As always, we take no responsibility for your use of this data... or our weapons. :)

For help, please contact us in #api-dev on the PlanetSide 2 Discord.

- [ingest stats] [github] [pstop] + [github] [pstop]

- diff --git a/services/api/src/html/ingest.html b/services/api/src/html/ingest.html deleted file mode 100644 index 192cdb3..0000000 --- a/services/api/src/html/ingest.html +++ /dev/null @@ -1,418 +0,0 @@ - -Ingest Stats - Saerro Listening Post - - -

Ingest Stats [LOADING...]

-
-
-
-

All Events by Type

-

(0, 0, 0, 0)

-
-
- -
-
-
-
-

Events by World

-
-
- -
-
-
-
-

Connery [US West]

-

(0, 0, 0, 0)

-
-
- -
-
-
-
-

Miller [EU]

-

(0, 0, 0, 0)

-
-
- -
-
-
-
-

Cobalt [EU]

-

(0, 0, 0, 0)

-
-
- -
-
-
-
-

Emerald [US East]

-

(0, 0, 0, 0)

-
-
- -
-
-
-
-

Jaeger [US East]

-

(0, 0, 0, 0)

-
-
- -
-
-
-
-

SolTech [Tokyo]

-

(0, 0, 0, 0)

-
-
- -
-
-
-
-

Genudine [US East] [PS4]

-

(0, 0, 0, 0)

-
-
- -
-
-
-
-

Ceres [EU] [PS4]

-

(0, 0, 0, 0)

-
-
- -
-
-
-
-

Experience Events By ID

-

(0, 0, 0, 0)

-
-
- -
-
- Filter to World: - -
-
-
-

- [home] [1 day w/ 5m buckets] [1 hour w/ 5s buckets] -

- - - - diff --git a/services/api/src/main.rs b/services/api/src/main.rs index 2f1aa65..8823ca4 100644 --- a/services/api/src/main.rs +++ b/services/api/src/main.rs @@ -1,10 +1,7 @@ -mod analytics; mod classes; -mod factions; mod health; mod population; mod query; -mod telemetry; mod utils; mod vehicles; mod world; @@ -27,15 +24,9 @@ use tower_http::cors::{Any, CorsLayer}; extern crate serde_json; async fn index() -> Html<&'static str> { - telemetry::http_request("/", "GET"); Html(include_str!("html/index.html")) } -async fn ingest() -> Html<&'static str> { - telemetry::http_request("/ingest", "GET"); - Html(include_str!("html/ingest.html")) -} - async fn handle_404() -> Html<&'static str> { Html(include_str!("html/404.html")) } @@ -44,7 +35,6 @@ async fn graphql_handler_post( Extension(schema): Extension>, Json(query): Json, ) -> Json { - telemetry::http_request("/graphql", "POST"); Json(schema.execute(query).await) } @@ -52,8 +42,6 @@ async fn graphql_handler_get( Extension(schema): Extension>, query: Query, ) -> axum::response::Response { - telemetry::http_request("/graphql", "GET"); - if query.query == "" { return Redirect::to("/graphiql").into_response(); } @@ -62,8 +50,6 @@ async fn graphql_handler_get( } async fn graphiql() -> impl IntoResponse { - telemetry::http_request("/graphiql", "GET"); - Html( GraphiQLSource::build() .endpoint("/graphql") @@ -75,7 +61,7 @@ async fn graphiql() -> impl IntoResponse { #[tokio::main] async fn main() { let db_url = std::env::var("DATABASE_URL") - .unwrap_or("postgres://saerrouser:saerro321@127.0.0.1:5432/data".to_string()); + .unwrap_or("postgres://saerrouser:saerro321@localhost:5432/data".to_string()); let db = sqlx::PgPool::connect(&db_url).await.unwrap(); let schema = Schema::build(query::Query::default(), EmptyMutation, EmptySubscription) @@ -84,15 +70,12 @@ async fn main() { let app = Router::new() .route("/", get(index)) - .route("/ingest", get(ingest)) .route("/health", get(health::get_health)) .route( "/graphql", post(graphql_handler_post).get(graphql_handler_get), ) - .route("/graphiql", get(graphiql)) - .route("/metrics", get(telemetry::handler)) - .route("/metrics/combined", get(telemetry::handler_combined)) + .route("/graphql/playground", get(graphiql)) .fallback(handle_404) .layer(Extension(db)) .layer(Extension(schema)) diff --git a/services/api/src/population.rs b/services/api/src/population.rs index ca9a2b1..4e7f9f7 100644 --- a/services/api/src/population.rs +++ b/services/api/src/population.rs @@ -1,8 +1,4 @@ -use crate::{ - factions::{NC, NSO, TR, VS}, - utils::Filters, - telemetry, -}; +use crate::utils::Filters; use async_graphql::{Context, Object}; use sqlx::{Pool, Postgres, Row}; @@ -23,9 +19,8 @@ impl Population { async fn by_faction<'ctx>(&self, ctx: &Context<'ctx>, faction: i32) -> i64 { let pool = ctx.data::>().unwrap(); - telemetry::db_read("players", "population_by_faction"); let sql = format!( - "SELECT count(*) FROM players WHERE last_updated > now() - interval '15 minutes' AND faction_id = $1 {};", + "SELECT count(distinct character_id) FROM players WHERE time > now() - interval '15 minutes' AND faction_id = $1 {};", self.filters.sql(), ); @@ -45,13 +40,10 @@ impl Population { #[Object] impl Population { async fn total<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Population", "total"); - let pool = ctx.data::>().unwrap(); - telemetry::db_read("players", "population_total"); let sql = format!( - "SELECT count(*) FROM players WHERE last_updated > now() - interval '15 minutes' {};", + "SELECT count(distinct character_id) FROM players WHERE time > now() - interval '15 minutes' {};", self.filters.sql(), ); @@ -62,24 +54,20 @@ impl Population { .await .unwrap() .get(0); - + query } async fn nc<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Population", "nc"); - self.by_faction(ctx, NC).await + self.by_faction(ctx, 1).await } async fn vs<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Population", "vs"); - self.by_faction(ctx, VS).await + self.by_faction(ctx, 2).await } async fn tr<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Population", "tr"); - self.by_faction(ctx, TR).await + self.by_faction(ctx, 3).await } async fn ns<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Population", "ns"); - self.by_faction(ctx, NSO).await + self.by_faction(ctx, 4).await } } diff --git a/services/api/src/query.rs b/services/api/src/query.rs index a53f8fb..d025142 100644 --- a/services/api/src/query.rs +++ b/services/api/src/query.rs @@ -1,6 +1,6 @@ use crate::{ - analytics::AnalyticsQuery, classes::ClassesQuery, health::HealthQuery, - population::PopulationQuery, vehicles::VehicleQuery, world::WorldQuery, zone::ZoneQuery, + classes::ClassesQuery, health::HealthQuery, population::PopulationQuery, + vehicles::VehicleQuery, world::WorldQuery, zone::ZoneQuery, }; use async_graphql::MergedObject; @@ -12,5 +12,4 @@ pub struct Query( WorldQuery, ZoneQuery, HealthQuery, - AnalyticsQuery, ); diff --git a/services/api/src/telemetry.rs b/services/api/src/telemetry.rs deleted file mode 100644 index f02479b..0000000 --- a/services/api/src/telemetry.rs +++ /dev/null @@ -1,138 +0,0 @@ -use lazy_static::lazy_static; -use prometheus::{ - IntGauge, - IntGaugeVec, - register_int_gauge_vec, - register_int_gauge, - TextEncoder, - gather -}; -use sqlx::{Pool, Postgres, Row}; -use axum::Extension; -use chrono::{DateTime, Utc}; - -lazy_static! { - // http - pub static ref HTTP_REQUEST: IntGaugeVec = register_int_gauge_vec!("saerro_api_http_requests", "HTTP requests", &[ - "route", "method" - ]).unwrap(); - pub static ref GRAPHQL_QUERY: IntGaugeVec = register_int_gauge_vec!("saerro_api_graphql_query", "GraphQL queries", &[ - "major", "minor" - ]).unwrap(); - - // counters - pub static ref PLAYERS_TRACKED: IntGauge = register_int_gauge!("saerro_players_tracked", "All players tracked by Saerro right now").unwrap(); - pub static ref VEHICLES_TRACKED: IntGauge = register_int_gauge!("saerro_vehicles_tracked", "All vehicles tracked by Saerro right now").unwrap(); - pub static ref OLDEST_PLAYER: IntGauge = register_int_gauge!("saerro_oldest_player", "Oldest player tracked").unwrap(); - pub static ref NEWEST_PLAYER: IntGauge = register_int_gauge!("saerro_newest_player", "Newest player tracked").unwrap(); - pub static ref OLDEST_VEHICLE: IntGauge = register_int_gauge!("saerro_oldest_vehicle", "Oldest vehicle tracked").unwrap(); - pub static ref NEWEST_VEHICLE: IntGauge = register_int_gauge!("saerro_newest_vehicle", "Newest vehicle tracked").unwrap(); - - // database stuff - pub static ref DB_WRITES: IntGaugeVec = register_int_gauge_vec!("saerro_api_db_writes", "Writes to Postgres", &[ - "table", "op" - ]).unwrap(); - pub static ref DB_READS: IntGaugeVec = register_int_gauge_vec!("saerro_api_db_reads", "Reads from Postgres", &[ - "table", "op" - ]).unwrap(); - // static ref DB_WTIME: HistogramVec = register_histogram_vec!("saerro_ws_db_write_time", &[ - // "table", "op" - // ]).unwrap(); - // static ref DB_RTIME: HistogramVec = register_histogram_vec!("saerro_ws_db_read_time", &[ - // "table", "op" - // ]).unwrap(); -} - -pub async fn handler(Extension(pool): Extension>) -> String { - update_data_gauges(pool).await; - - // Final output - let encoder = TextEncoder::new(); - let mut buffer = String::new(); - - let metrics = gather(); - encoder.encode_utf8(&metrics, &mut buffer).expect("prometheus metrics failed to render"); - - buffer -} - -pub async fn handler_combined(Extension(pool): Extension>) -> String { - let url = std::env::var("WEBSOCKET_HEALTHCHECK") - .unwrap_or("http://127.0.0.1:8999/healthz".to_string()).replace("/healthz", "/metrics"); - - let local = handler(Extension(pool)).await; - let remote = match reqwest::get(url).await { - Ok(r) => r.text().await.expect("failed to text lol"), - Err(_) => String::from("") - }; - - - format!("{}{}", local, remote) -} - -// pub fn db_write(table: &str, op: &str) { -// DB_WRITES.with_label_values(&[table, op]).inc(); -// } - -pub fn db_read(table: &str, op: &str) { - DB_READS.with_label_values(&[table, op]).inc(); -} - -pub fn http_request(route: &str, method: &str) { - HTTP_REQUEST.with_label_values(&[route, method]).inc(); -} - -pub fn graphql_query(major: &str, minor: &str) { - GRAPHQL_QUERY.with_label_values(&[major, minor]).inc(); -} - -async fn update_data_gauges(pool: Pool) { - // Do some easy queries to fill our non-cumulative gauges - db_read("players", "count_all"); - let player_count: i64 = sqlx::query("SELECT count(*) FROM players") - .fetch_one(&pool) - .await - .unwrap() - .get(0); - PLAYERS_TRACKED.set(player_count); - - db_read("players", "get_newest"); - let player_newest: DateTime = sqlx::query("SELECT last_updated FROM players ORDER BY last_updated DESC LIMIT 1") - .fetch_one(&pool) - .await - .unwrap() - .get(0); - NEWEST_PLAYER.set(player_newest.timestamp()); - - db_read("players", "get_oldest"); - let player_oldest: DateTime = sqlx::query("SELECT last_updated FROM players ORDER BY last_updated ASC LIMIT 1") - .fetch_one(&pool) - .await - .unwrap() - .get(0); - OLDEST_PLAYER.set(player_oldest.timestamp()); - - db_read("vehicles", "count_all"); - let vehicle_count: i64 = sqlx::query("SELECT count(*) FROM vehicles") - .fetch_one(&pool) - .await - .unwrap() - .get(0); - VEHICLES_TRACKED.set(vehicle_count); - - db_read("vehicles", "get_newest"); - let vehicle_newest: DateTime = sqlx::query("SELECT last_updated FROM vehicles ORDER BY last_updated DESC LIMIT 1") - .fetch_one(&pool) - .await - .unwrap() - .get(0); - NEWEST_VEHICLE.set(vehicle_newest.timestamp()); - - db_read("vehicles", "get_oldest"); - let vehicle_oldest: DateTime = sqlx::query("SELECT last_updated FROM vehicles ORDER BY last_updated ASC LIMIT 1") - .fetch_one(&pool) - .await - .unwrap() - .get(0); - OLDEST_VEHICLE.set(vehicle_oldest.timestamp()); -} \ No newline at end of file diff --git a/services/api/src/vehicles.rs b/services/api/src/vehicles.rs index ab541e2..bf53dd2 100644 --- a/services/api/src/vehicles.rs +++ b/services/api/src/vehicles.rs @@ -1,8 +1,4 @@ -use crate::{ - factions::{NC, TR, VS}, - utils::{Filters, IdOrNameBy}, - telemetry, -}; +use crate::utils::{Filters, IdOrNameBy}; use async_graphql::{Context, Object}; use sqlx::{Pool, Postgres, Row}; @@ -16,9 +12,8 @@ impl Vehicle { async fn fetch<'ctx>(&self, ctx: &Context<'ctx>, filters: Filters) -> i64 { let pool = ctx.data::>().unwrap(); - telemetry::db_read("vehicles", "fetch"); let sql = format!( - "SELECT count(*) FROM vehicles WHERE last_updated > now() - interval '15 minutes' AND vehicle_name = $1 {};", + "SELECT count(distinct character_id) FROM vehicles WHERE time > now() - interval '15 minutes' AND vehicle_id = $1 {};", filters.sql(), ); @@ -38,41 +33,33 @@ impl Vehicle { #[Object] impl Vehicle { async fn total<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Vehicle", "total"); - self.fetch(ctx, self.filters.clone()).await } async fn nc<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Vehicle", "nc"); - self.fetch( ctx, Filters { - faction: Some(IdOrNameBy::Id(NC)), + faction: Some(IdOrNameBy::Id(1)), ..self.filters.clone() }, ) .await } async fn tr<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Vehicle", "tr"); - self.fetch( ctx, Filters { - faction: Some(IdOrNameBy::Id(TR)), + faction: Some(IdOrNameBy::Id(2)), ..self.filters.clone() }, ) .await } async fn vs<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Vehicle", "vs"); - self.fetch( ctx, Filters { - faction: Some(IdOrNameBy::Id(VS)), + faction: Some(IdOrNameBy::Id(3)), ..self.filters.clone() }, ) @@ -96,13 +83,10 @@ impl Vehicles { #[Object] impl Vehicles { async fn total<'ctx>(&self, ctx: &Context<'ctx>) -> i64 { - telemetry::graphql_query("Vehicles", "total"); - let pool = ctx.data::>().unwrap(); - telemetry::db_read("players", "vehicles_total"); let sql = format!( - "SELECT count(*) FROM vehicles WHERE last_updated > now() - interval '15 minutes' {};", + "SELECT count(distinct character_id) FROM vehicles WHERE time > now() - interval '15 minutes' {};", self.filters.sql(), ); @@ -119,90 +103,62 @@ impl Vehicles { // Transport async fn flash(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "flash"); - Vehicle { filters: self.filters.clone(), vehicle_name: "flash".to_string(), } } async fn sunderer(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "sunderer"); - Vehicle { filters: self.filters.clone(), vehicle_name: "sunderer".to_string(), } } async fn ant(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "ant"); - Vehicle { filters: self.filters.clone(), vehicle_name: "ant".to_string(), } } async fn harasser(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "harasser"); - Vehicle { filters: self.filters.clone(), vehicle_name: "harasser".to_string(), } } async fn javelin(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "javelin"); - Vehicle { filters: self.filters.clone(), vehicle_name: "javelin".to_string(), } } - async fn corsair(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "corsair"); - - Vehicle { - filters: self.filters.clone(), - vehicle_name: "corsair".to_string(), - } - } // Tanks async fn lightning(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "lightning"); - Vehicle { filters: self.filters.clone(), - vehicle_name: "lightning".to_string(), + vehicle_name: "javelin".to_string(), } } async fn prowler(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "prowler"); - Vehicle { filters: self.filters.clone(), vehicle_name: "prowler".to_string(), } } async fn vanguard(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "vanguard"); - Vehicle { filters: self.filters.clone(), vehicle_name: "vanguard".to_string(), } } async fn magrider(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "magrider"); - Vehicle { filters: self.filters.clone(), vehicle_name: "magrider".to_string(), } } async fn chimera(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "chimera"); - Vehicle { filters: self.filters.clone(), vehicle_name: "chimera".to_string(), @@ -211,56 +167,42 @@ impl Vehicles { // Air async fn mosquito(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "mosquito"); - Vehicle { filters: self.filters.clone(), vehicle_name: "mosquito".to_string(), } } async fn liberator(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "liberator"); - Vehicle { filters: self.filters.clone(), vehicle_name: "liberator".to_string(), } } async fn galaxy(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "galaxy"); - Vehicle { filters: self.filters.clone(), vehicle_name: "galaxy".to_string(), } } async fn valkyrie(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "valkyrie"); - Vehicle { filters: self.filters.clone(), vehicle_name: "valkyrie".to_string(), } } async fn reaver(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "reaver"); - Vehicle { filters: self.filters.clone(), vehicle_name: "reaver".to_string(), } } async fn scythe(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "scythe"); - Vehicle { filters: self.filters.clone(), vehicle_name: "scythe".to_string(), } } async fn dervish(&self) -> Vehicle { - telemetry::graphql_query("Vehicle", "dervish"); - Vehicle { filters: self.filters.clone(), vehicle_name: "dervish".to_string(), diff --git a/services/api/src/world.rs b/services/api/src/world.rs index 4d436ff..fe38378 100644 --- a/services/api/src/world.rs +++ b/services/api/src/world.rs @@ -4,7 +4,6 @@ use crate::{ utils::{id_or_name_to_id, id_or_name_to_name, Filters, IdOrNameBy, ID_TO_WORLD, WORLD_IDS}, vehicles::Vehicles, zone::Zones, - telemetry, }; use async_graphql::Object; @@ -34,15 +33,11 @@ impl World { impl World { /// The ID of the world. async fn id(&self) -> i32 { - telemetry::graphql_query("World", "id"); - id_or_name_to_id(&WORLD_IDS, self.filter.world.as_ref().unwrap()).unwrap() } /// The name of the world, in official game capitalization. async fn name(&self) -> String { - telemetry::graphql_query("World", "name"); - let name = id_or_name_to_name(&ID_TO_WORLD, self.filter.world.as_ref().unwrap()).unwrap(); // Special case for SolTech, lol. @@ -56,8 +51,6 @@ impl World { /// Population filtered to this world. async fn population(&self) -> Population { - telemetry::graphql_query("World", "population"); - Population::new(Some(Filters { world: self.filter.world.clone(), faction: None, @@ -67,8 +60,6 @@ impl World { /// Vehicles filtered to this world. async fn vehicles(&self) -> Vehicles { - telemetry::graphql_query("World", "vehicles"); - Vehicles::new(Some(Filters { world: self.filter.world.clone(), faction: None, @@ -78,8 +69,6 @@ impl World { /// Classes filtered to this world. async fn classes(&self) -> Classes { - telemetry::graphql_query("World", "classes"); - Classes::new(Some(Filters { world: self.filter.world.clone(), faction: None, @@ -89,8 +78,6 @@ impl World { /// Get a specific zone/continent on this world. async fn zones(&self) -> Zones { - telemetry::graphql_query("World", "zones"); - Zones::new(Some(self.filter.clone())) } } diff --git a/services/api/src/zone.rs b/services/api/src/zone.rs index be1fefa..8c2be9c 100644 --- a/services/api/src/zone.rs +++ b/services/api/src/zone.rs @@ -3,7 +3,6 @@ use crate::{ population::Population, utils::{id_or_name_to_id, id_or_name_to_name, Filters, IdOrNameBy, ID_TO_ZONE, ZONE_IDS}, vehicles::Vehicles, - telemetry, }; use async_graphql::Object; @@ -24,15 +23,11 @@ impl Zone { impl Zone { /// The ID of the zone/continent. async fn id(&self) -> i32 { - telemetry::graphql_query("Zone", "id"); - id_or_name_to_id(&ZONE_IDS, self.filters.zone.as_ref().unwrap()).unwrap() } /// The name of the continent, in official game capitalization. async fn name(&self) -> String { - telemetry::graphql_query("Zone", "name"); - let name = id_or_name_to_name(&ID_TO_ZONE, self.filters.zone.as_ref().unwrap()).unwrap(); // Capitalize the first letter @@ -40,20 +35,14 @@ impl Zone { } async fn population(&self) -> Population { - telemetry::graphql_query("Zone", "population"); - Population::new(Some(self.filters.clone())) } async fn vehicles(&self) -> Vehicles { - telemetry::graphql_query("Zone", "vehicles"); - Vehicles::new(Some(self.filters.clone())) } async fn classes(&self) -> Classes { - telemetry::graphql_query("Zone", "classes"); - Classes::new(Some(self.filters.clone())) } } diff --git a/services/tasks/Cargo.toml b/services/tasks/Cargo.toml index 0a45178..feb9a2d 100644 --- a/services/tasks/Cargo.toml +++ b/services/tasks/Cargo.toml @@ -6,10 +6,10 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread"] } -sqlx = { version = "0.7.1", default_features = false, features = [ - "runtime-tokio-rustls", - "postgres", -] } +redis = { version = "0.22.1", features = ["aio", "r2d2", "tokio-comp"] } +once_cell = "1.16.0" +tokio = { version = "1.23.0", features = ["full"] } +sqlx = { version = "0.6.2", features = [ "runtime-tokio-native-tls" , "postgres" ] } lazy_static = "1.4.0" async_once = "0.2.6" +dotenvy = "0.15.6" \ No newline at end of file diff --git a/services/tasks/src/main.rs b/services/tasks/src/main.rs index 261ab95..ba61378 100644 --- a/services/tasks/src/main.rs +++ b/services/tasks/src/main.rs @@ -1,4 +1,5 @@ use async_once::AsyncOnce; +use dotenvy::dotenv; use lazy_static::lazy_static; use migrations::cmd_migrate; use sqlx::query; @@ -9,7 +10,7 @@ mod migrations; lazy_static! { pub static ref PG: AsyncOnce = AsyncOnce::new(async { let db_url = std::env::var("DATABASE_URL") - .unwrap_or("postgres://saerrouser:saerro321@127.0.0.1:5432/data".to_string()); + .unwrap_or("postgres://saerrouser:saerro321@localhost:5432/data".to_string()); sqlx::PgPool::connect(&db_url).await.unwrap() }); } @@ -18,14 +19,21 @@ async fn cmd_prune() { println!("Pruning old data..."); let pool = PG.get().await; - let rows = query("DELETE FROM players WHERE last_updated < NOW() - INTERVAL '15 minutes';") + let rows = query("DELETE FROM players WHERE time < NOW() - INTERVAL '15 minutes';") .execute(pool) .await .unwrap() .rows_affected(); println!("Deleted {} rows of old player data", rows); - let rows = query("DELETE FROM vehicles WHERE last_updated < NOW() - INTERVAL '15 minutes';") + let rows = query("DELETE FROM classes WHERE time < NOW() - INTERVAL '15 minutes';") + .execute(pool) + .await + .unwrap() + .rows_affected(); + println!("Deleted {} rows of old class data", rows); + + let rows = query("DELETE FROM vehicles WHERE time < NOW() - INTERVAL '15 minutes';") .execute(pool) .await .unwrap() @@ -50,41 +58,14 @@ fn cmd_help() { #[tokio::main] async fn main() { + dotenv().ok(); + let command = args().nth(1).unwrap_or("help".to_string()); match command.as_str() { "help" => cmd_help(), "prune" => cmd_prune().await, - "auto-prune" => loop { - cmd_prune().await; - tokio::time::sleep(tokio::time::Duration::from_secs(60 * 5)).await; - }, - "maintenance" => { - println!("Running maintenance tasks..."); - println!("Checking if DB is migrated..."); - if !migrations::is_migrated().await { - println!("DB is not migrated, running migrations..."); - cmd_migrate().await; - } - - println!("Running prune..."); - cmd_prune().await; - println!("Done!"); - } - "auto-maintenance" => loop { - println!("Running maintenance tasks..."); - if !migrations::is_migrated().await { - println!("DB is not migrated, running migrations..."); - cmd_migrate().await; - } - - cmd_prune().await; - tokio::time::sleep(tokio::time::Duration::from_secs(60 * 5)).await; - }, "migrate" => cmd_migrate().await, - "print-env" => { - std::env::vars().for_each(|(key, value)| println!("{}={}", key, value)); - } _ => { println!("Unknown command: {}", command); cmd_help(); diff --git a/services/tasks/src/migrations.rs b/services/tasks/src/migrations.rs index 846687b..658a9aa 100644 --- a/services/tasks/src/migrations.rs +++ b/services/tasks/src/migrations.rs @@ -1,10 +1,15 @@ use crate::PG; -use sqlx::{query, Row}; +use sqlx::query; pub async fn cmd_migrate() { println!("Migrating database..."); - tokio::join!(migrate_players(), migrate_vehicles(), migrate_analytics()); + tokio::join!( + migrate_players(), + migrate_classes(), + migrate_vehicles(), + migrate_analytics() + ); } async fn migrate_players() { @@ -21,21 +26,77 @@ async fn migrate_players() { println!("PLAYERS => CREATE TABLE players"); query( "CREATE TABLE players ( - character_id TEXT NOT NULL PRIMARY KEY, - last_updated TIMESTAMPTZ NOT NULL, + character_id TEXT NOT NULL, + time TIMESTAMPTZ NOT NULL, world_id INT NOT NULL, faction_id INT NOT NULL, - zone_id INT NOT NULL, - class_name TEXT NOT NULL - );", + zone_id INT NOT NULL);", ) .execute(pool) .await .unwrap(); + println!("PLAYERS => create_hypertable"); + query( + "SELECT create_hypertable('players', 'time', + chunk_time_interval => INTERVAL '1 minute', if_not_exists => TRUE);", + ) + .execute(pool) + .await + .unwrap(); + + println!("PLAYERS => add_retention_policy"); + query("SELECT add_retention_policy('players', INTERVAL '15 minutes');") + .execute(pool) + .await + .unwrap(); + println!("PLAYERS => done!"); } +async fn migrate_classes() { + let pool = PG.get().await; + + println!("-> Migrating classes"); + + println!("CLASSES => DROP TABLE IF EXISTS classes"); + query("DROP TABLE IF EXISTS classes") + .execute(pool) + .await + .unwrap(); + + println!("CLASSES => CREATE TABLE classes"); + query( + "CREATE TABLE classes ( + character_id TEXT NOT NULL, + time TIMESTAMPTZ NOT NULL, + world_id INT NOT NULL, + faction_id INT NOT NULL, + zone_id INT NOT NULL, + class_id TEXT NOT NULL);", + ) + .execute(pool) + .await + .unwrap(); + + println!("CLASSES => create_hypertable"); + query( + "SELECT create_hypertable('classes', 'time', + chunk_time_interval => INTERVAL '1 minute', if_not_exists => TRUE);", + ) + .execute(pool) + .await + .unwrap(); + + println!("CLASSES => add_retention_policy"); + query("SELECT add_retention_policy('classes', INTERVAL '15 minutes');") + .execute(pool) + .await + .unwrap(); + + println!("CLASSES => done!"); +} + async fn migrate_vehicles() { let pool = PG.get().await; @@ -50,18 +111,33 @@ async fn migrate_vehicles() { println!("VEHICLES => CREATE TABLE vehicles"); query( "CREATE TABLE vehicles ( - character_id TEXT NOT NULL PRIMARY KEY, - last_updated TIMESTAMPTZ NOT NULL, + character_id TEXT NOT NULL, + time TIMESTAMPTZ NOT NULL, world_id INT NOT NULL, faction_id INT NOT NULL, - zone_id INT NOT NULL, - vehicle_name TEXT NOT NULL - );", + zone_id INT NOT NULL, + vehicle_id TEXT NOT NULL);", ) .execute(pool) .await .unwrap(); + println!("VEHICLES => create_hypertable"); + query( + "SELECT create_hypertable('vehicles', 'time', + chunk_time_interval => INTERVAL '1 minute', if_not_exists => TRUE);", + ) + .execute(pool) + .await + .unwrap(); + + println!("VEHICLES => add_retention_policy"); + + query("SELECT add_retention_policy('vehicles', INTERVAL '15 minutes');") + .execute(pool) + .await + .unwrap(); + println!("VEHICLES => done!"); } @@ -97,15 +173,3 @@ async fn migrate_analytics() { println!("ANALYTICS => done!"); } - -pub async fn is_migrated() -> bool { - let pool = PG.get().await; - - let tables: i64 = query("SELECT count(1) FROM pg_tables WHERE schemaname = 'public' AND tablename IN ('players', 'vehicles', 'analytics');") - .fetch_one(pool) - .await - .unwrap() - .get(0); - - tables == 3 -} diff --git a/services/websocket/Cargo.toml b/services/websocket/Cargo.toml index 6c25075..61b545f 100644 --- a/services/websocket/Cargo.toml +++ b/services/websocket/Cargo.toml @@ -6,22 +6,16 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +redis = { version = "0.22.1", default_features = false, features = ["r2d2"] } lazy_static = "1.4.0" -tokio-tungstenite = { version = "0.20.0", features = [ - "rustls-tls-webpki-roots", -] } -serde = { version = "1.0.188", features = ["derive"] } -serde_json = "1.0.105" -tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread"] } -sqlx = { version = "0.7.1", default_features = false, features = [ - "runtime-tokio-rustls", - "postgres", -] } -url = "2.4.1" -futures-util = "0.3.28" -futures = "0.3.28" +tokio-tungstenite = { version = "0.18.0", features=["native-tls"] } +serde = { version = "1.0.149", features = ["derive"] } +serde_json = "1.0.89" +tokio = { version = "1.23.0", features = ["full"] } +sqlx = { version = "0.6.2", features = [ "runtime-tokio-native-tls" , "postgres" ] } +url = "2.3.1" +futures-util = "0.3.25" +futures = "0.3.25" async_once = "0.2.6" -serde-aux = "4.2.0" -axum = "0.6.20" -prometheus = "0.13.3" -prometheus-static-metric = "0.5.1" +serde-aux = "4.1.2" +axum = "0.6.1" \ No newline at end of file diff --git a/services/websocket/src/main.rs b/services/websocket/src/main.rs index c839d4e..c292c13 100644 --- a/services/websocket/src/main.rs +++ b/services/websocket/src/main.rs @@ -1,50 +1,42 @@ use async_once::AsyncOnce; -use axum::{routing::get, Json, Router}; +use axum::{routing::get, Router}; use futures::{pin_mut, FutureExt}; use futures_util::StreamExt; use lazy_static::lazy_static; use serde::Deserialize; use serde_aux::prelude::*; use serde_json::json; -use sqlx::{postgres::PgPoolOptions, query, Row}; +use sqlx::{postgres::PgPoolOptions, query}; use std::{env, net::SocketAddr}; use tokio::task::JoinSet; use tokio_tungstenite::{connect_async, tungstenite::Message}; mod translators; -mod telemetry; lazy_static! { + // static ref PAIR: String = env::var("PAIR").unwrap_or_default(); + // static ref ROLE: String = env::var("ROLE").unwrap_or("primary".to_string()); static ref WS_ADDR: String = env::var("WS_ADDR").unwrap_or_default(); static ref PG: AsyncOnce = AsyncOnce::new(async { let db_url = std::env::var("DATABASE_URL") - .unwrap_or("postgres://saerrouser:saerro321@127.0.0.1:5432/data".to_string()); + .unwrap_or("postgres://saerrouser:saerro321@localhost:5432/data".to_string()); PgPoolOptions::new().connect(&db_url).await.unwrap() }); } async fn send_init(tx: futures::channel::mpsc::UnboundedSender) { - let worlds_raw = env::var("WORLDS").unwrap_or("all".to_string()); + let worlds_raw = env::var("WORLDS").unwrap_or_default(); + if worlds_raw == "" { + println!("WORLDS not set"); + return; + } let worlds: Vec<&str> = worlds_raw.split(',').collect(); - let experience_ids = vec![ - 2, 3, 4, 5, 6, 7, 34, 51, 53, 55, 57, 86, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 201, 233, 293, - 294, 302, 303, 353, 354, 355, 438, 439, 503, 505, 579, 581, 584, 653, 656, 674, 675, - ]; - let mut events = experience_ids - .iter() - .map(|id| format!("GainExperience_experience_id_{}", id)) - .collect::>(); - - events.push("Death".to_string()); - events.push("VehicleDestroy".to_string()); - // Send setup message let setup_msg = json!({ "action": "subscribe", "worlds": worlds, - "eventNames": events, + "eventNames": ["Death", "VehicleDestroy"], "characters": ["all"], "logicalAndCharactersWithWorlds": true, "service": "event", @@ -54,7 +46,6 @@ async fn send_init(tx: futures::channel::mpsc::UnboundedSender) { .unwrap(); println!("[ws] Sent setup message"); - println!("[ws/setup] {}", setup_msg.to_string()) } #[derive(Clone)] @@ -63,32 +54,33 @@ struct PopEvent { team_id: i32, character_id: String, zone_id: i32, - loadout_id: String, - vehicle_id: String, } -#[derive(Debug)] +struct VehicleEvent { + world_id: i32, + vehicle_id: String, + character_id: String, + zone_id: i32, + team_id: i32, +} + +struct ClassEvent { + world_id: i32, + character_id: String, + loadout_id: String, + zone_id: i32, + team_id: i32, +} + struct AnalyticsEvent { world_id: i32, event_name: String, } -async fn get_team_id(character_id: String) -> Result { - let pool = PG.get().await; - - telemetry::db_read("players", "get_team_id"); - let team_id: i32 = query("SELECT faction_id FROM players WHERE character_id = $1 LIMIT 1;") - .bind(character_id.clone()) - .fetch_one(pool) - .await? - .get(0); - - if team_id == 0 { - return Err(sqlx::Error::RowNotFound); - } - - Ok(team_id) -} +// async fn track_pop(pop_event: PopEvent) { +// track_pop_db(pop_event.clone()).await; +// track_pop_redis(pop_event).await; +// } async fn track_pop(pop_event: PopEvent) { // println!("[ws/track_pop]"); @@ -99,31 +91,76 @@ async fn track_pop(pop_event: PopEvent) { team_id, character_id, zone_id, - loadout_id, - vehicle_id, } = pop_event; - let class_name = translators::loadout_to_class(loadout_id.as_str()); - let vehicle_name = if vehicle_id == "" { - "unknown".to_string() - } else { - translators::vehicle_to_name(vehicle_id.as_str()) - }; + query("INSERT INTO players (time, character_id, world_id, faction_id, zone_id) VALUES (now(), $1, $2, $3, $4);") + .bind(character_id) + .bind(world_id) + .bind(team_id) + .bind(zone_id) + .execute(pool) + .await + .unwrap(); +} + +async fn track_vehicle(vehicle_event: VehicleEvent) { + // println!("[ws/track_vehicle]"); + let pool = PG.get().await; + + let VehicleEvent { + world_id, + vehicle_id, + zone_id, + character_id, + team_id, + } = vehicle_event; + + let vehicle_name = translators::vehicle_to_name(vehicle_id.as_str()); + + if vehicle_name == "unknown" { + return; + } + + query("INSERT INTO vehicles (time, character_id, world_id, faction_id, zone_id, vehicle_id) VALUES (now(), $1, $2, $3, $4, $5);") + .bind(character_id) + .bind(world_id) + .bind(team_id) + .bind(zone_id) + .bind(vehicle_name) + .execute(pool) + .await + .unwrap(); +} + +async fn track_class(class_event: ClassEvent) { + // println!("[ws/track_class]"); + let pool = PG.get().await; + + let ClassEvent { + world_id, + character_id, + loadout_id, + zone_id, + team_id, + } = class_event; + + let class_name = translators::loadout_to_class(loadout_id.as_str()); + + if class_name == "unknown" { + return; + } - telemetry::db_write("players", "track_pop"); query( - " - INSERT INTO players (last_updated, character_id, world_id, faction_id, zone_id, class_name) - VALUES (now(), $1, $2, $3, $4, $5) - ON CONFLICT (character_id) DO UPDATE SET - last_updated = EXCLUDED.last_updated, - world_id = EXCLUDED.world_id, - faction_id = EXCLUDED.faction_id, - zone_id = EXCLUDED.zone_id, - class_name = EXCLUDED.class_name - ;", + "INSERT INTO classes ( + time, + character_id, + world_id, + faction_id, + zone_id, + class_id + ) VALUES (now(), $1, $2, $3, $4, $5);", ) - .bind(character_id.clone()) + .bind(character_id) .bind(world_id) .bind(team_id) .bind(zone_id) @@ -131,31 +168,10 @@ async fn track_pop(pop_event: PopEvent) { .execute(pool) .await .unwrap(); - - if vehicle_name != "unknown" { - telemetry::db_write("vehicles", "track_pop"); - query("INSERT INTO vehicles (last_updated, character_id, world_id, faction_id, zone_id, vehicle_name) - VALUES (now(), $1, $2, $3, $4, $5) - ON CONFLICT (character_id) DO UPDATE SET - last_updated = EXCLUDED.last_updated, - world_id = EXCLUDED.world_id, - faction_id = EXCLUDED.faction_id, - zone_id = EXCLUDED.zone_id, - vehicle_name = EXCLUDED.vehicle_name - ;") - .bind(character_id) - .bind(world_id) - .bind(team_id) - .bind(zone_id) - .bind(vehicle_name) - .execute(pool) - .await - .unwrap(); - } } async fn track_analytics(analytics_event: AnalyticsEvent) { - // println!("[ws/track_analytics] {:?}", analytics_event); + // println!("[ws/track_analytics]"); let pool = PG.get().await; let AnalyticsEvent { @@ -163,21 +179,15 @@ async fn track_analytics(analytics_event: AnalyticsEvent) { event_name, } = analytics_event; - telemetry::db_write("analytics", "track_analytics"); - match query("INSERT INTO analytics (time, world_id, event_name) VALUES (now(), $1, $2);") + query("INSERT INTO analytics (time, world_id, event_name) VALUES (now(), $1, $2);") .bind(world_id) .bind(event_name) .execute(pool) .await - { - Ok(_) => {} - Err(e) => { - println!("[ws/track_analytics] ERR => {:?}", e); - } - } + .unwrap(); } -async fn process_death_event(event: &Event) { +async fn process_event(event: &Event) { let mut set = JoinSet::new(); // println!("[ws/process_event] EVENT: {:?}", event); @@ -186,14 +196,33 @@ async fn process_death_event(event: &Event) { event_name: event.event_name.clone(), })); - if event.character_id != "" && event.character_id != "0" { + if event.character_id != "0" { + // General population tracking set.spawn(track_pop(PopEvent { world_id: event.world_id.clone(), team_id: event.team_id.clone(), character_id: event.character_id.clone(), zone_id: event.zone_id.clone(), - loadout_id: event.loadout_id.clone(), + })); + } + + if event.event_name == "VehicleDestroy" { + set.spawn(track_vehicle(VehicleEvent { + world_id: event.world_id.clone(), vehicle_id: event.vehicle_id.clone(), + character_id: event.character_id.clone(), + zone_id: event.zone_id.clone(), + team_id: event.team_id.clone(), + })); + } + + if event.event_name == "Death" { + set.spawn(track_class(ClassEvent { + world_id: event.world_id.clone(), + character_id: event.character_id.clone(), + loadout_id: event.loadout_id.clone(), + zone_id: event.zone_id.clone(), + team_id: event.team_id.clone(), })); } @@ -206,58 +235,42 @@ async fn process_death_event(event: &Event) { team_id: event.attacker_team_id.clone(), character_id: event.attacker_character_id.clone(), zone_id: event.zone_id.clone(), - loadout_id: event.attacker_loadout_id.clone(), - vehicle_id: event.attacker_vehicle_id.clone(), })); + + if event.event_name == "VehicleDestroy" { + set.spawn(track_vehicle(VehicleEvent { + world_id: event.world_id.clone(), + vehicle_id: event.attacker_vehicle_id.clone(), + character_id: event.attacker_character_id.clone(), + zone_id: event.zone_id.clone(), + team_id: event.attacker_team_id.clone(), + })); + } + + if event.event_name == "Death" { + set.spawn(track_class(ClassEvent { + world_id: event.world_id.clone(), + character_id: event.attacker_character_id.clone(), + loadout_id: event.attacker_loadout_id.clone(), + zone_id: event.zone_id.clone(), + team_id: event.attacker_team_id.clone(), + })); + } } while let Some(_) = set.join_next().await {} } -async fn process_exp_event(event: &Event) { - telemetry::experience_event(&event.world_id, &event.experience_id); - let mut set = JoinSet::new(); - // println!("[ws/process_event] EVENT: {:?}", event); - - set.spawn(track_analytics(AnalyticsEvent { - world_id: event.world_id.clone(), - event_name: format!( - "{}_{}", - event.event_name.clone(), - event.experience_id.clone() - ), - })); - - // Vehicle EXP events - let vehicle_id = match event.experience_id { - 201 => "11".to_string(), // Galaxy Spawn Bonus - 233 => "2".to_string(), // Sunderer Spawn Bonus - 674 | 675 => "160".to_string(), // ANT stuff - _ => "".to_string(), - }; - - set.spawn(track_pop(PopEvent { - world_id: event.world_id.clone(), - team_id: event.team_id.clone(), - character_id: event.character_id.clone(), - zone_id: event.zone_id.clone(), - loadout_id: event.loadout_id.clone(), - vehicle_id: vehicle_id.clone(), - })); - - while let Some(_) = set.join_next().await {} -} #[derive(Deserialize, Debug, Clone, Default)] struct Event { event_name: String, #[serde(deserialize_with = "deserialize_number_from_string")] world_id: i32, character_id: String, - #[serde(default)] attacker_character_id: String, - #[serde(default, deserialize_with = "deserialize_number_from_string")] + #[serde(deserialize_with = "deserialize_number_from_string")] attacker_team_id: i32, - #[serde(default, deserialize_with = "deserialize_number_from_string")] + #[serde(deserialize_with = "deserialize_number_from_string")] team_id: i32, #[serde(deserialize_with = "deserialize_number_from_string")] zone_id: i32, @@ -273,11 +286,6 @@ struct Event { vehicle_id: String, #[serde(default)] attacker_vehicle_id: String, - - #[serde(default, deserialize_with = "deserialize_number_from_string")] - experience_id: i32, - // #[serde(default)] - // other_id: String, } #[derive(Deserialize, Debug, Clone)] @@ -286,17 +294,7 @@ struct Payload { } async fn healthz() { - let app = Router::new().route( - "/healthz", - get(|| async { - Json(json!({ - "status": "ok", - })) - }), - ).route( - "/metrics", - get(telemetry::handler) - ); + let app = Router::new().route("/healthz", get(|| async { "ok" })); let port: u16 = std::env::var("PORT") .unwrap_or("8999".to_string()) @@ -321,54 +319,23 @@ async fn main() { } let url = url::Url::parse(&addr).unwrap(); - println!("[ws] Connecting to {}", url); - let (tx, rx) = futures::channel::mpsc::unbounded(); let (ws_stream, _) = connect_async(url).await.expect("Failed to connect"); let (write, read) = ws_stream.split(); let fused_writer = rx.map(Ok).forward(write).fuse(); let fused_reader = read - .for_each(|msg| async { + .for_each(|msg| async move { let body = &msg.unwrap().to_string(); - - let mut data: Payload = match serde_json::from_str(body) { - Ok(data) => data, - Err(_e) => { - // println!("Error: {}; body: {}", e, body.clone()); - telemetry::event_dropped(&0, &"".to_string(), "decoding failure"); - return; - } - }; + let data: Payload = serde_json::from_str(body).unwrap_or(Payload { + payload: Event::default(), + }); if data.payload.event_name == "" { - telemetry::event_dropped(&data.payload.world_id, &data.payload.event_name, "not event"); return; } - telemetry::event(&data.payload.world_id, &data.payload.event_name); - - if data.payload.event_name == "Death" || data.payload.event_name == "VehicleDestroy" { - process_death_event(&data.payload).await; - return; - } - - if data.payload.event_name == "GainExperience" { - if data.payload.team_id == 0 { - match get_team_id(data.payload.character_id.clone()).await { - Ok(team_id) => { - data.payload.team_id = team_id; - } - Err(_) => { - telemetry::event_dropped(&data.payload.world_id, &data.payload.event_name, "team_id missing"); - } - } - } - process_exp_event(&data.payload).await; - return; - } - - telemetry::event_dropped(&data.payload.world_id, &data.payload.event_name, "unprocessable"); + process_event(&data.payload).await; }) .fuse(); diff --git a/services/websocket/src/telemetry.rs b/services/websocket/src/telemetry.rs deleted file mode 100644 index 4d4baf2..0000000 --- a/services/websocket/src/telemetry.rs +++ /dev/null @@ -1,75 +0,0 @@ -use lazy_static::lazy_static; -use prometheus::{ - IntGaugeVec, - register_int_gauge_vec, - TextEncoder, - gather -}; - -lazy_static! { - // incoming events - pub static ref EVENTS: IntGaugeVec = register_int_gauge_vec!("saerro_ws_events_count", "Events processed", &[ - "world_id", "event_name" - ]).unwrap(); - pub static ref EVENTS_DROPPED: IntGaugeVec = register_int_gauge_vec!("saerro_ws_events_dropped_count", "Events dropped", &[ - "world_id", "event_name", "reason" - ]).unwrap(); - - pub static ref EXPERIENCE_EVENTS: IntGaugeVec = register_int_gauge_vec!("saerro_ws_experience_events_count", "Experience Events processed by Exp ID", &[ - "world_id", "experience_id" - ]).unwrap(); - - // database stuff - pub static ref DB_WRITES: IntGaugeVec = register_int_gauge_vec!("saerro_ws_db_writes", "Writes to Postgres", &[ - "table", "op" - ]).unwrap(); - pub static ref DB_READS: IntGaugeVec = register_int_gauge_vec!("saerro_ws_db_reads", "Reads from Postgres", &[ - "table", "op" - ]).unwrap(); - // static ref DB_WTIME: HistogramVec = register_histogram_vec!("saerro_ws_db_write_time", &[ - // "table", "op" - // ]).unwrap(); - // static ref DB_RTIME: HistogramVec = register_histogram_vec!("saerro_ws_db_read_time", &[ - // "table", "op" - // ]).unwrap(); -} - -pub async fn handler() -> String { - let encoder = TextEncoder::new(); - let mut buffer = String::new(); - - let metrics = gather(); - encoder.encode_utf8(&metrics, &mut buffer).expect("prometheus metrics failed to render"); - - buffer -} - -pub fn event(world_id: &i32, event_name: &String) { - EVENTS.with_label_values(&[ - &world_id.to_string(), - &event_name, - ]).inc(); -} - -pub fn event_dropped(world_id: &i32, event_name: &String, reason: &str) { - EVENTS_DROPPED.with_label_values(&[ - &world_id.to_string(), - &event_name, - reason, - ]).inc(); -} - -pub fn experience_event(world_id: &i32, experience_id: &i32) { - EXPERIENCE_EVENTS.with_label_values(&[ - &world_id.to_string(), - &experience_id.to_string(), - ]).inc(); -} - -pub fn db_write(table: &str, op: &str) { - DB_WRITES.with_label_values(&[table, op]).inc(); -} - -pub fn db_read(table: &str, op: &str) { - DB_READS.with_label_values(&[table, op]).inc(); -} \ No newline at end of file diff --git a/services/websocket/src/translators.rs b/services/websocket/src/translators.rs index 1711c85..9d35799 100644 --- a/services/websocket/src/translators.rs +++ b/services/websocket/src/translators.rs @@ -34,8 +34,6 @@ lazy_static! { ("1105", "vanguard"), ("2010", "flash"), ("2033", "javelin"), - ("2039", "ant"), - ("2040", "valkyrie"), ("2122", "mosquito"), ("2123", "reaver"), ("2124", "scythe"), @@ -49,9 +47,6 @@ lazy_static! { ("2135", "prowler"), ("2136", "dervish"), ("2137", "chimera"), - ("2139", "ant"), - ("2140", "galaxy"), - ("2141", "valkyrie"), ("2142", "corsair"), ]); static ref LOADOUT_TO_CLASS: HashMap<&'static str, &'static str> = HashMap::from([