From 30f510bb039a048a53beb3cb5783afa8ba0d319c Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Thu, 19 Sep 2024 15:53:09 -0700 Subject: [PATCH] server: WIP tantivy, cache slurps, use shared::compute_color, --- Cargo.lock | 1253 +++++++++++++++++++++++++++++++++----- server/Cargo.toml | 1 + server/Rocket.toml | 4 + server/sql/all-posts.sql | 10 + server/src/bin/server.rs | 142 ++++- server/src/config.rs | 7 + server/src/error.rs | 6 + server/src/graphql.rs | 5 +- server/src/lib.rs | 60 +- server/src/newsreader.rs | 30 +- 10 files changed, 1341 insertions(+), 177 deletions(-) create mode 100644 server/sql/all-posts.sql create mode 100644 server/src/config.rs diff --git a/Cargo.lock b/Cargo.lock index 43a7b2a..e1d9b9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,7 +44,7 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "getrandom 0.2.15", "once_cell", "version_check", @@ -100,7 +100,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi", + "winapi 0.3.9", ] [[package]] @@ -121,6 +121,18 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + [[package]] name = "ascii" version = "0.9.3" @@ -145,7 +157,7 @@ dependencies = [ "async-stream", "async-trait", "base64 0.13.1", - "bytes", + "bytes 1.6.0", "fast_chemail", "fnv", "futures-util", @@ -215,7 +227,7 @@ version = "6.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "323a5143f5bdd2030f45e3f2e0c821c9b1d36e79cf382129c64299c50a7f3750" dependencies = [ - "bytes", + "bytes 1.6.0", "indexmap 2.2.6", "serde", "serde_json", @@ -321,13 +333,19 @@ checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", "rustc-demangle", ] +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + [[package]] name = "base64" version = "0.13.1" @@ -397,13 +415,45 @@ dependencies = [ "crunchy", ] +[[package]] +name = "blake2b_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + [[package]] name = "block-buffer" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array", + "generic-array 0.14.7", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", ] [[package]] @@ -432,7 +482,7 @@ dependencies = [ "git2", "glob", "pretty_assertions", - "rustc_version", + "rustc_version 0.4.0", "serde_json", "zstd", ] @@ -445,7 +495,7 @@ checksum = "c88e36f2531db6136c2d42810698ced69af85872f4559c7b6dccb8e7c30485d2" dependencies = [ "chrono", "derive_more 1.0.0", - "semver", + "semver 1.0.23", "serde", ] @@ -476,6 +526,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + [[package]] name = "bytemuck" version = "1.16.1" @@ -488,6 +544,17 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +dependencies = [ + "byteorder", + "either", + "iovec", +] + [[package]] name = "bytes" version = "1.6.0" @@ -497,6 +564,19 @@ dependencies = [ "serde", ] +[[package]] +name = "cacher" +version = "0.1.0" +source = "git+https://git-private.z.xinu.tv/wathiede/cacher#a6958a92d4631ad66cd580c0b29bf63c62378905" +dependencies = [ + "log", + "mime_guess", + "rusoto_core", + "rusoto_credential", + "rusoto_s3", + "thiserror", +] + [[package]] name = "camino" version = "1.1.9" @@ -523,7 +603,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -546,6 +626,12 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f4c707c6a209cbe82d10abd08e1ea8995e9ea937d2550646e02798948992be0" +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" @@ -577,6 +663,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags 1.2.1", +] + [[package]] name = "combine" version = "3.8.1" @@ -596,7 +691,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen", ] @@ -622,6 +717,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb58b6451e8c2a812ad979ed1d83378caa5e927eef2622017a45f251457c2c9d" +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "convert_case" version = "0.4.0" @@ -635,7 +736,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" dependencies = [ "percent-encoding", - "time", + "time 0.3.36", "version_check", ] @@ -685,7 +786,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -694,7 +795,18 @@ version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.8.20", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" +dependencies = [ + "crossbeam-epoch 0.8.2", + "crossbeam-utils 0.7.2", + "maybe-uninit", ] [[package]] @@ -703,8 +815,23 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", + "crossbeam-epoch 0.9.18", + "crossbeam-utils 0.8.20", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "lazy_static", + "maybe-uninit", + "memoffset 0.5.6", + "scopeguard", ] [[package]] @@ -713,7 +840,27 @@ version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.8.20", +] + +[[package]] +name = "crossbeam-queue" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" +dependencies = [ + "crossbeam-utils 0.6.6", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +dependencies = [ + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "maybe-uninit", ] [[package]] @@ -722,7 +869,28 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.8.20", +] + +[[package]] +name = "crossbeam-utils" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" +dependencies = [ + "cfg-if 0.1.10", + "lazy_static", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "lazy_static", ] [[package]] @@ -743,10 +911,20 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array", + "generic-array 0.14.7", "typenum", ] +[[package]] +name = "crypto-mac" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +dependencies = [ + "generic-array 0.12.4", + "subtle 1.0.0", +] + [[package]] name = "css-inline" version = "0.13.0" @@ -761,7 +939,7 @@ dependencies = [ "reqwest 0.11.27", "rustc-hash", "selectors 0.25.0", - "smallvec", + "smallvec 1.13.2", "url", ] @@ -778,7 +956,7 @@ dependencies = [ "phf 0.8.0", "proc-macro2", "quote", - "smallvec", + "smallvec 1.13.2", "syn 1.0.109", ] @@ -792,7 +970,7 @@ dependencies = [ "dtoa-short", "itoa 1.0.11", "phf 0.11.2", - "smallvec", + "smallvec 1.13.2", ] [[package]] @@ -911,7 +1089,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version", + "rustc_version 0.4.0", "syn 2.0.69", ] @@ -975,16 +1153,36 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + [[package]] name = "digest" version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", + "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle", + "subtle 2.6.1", +] + +[[package]] +name = "dirs" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", ] [[package]] @@ -1055,7 +1253,7 @@ version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -1080,7 +1278,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "home", "windows-sys 0.48.0", ] @@ -1091,6 +1289,12 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + [[package]] name = "fast_chemail" version = "0.9.6" @@ -1177,6 +1381,22 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags 1.2.1", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + [[package]] name = "futf" version = "0.1.5" @@ -1187,6 +1407,12 @@ dependencies = [ "new_debug_unreachable", ] +[[package]] +name = "futures" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" + [[package]] name = "futures" version = "0.3.30" @@ -1218,6 +1444,16 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +dependencies = [ + "futures 0.1.31", + "num_cpus", +] + [[package]] name = "futures-executor" version = "0.3.30" @@ -1236,7 +1472,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", - "lock_api", + "lock_api 0.4.12", "parking_lot 0.12.3", ] @@ -1309,6 +1545,15 @@ dependencies = [ "windows 0.48.0", ] +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1326,7 +1571,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" dependencies = [ "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -1344,7 +1589,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -1355,7 +1600,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -1546,13 +1791,31 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "h2" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +dependencies = [ + "byteorder", + "bytes 0.4.12", + "fnv", + "futures 0.1.31", + "http 0.1.21", + "indexmap 1.9.3", + "log", + "slab", + "string", + "tokio-io", +] + [[package]] name = "h2" version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ - "bytes", + "bytes 1.6.0", "fnv", "futures-core", "futures-sink", @@ -1560,7 +1823,7 @@ dependencies = [ "http 0.2.12", "indexmap 2.2.6", "slab", - "tokio", + "tokio 1.38.0", "tokio-util", "tracing", ] @@ -1572,14 +1835,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", - "bytes", + "bytes 1.6.0", "fnv", "futures-core", "futures-sink", "http 1.1.0", "indexmap 2.2.6", "slab", - "tokio", + "tokio 1.38.0", "tokio-util", "tracing", ] @@ -1674,7 +1937,17 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "hmac", + "hmac 0.12.1", +] + +[[package]] +name = "hmac" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" +dependencies = [ + "crypto-mac", + "digest 0.8.1", ] [[package]] @@ -1683,7 +1956,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -1738,13 +2011,24 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" +[[package]] +name = "http" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" +dependencies = [ + "bytes 0.4.12", + "fnv", + "itoa 0.4.8", +] + [[package]] name = "http" version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "bytes", + "bytes 1.6.0", "fnv", "itoa 1.0.11", ] @@ -1755,18 +2039,30 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ - "bytes", + "bytes 1.6.0", "fnv", "itoa 1.0.11", ] +[[package]] +name = "http-body" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.31", + "http 0.1.21", + "tokio-buf", +] + [[package]] name = "http-body" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "bytes", + "bytes 1.6.0", "http 0.2.12", "pin-project-lite", ] @@ -1777,7 +2073,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ - "bytes", + "bytes 1.6.0", "http 1.1.0", ] @@ -1787,7 +2083,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ - "bytes", + "bytes 1.6.0", "futures-util", "http 1.1.0", "http-body 1.0.1", @@ -1812,13 +2108,43 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" +[[package]] +name = "hyper" +version = "0.12.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.31", + "futures-cpupool", + "h2 0.1.26", + "http 0.1.21", + "http-body 0.1.0", + "httparse", + "iovec", + "itoa 0.4.8", + "log", + "net2", + "rustc_version 0.2.3", + "time 0.1.45", + "tokio 0.1.22", + "tokio-buf", + "tokio-executor", + "tokio-io", + "tokio-reactor", + "tokio-tcp", + "tokio-threadpool", + "tokio-timer", + "want 0.2.0", +] + [[package]] name = "hyper" version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ - "bytes", + "bytes 1.6.0", "futures-channel", "futures-core", "futures-util", @@ -1830,10 +2156,10 @@ dependencies = [ "itoa 1.0.11", "pin-project-lite", "socket2", - "tokio", + "tokio 1.38.0", "tower-service", "tracing", - "want", + "want 0.3.1", ] [[package]] @@ -1842,7 +2168,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ - "bytes", + "bytes 1.6.0", "futures-channel", "futures-util", "h2 0.4.6", @@ -1851,9 +2177,9 @@ dependencies = [ "httparse", "itoa 1.0.11", "pin-project-lite", - "smallvec", - "tokio", - "want", + "smallvec 1.13.2", + "tokio 1.38.0", + "want 0.3.1", ] [[package]] @@ -1866,7 +2192,7 @@ dependencies = [ "http 0.2.12", "hyper 0.14.29", "rustls 0.21.12", - "tokio", + "tokio 1.38.0", "tokio-rustls 0.24.1", ] @@ -1882,23 +2208,36 @@ dependencies = [ "hyper-util", "rustls 0.23.12", "rustls-pki-types", - "tokio", + "tokio 1.38.0", "tokio-rustls 0.26.0", "tower-service", ] +[[package]] +name = "hyper-tls" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.31", + "hyper 0.12.36", + "native-tls", + "tokio-io", +] + [[package]] name = "hyper-tls" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ - "bytes", + "bytes 1.6.0", "http-body-util", "hyper 1.4.1", "hyper-util", "native-tls", - "tokio", + "tokio 1.38.0", "tokio-native-tls", "tower-service", ] @@ -1909,7 +2248,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ - "bytes", + "bytes 1.6.0", "futures-channel", "futures-util", "http 1.1.0", @@ -1917,7 +2256,7 @@ dependencies = [ "hyper 1.4.1", "pin-project-lite", "socket2", - "tokio", + "tokio 1.38.0", "tower", "tower-service", "tracing", @@ -2023,12 +2362,21 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", ] +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + [[package]] name = "ipnet" version = "2.9.0" @@ -2094,6 +2442,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -2202,6 +2560,15 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] + [[package]] name = "lock_api" version = "0.4.12" @@ -2225,7 +2592,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4629ff9c2deeb7aad9b2d0f379fc41937a02f3b739f007732c46af40339dee5" dependencies = [ "bitflags 2.6.0", - "cfg-if", + "cfg-if 1.0.0", "cssparser 0.27.2", "encoding_rs", "hashbrown 0.13.2", @@ -2243,7 +2610,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "generator", "scoped-tls", "serde", @@ -2333,16 +2700,28 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + [[package]] name = "md-5" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "cfg-if", - "digest", + "cfg-if 1.0.0", + "digest 0.10.7", ] +[[package]] +name = "md5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" + [[package]] name = "measure_time" version = "0.8.3" @@ -2366,7 +2745,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" dependencies = [ "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -2378,6 +2757,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -2393,6 +2781,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -2408,6 +2806,25 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow 0.2.2", + "net2", + "slab", + "winapi 0.2.8", +] + [[package]] name = "mio" version = "0.8.11" @@ -2419,13 +2836,57 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mio-named-pipes" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" +dependencies = [ + "log", + "mio 0.6.23", + "miow 0.3.7", + "winapi 0.3.9", +] + +[[package]] +name = "mio-uds" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" +dependencies = [ + "iovec", + "libc", + "mio 0.6.23", +] + +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "multer" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" dependencies = [ - "bytes", + "bytes 1.6.0", "encoding_rs", "futures-util", "http 0.2.12", @@ -2443,7 +2904,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" dependencies = [ - "bytes", + "bytes 1.6.0", "encoding_rs", "futures-util", "http 1.1.0", @@ -2451,7 +2912,7 @@ dependencies = [ "memchr", "mime", "spin", - "tokio", + "tokio 1.38.0", "tokio-util", "version_check", ] @@ -2479,6 +2940,17 @@ dependencies = [ "tempfile", ] +[[package]] +name = "net2" +version = "0.2.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -2493,9 +2965,9 @@ checksum = "77d9f3521ea8e0641a153b3cddaf008dcbf26acd4ed739a2517295e0760d12c7" dependencies = [ "bitflags 1.2.1", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -2550,7 +3022,7 @@ dependencies = [ "num-iter", "num-traits", "rand 0.8.5", - "smallvec", + "smallvec 1.13.2", "zeroize", ] @@ -2621,6 +3093,12 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e296cf87e61c9cfc1a61c3c63a0f7f286ed4554e0e22be84e8a38e1d264a2a29" +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + [[package]] name = "openssl" version = "0.10.66" @@ -2628,7 +3106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.6.0", - "cfg-if", + "cfg-if 1.0.0", "foreign-types", "libc", "once_cell", @@ -2683,6 +3161,17 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +dependencies = [ + "lock_api 0.3.4", + "parking_lot_core 0.6.3", + "rustc_version 0.2.3", +] + [[package]] name = "parking_lot" version = "0.11.2" @@ -2690,7 +3179,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", - "lock_api", + "lock_api 0.4.12", "parking_lot_core 0.8.6", ] @@ -2700,22 +3189,37 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ - "lock_api", + "lock_api 0.4.12", "parking_lot_core 0.9.10", ] +[[package]] +name = "parking_lot_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66b810a62be75176a80873726630147a5ca780cd33921e0b5709033e66b0a" +dependencies = [ + "cfg-if 0.1.10", + "cloudabi", + "libc", + "redox_syscall 0.1.57", + "rustc_version 0.2.3", + "smallvec 0.6.14", + "winapi 0.3.9", +] + [[package]] name = "parking_lot_core" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "instant", "libc", "redox_syscall 0.2.16", - "smallvec", - "winapi", + "smallvec 1.13.2", + "winapi 0.3.9", ] [[package]] @@ -2724,10 +3228,10 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall 0.5.2", - "smallvec", + "smallvec 1.13.2", "windows-targets 0.52.6", ] @@ -2817,7 +3321,7 @@ checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", - "sha2", + "sha2 0.10.8", ] [[package]] @@ -3248,10 +3752,16 @@ version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-deque", - "crossbeam-utils", + "crossbeam-deque 0.8.5", + "crossbeam-utils 0.8.20", ] +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + [[package]] name = "redox_syscall" version = "0.2.16" @@ -3279,6 +3789,17 @@ dependencies = [ "bitflags 2.6.0", ] +[[package]] +name = "redox_users" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +dependencies = [ + "getrandom 0.1.16", + "redox_syscall 0.1.57", + "rust-argon2", +] + [[package]] name = "ref-cast" version = "1.0.23" @@ -3350,7 +3871,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", - "bytes", + "bytes 1.6.0", "encoding_rs", "futures-core", "futures-util", @@ -3373,7 +3894,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 0.1.2", "system-configuration 0.5.1", - "tokio", + "tokio 1.38.0", "tokio-rustls 0.24.1", "tower-service", "url", @@ -3391,7 +3912,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64 0.22.1", - "bytes", + "bytes 1.6.0", "encoding_rs", "futures-channel", "futures-core", @@ -3402,7 +3923,7 @@ dependencies = [ "http-body-util", "hyper 1.4.1", "hyper-rustls 0.27.2", - "hyper-tls", + "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", @@ -3418,7 +3939,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 1.0.1", "system-configuration 0.6.1", - "tokio", + "tokio 1.38.0", "tokio-native-tls", "tower-service", "url", @@ -3435,7 +3956,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if", + "cfg-if 1.0.0", "getrandom 0.2.15", "libc", "spin", @@ -3453,10 +3974,10 @@ dependencies = [ "async-trait", "atomic 0.5.3", "binascii", - "bytes", + "bytes 1.6.0", "either", "figment", - "futures", + "futures 0.3.30", "indexmap 2.2.6", "log", "memchr", @@ -3472,8 +3993,8 @@ dependencies = [ "serde_json", "state", "tempfile", - "time", - "tokio", + "time 0.3.36", + "tokio 1.38.0", "tokio-stream", "tokio-util", "ubyte", @@ -3523,7 +4044,7 @@ checksum = "e274915a20ee3065f611c044bd63c40757396b6dbc057d6046aec27f14f882b9" dependencies = [ "cookie", "either", - "futures", + "futures 0.3.30", "http 0.2.12", "hyper 0.14.29", "indexmap 2.2.6", @@ -3534,11 +4055,11 @@ dependencies = [ "pin-project-lite", "ref-cast", "serde", - "smallvec", + "smallvec 1.13.2", "stable-pattern", "state", - "time", - "tokio", + "time 0.3.36", + "tokio 1.38.0", "uncased", ] @@ -3549,7 +4070,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ "const-oid", - "digest", + "digest 0.10.7", "num-bigint-dig", "num-integer", "num-traits", @@ -3558,10 +4079,104 @@ dependencies = [ "rand_core 0.6.4", "signature", "spki", - "subtle", + "subtle 2.6.1", "zeroize", ] +[[package]] +name = "rusoto_core" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d1ecfe8dac29878a713fbc4c36b0a84a48f7a6883541841cdff9fdd2ba7dfb" +dependencies = [ + "base64 0.11.0", + "bytes 0.4.12", + "futures 0.1.31", + "http 0.1.21", + "hyper 0.12.36", + "hyper-tls 0.3.2", + "lazy_static", + "log", + "rusoto_credential", + "rusoto_signature", + "rustc_version 0.2.3", + "serde", + "serde_derive", + "serde_json", + "time 0.1.45", + "tokio 0.1.22", + "tokio-timer", + "xml-rs", +] + +[[package]] +name = "rusoto_credential" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8632e41d289db90dd40d0389c71a23c5489e3afd448424226529113102e2a002" +dependencies = [ + "chrono", + "dirs", + "futures 0.1.31", + "hyper 0.12.36", + "lazy_static", + "regex", + "serde", + "serde_derive", + "serde_json", + "shlex", + "tokio-process", + "tokio-timer", +] + +[[package]] +name = "rusoto_s3" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fedcadf3d73c2925b05d547b66787f2219c5e727a98c893fff5cf2197dbd678" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.31", + "rusoto_core", + "xml-rs", +] + +[[package]] +name = "rusoto_signature" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7063a70614eb4b36f49bcf4f6f6bb30cc765e3072b317d6afdfe51e7a9f482d1" +dependencies = [ + "base64 0.11.0", + "bytes 0.4.12", + "futures 0.1.31", + "hex", + "hmac 0.7.1", + "http 0.1.21", + "hyper 0.12.36", + "log", + "md5", + "percent-encoding", + "rusoto_credential", + "rustc_version 0.2.3", + "serde", + "sha2 0.8.2", + "time 0.1.45", + "tokio 0.1.22", +] + +[[package]] +name = "rust-argon2" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" +dependencies = [ + "base64 0.13.1", + "blake2b_simd", + "constant_time_eq", + "crossbeam-utils 0.8.20", +] + [[package]] name = "rust-stemmers" version = "1.2.0" @@ -3584,13 +4199,22 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.23", ] [[package]] @@ -3627,7 +4251,7 @@ dependencies = [ "once_cell", "rustls-pki-types", "rustls-webpki 0.102.6", - "subtle", + "subtle 2.6.1", "zeroize", ] @@ -3766,7 +4390,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c0e296ea0569d20467e9a1df3cb6ed66ce3b791a7eaf1e1110ae231f75e2b46" dependencies = [ "enclose", - "futures", + "futures 0.3.30", "getrandom 0.2.15", "gloo-file", "gloo-timers", @@ -3811,7 +4435,7 @@ dependencies = [ "phf_codegen 0.8.0", "precomputed-hash", "servo_arc 0.1.1", - "smallvec", + "smallvec 1.13.2", "thin-slice", ] @@ -3831,7 +4455,16 @@ dependencies = [ "phf_codegen 0.10.0", "precomputed-hash", "servo_arc 0.3.0", - "smallvec", + "smallvec 1.13.2", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", ] [[package]] @@ -3843,6 +4476,12 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + [[package]] name = "serde" version = "1.0.204" @@ -3917,6 +4556,7 @@ dependencies = [ "async-trait", "build-info", "build-info-build", + "cacher", "css-inline", "glog", "html-escape", @@ -3937,7 +4577,7 @@ dependencies = [ "sqlx", "tantivy", "thiserror", - "tokio", + "tokio 1.38.0", "url", "urlencoding", ] @@ -3967,9 +4607,21 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", - "digest", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug", ] [[package]] @@ -3978,9 +4630,9 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -4001,6 +4653,12 @@ dependencies = [ "serde", ] +[[package]] +name = "shlex" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -4016,7 +4674,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest", + "digest 0.10.7", "rand_core 0.6.4", ] @@ -4053,6 +4711,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "smallvec" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" +dependencies = [ + "maybe-uninit", +] + [[package]] name = "smallvec" version = "1.13.2" @@ -4075,7 +4742,7 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ - "lock_api", + "lock_api 0.4.12", ] [[package]] @@ -4120,9 +4787,9 @@ dependencies = [ "ahash 0.8.11", "atoi", "byteorder", - "bytes", + "bytes 1.6.0", "crc", - "crossbeam-queue", + "crossbeam-queue 0.3.11", "either", "event-listener", "futures-channel", @@ -4140,12 +4807,12 @@ dependencies = [ "percent-encoding", "serde", "serde_json", - "sha2", - "smallvec", + "sha2 0.10.8", + "smallvec 1.13.2", "sqlformat", "thiserror", - "time", - "tokio", + "time 0.3.36", + "tokio 1.38.0", "tokio-stream", "tracing", "url", @@ -4179,14 +4846,14 @@ dependencies = [ "quote", "serde", "serde_json", - "sha2", + "sha2 0.10.8", "sqlx-core", "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", "syn 1.0.109", "tempfile", - "tokio", + "tokio 1.38.0", "url", ] @@ -4200,19 +4867,19 @@ dependencies = [ "base64 0.21.7", "bitflags 2.6.0", "byteorder", - "bytes", + "bytes 1.6.0", "crc", - "digest", + "digest 0.10.7", "dotenvy", "either", "futures-channel", "futures-core", "futures-io", "futures-util", - "generic-array", + "generic-array 0.14.7", "hex", "hkdf", - "hmac", + "hmac 0.12.1", "itoa 1.0.11", "log", "md-5", @@ -4223,12 +4890,12 @@ dependencies = [ "rsa", "serde", "sha1", - "sha2", - "smallvec", + "sha2 0.10.8", + "smallvec 1.13.2", "sqlx-core", "stringprep", "thiserror", - "time", + "time 0.3.36", "tracing", "whoami", ] @@ -4252,7 +4919,7 @@ dependencies = [ "futures-util", "hex", "hkdf", - "hmac", + "hmac 0.12.1", "home", "itoa 1.0.11", "log", @@ -4262,12 +4929,12 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "sha2", - "smallvec", + "sha2 0.10.8", + "smallvec 1.13.2", "sqlx-core", "stringprep", "thiserror", - "time", + "time 0.3.36", "tracing", "whoami", ] @@ -4290,7 +4957,7 @@ dependencies = [ "percent-encoding", "serde", "sqlx-core", - "time", + "time 0.3.36", "tracing", "url", "urlencoding", @@ -4326,6 +4993,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "string" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" +dependencies = [ + "bytes 0.4.12", +] + [[package]] name = "string_cache" version = "0.8.7" @@ -4397,6 +5073,12 @@ dependencies = [ "syn 2.0.69", ] +[[package]] +name = "subtle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" + [[package]] name = "subtle" version = "2.6.1" @@ -4518,7 +5200,7 @@ dependencies = [ "serde", "serde_json", "sketches-ddsketch", - "smallvec", + "smallvec 1.13.2", "tantivy-bitpacker", "tantivy-columnar", "tantivy-common", @@ -4528,9 +5210,9 @@ dependencies = [ "tantivy-tokenizer-api", "tempfile", "thiserror", - "time", + "time 0.3.36", "uuid", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -4568,7 +5250,7 @@ dependencies = [ "byteorder", "ownedbytes", "serde", - "time", + "time 0.3.36", ] [[package]] @@ -4629,7 +5311,7 @@ version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fastrand", "rustix", "windows-sys 0.52.0", @@ -4690,6 +5372,17 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi 0.3.9", +] + [[package]] name = "time" version = "0.3.36" @@ -4736,6 +5429,30 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.31", + "mio 0.6.23", + "num_cpus", + "tokio-codec", + "tokio-current-thread", + "tokio-executor", + "tokio-fs", + "tokio-io", + "tokio-reactor", + "tokio-sync", + "tokio-tcp", + "tokio-threadpool", + "tokio-timer", + "tokio-udp", + "tokio-uds", +] + [[package]] name = "tokio" version = "1.38.0" @@ -4743,9 +5460,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", - "bytes", + "bytes 1.6.0", "libc", - "mio", + "mio 0.8.11", "num_cpus", "pin-project-lite", "signal-hook-registry", @@ -4754,6 +5471,70 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "tokio-buf" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" +dependencies = [ + "bytes 0.4.12", + "either", + "futures 0.1.31", +] + +[[package]] +name = "tokio-codec" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.31", + "tokio-io", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" +dependencies = [ + "futures 0.1.31", + "tokio-executor", +] + +[[package]] +name = "tokio-executor" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" +dependencies = [ + "crossbeam-utils 0.7.2", + "futures 0.1.31", +] + +[[package]] +name = "tokio-fs" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" +dependencies = [ + "futures 0.1.31", + "tokio-io", + "tokio-threadpool", +] + +[[package]] +name = "tokio-io" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.31", + "log", +] + [[package]] name = "tokio-macros" version = "2.3.0" @@ -4772,7 +5553,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", - "tokio", + "tokio 1.38.0", +] + +[[package]] +name = "tokio-process" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382d90f43fa31caebe5d3bc6cfd854963394fff3b8cb59d5146607aaae7e7e43" +dependencies = [ + "crossbeam-queue 0.1.2", + "futures 0.1.31", + "lazy_static", + "libc", + "log", + "mio 0.6.23", + "mio-named-pipes", + "tokio-io", + "tokio-reactor", + "tokio-signal", + "winapi 0.3.9", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" +dependencies = [ + "crossbeam-utils 0.7.2", + "futures 0.1.31", + "lazy_static", + "log", + "mio 0.6.23", + "num_cpus", + "parking_lot 0.9.0", + "slab", + "tokio-executor", + "tokio-io", + "tokio-sync", ] [[package]] @@ -4782,7 +5601,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls 0.21.12", - "tokio", + "tokio 1.38.0", ] [[package]] @@ -4793,7 +5612,24 @@ checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls 0.23.12", "rustls-pki-types", - "tokio", + "tokio 1.38.0", +] + +[[package]] +name = "tokio-signal" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0c34c6e548f101053321cba3da7cbb87a610b85555884c41b07da2eb91aff12" +dependencies = [ + "futures 0.1.31", + "libc", + "mio 0.6.23", + "mio-uds", + "signal-hook-registry", + "tokio-executor", + "tokio-io", + "tokio-reactor", + "winapi 0.3.9", ] [[package]] @@ -4804,7 +5640,93 @@ checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", - "tokio", + "tokio 1.38.0", +] + +[[package]] +name = "tokio-sync" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +dependencies = [ + "fnv", + "futures 0.1.31", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.31", + "iovec", + "mio 0.6.23", + "tokio-io", + "tokio-reactor", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +dependencies = [ + "crossbeam-deque 0.7.4", + "crossbeam-queue 0.2.3", + "crossbeam-utils 0.7.2", + "futures 0.1.31", + "lazy_static", + "log", + "num_cpus", + "slab", + "tokio-executor", +] + +[[package]] +name = "tokio-timer" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +dependencies = [ + "crossbeam-utils 0.7.2", + "futures 0.1.31", + "slab", + "tokio-executor", +] + +[[package]] +name = "tokio-udp" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.31", + "log", + "mio 0.6.23", + "tokio-codec", + "tokio-io", + "tokio-reactor", +] + +[[package]] +name = "tokio-uds" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.31", + "iovec", + "libc", + "log", + "mio 0.6.23", + "mio-uds", + "tokio-codec", + "tokio-io", + "tokio-reactor", ] [[package]] @@ -4813,12 +5735,12 @@ version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ - "bytes", + "bytes 1.6.0", "futures-core", "futures-io", "futures-sink", "pin-project-lite", - "tokio", + "tokio 1.38.0", ] [[package]] @@ -4899,7 +5821,7 @@ dependencies = [ "futures-util", "pin-project", "pin-project-lite", - "tokio", + "tokio 1.38.0", "tower-layer", "tower-service", ] @@ -4971,7 +5893,7 @@ dependencies = [ "matchers", "regex", "sharded-slab", - "smallvec", + "smallvec 1.13.2", "thread_local", "tracing", "tracing-core", @@ -5169,6 +6091,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "want" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +dependencies = [ + "futures 0.1.31", + "log", + "try-lock", +] + [[package]] name = "want" version = "0.3.1" @@ -5184,6 +6117,12 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -5202,7 +6141,7 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen-macro", ] @@ -5227,7 +6166,7 @@ version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -5314,6 +6253,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + [[package]] name = "winapi" version = "0.3.9" @@ -5324,6 +6269,12 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -5583,10 +6534,26 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-sys 0.48.0", ] +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "xml-rs" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" + [[package]] name = "yansi" version = "0.5.1" diff --git a/server/Cargo.toml b/server/Cargo.toml index 9002edb..39159a3 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -13,6 +13,7 @@ async-graphql = { version = "6.0.11", features = ["log"] } async-graphql-rocket = "6.0.11" async-trait = "0.1.81" build-info = "0.0.38" +cacher = {git = "https://git-private.z.xinu.tv/wathiede/cacher"} css-inline = "0.13.0" glog = "0.1.0" html-escape = "0.2.13" diff --git a/server/Rocket.toml b/server/Rocket.toml index fc64944..3178201 100644 --- a/server/Rocket.toml +++ b/server/Rocket.toml @@ -1,6 +1,8 @@ [release] address = "0.0.0.0" port = 9345 +newsreader_database_url = "postgres://newsreader@nixos-07.h.xinu.tv/newsreader" +newsreader_tantivy_db_path = "../target/database/newsreader" [debug] address = "0.0.0.0" @@ -8,3 +10,5 @@ port = 9345 # Uncomment to make it production like. #log_level = "critical" newsreader_database_url = "postgres://newsreader@nixos-07.h.xinu.tv/newsreader" +newsreader_tantivy_db_path = "../target/database/newsreader" +slurp_cache_path = "/net/nasx/x/letterbox/slurp" diff --git a/server/sql/all-posts.sql b/server/sql/all-posts.sql new file mode 100644 index 0000000..ea70efd --- /dev/null +++ b/server/sql/all-posts.sql @@ -0,0 +1,10 @@ +SELECT + site, + title, + summary, + link, + date, + is_read, + uid, + id +FROM post diff --git a/server/src/bin/server.rs b/server/src/bin/server.rs index 2a6b2a4..3e31bd1 100644 --- a/server/src/bin/server.rs +++ b/server/src/bin/server.rs @@ -18,18 +18,14 @@ use rocket::{ Response, State, }; use rocket_cors::{AllowedHeaders, AllowedOrigins}; -use serde::Deserialize; use server::{ + config::Config, error::ServerError, graphql::{Attachment, GraphqlSchema, Mutation, QueryRoot}, nm::{attachment_bytes, cid_attachment_bytes}, }; use sqlx::postgres::PgPool; - -#[derive(Deserialize)] -struct Config { - newsreader_database_url: String, -} +use tantivy::{Index, IndexWriter}; #[get("/refresh")] async fn refresh(nm: &State) -> Result, Debug> { @@ -170,6 +166,122 @@ fn graphiql() -> content::RawHtml { content::RawHtml(GraphiQLSource::build().endpoint("/api/graphql").finish()) } +#[rocket::post("/create-news-db")] +fn create_news_db(config: &State) -> Result> { + std::fs::remove_dir_all(&config.newsreader_tantivy_db_path).map_err(ServerError::from)?; + std::fs::create_dir_all(&config.newsreader_tantivy_db_path).map_err(ServerError::from)?; + use tantivy::schema::*; + let mut schema_builder = Schema::builder(); + schema_builder.add_text_field("site", STRING | STORED); + schema_builder.add_text_field("title", TEXT | STORED); + schema_builder.add_text_field("summary", TEXT); + schema_builder.add_text_field("link", STRING | STORED); + schema_builder.add_date_field("date", FAST); + schema_builder.add_bool_field("is_read", FAST); + schema_builder.add_text_field("uid", STRING | STORED); + schema_builder.add_i64_field("id", FAST); + + let schema = schema_builder.build(); + Index::create_in_dir(&config.newsreader_tantivy_db_path, schema).map_err(ServerError::from)?; + Ok(format!( + "DB created in {}\n", + config.newsreader_tantivy_db_path + )) +} + +#[rocket::post("/reindex-news-db")] +async fn reindex_news_db( + pool: &State, + config: &State, +) -> Result> { + use tantivy::{doc, Term}; + + let start_time = std::time::Instant::now(); + let pool: &PgPool = pool; + + let index = + Index::open_in_dir(&config.newsreader_tantivy_db_path).map_err(ServerError::from)?; + let mut index_writer = index.writer(50_000_000).map_err(ServerError::from)?; + let schema = index.schema(); + let site = schema.get_field("site").map_err(ServerError::from)?; + let title = schema.get_field("title").map_err(ServerError::from)?; + let summary = schema.get_field("summary").map_err(ServerError::from)?; + let link = schema.get_field("link").map_err(ServerError::from)?; + let date = schema.get_field("date").map_err(ServerError::from)?; + let is_read = schema.get_field("is_read").map_err(ServerError::from)?; + let uid = schema.get_field("uid").map_err(ServerError::from)?; + let id = schema.get_field("id").map_err(ServerError::from)?; + + let rows = sqlx::query_file!("sql/all-posts.sql") + .fetch_all(pool) + .await + .map_err(ServerError::from)?; + + let total = rows.len(); + for (i, r) in rows.into_iter().enumerate() { + if i % 10_000 == 0 { + info!( + "{i}/{total} processed, elapsed {:.2}s", + start_time.elapsed().as_secs_f32() + ); + } + let id_term = Term::from_field_text(uid, &r.uid); + index_writer.delete_term(id_term); + index_writer + .add_document(doc!( + site => r.site.expect("UNKOWN_SITE"), + title => r.title.expect("UNKOWN_TITLE"), + // TODO: clean and extract text from HTML + summary => r.summary.expect("UNKNOWN_SUMMARY"), + link => r.link.expect("link"), + date => tantivy::DateTime::from_primitive(r.date.expect("date")), + is_read => r.is_read.expect("is_read"), + uid => r.uid, + id => r.id as i64, + )) + .map_err(ServerError::from)?; + } + + index_writer.commit().map_err(ServerError::from)?; + + info!("took {:.2}s to reindex", start_time.elapsed().as_secs_f32()); + Ok(format!( + "DB openned in {}\n", + config.newsreader_tantivy_db_path + )) +} + +#[rocket::get("/search-news-db")] +fn search_news_db( + index: &State, + reader: &State, +) -> Result> { + use tantivy::{collector::TopDocs, query::QueryParser, Document, TantivyDocument}; + + let searcher = reader.searcher(); + let schema = index.schema(); + let site = schema.get_field("site").map_err(ServerError::from)?; + let title = schema.get_field("title").map_err(ServerError::from)?; + let summary = schema.get_field("summary").map_err(ServerError::from)?; + let query_parser = QueryParser::for_index(&index, vec![site, title, summary]); + + let query = query_parser + .parse_query("grapheme") + .map_err(ServerError::from)?; + let top_docs = searcher + .search(&query, &TopDocs::with_limit(10)) + .map_err(ServerError::from)?; + let mut results = vec![]; + info!("search found {} docs", top_docs.len()); + for (_score, doc_address) in top_docs { + let retrieved_doc: TantivyDocument = + searcher.doc(doc_address).map_err(ServerError::from)?; + results.push(format!("{}", retrieved_doc.to_json(&schema))); + } + + Ok(format!("{}", results.join(" "))) +} + #[rocket::get("/graphql?")] async fn graphql_query(schema: &State, query: GraphQLQuery) -> GraphQLResponse { query.execute(schema.inner()).await @@ -183,7 +295,6 @@ async fn graphql_request( request.execute(schema.inner()).await } - #[rocket::main] async fn main() -> Result<(), Box> { glog::new() @@ -213,6 +324,9 @@ async fn main() -> Result<(), Box> { .mount( shared::urls::MOUNT_POINT, routes![ + create_news_db, + reindex_news_db, + search_news_db, original, refresh, show_pretty, @@ -229,14 +343,26 @@ async fn main() -> Result<(), Box> { .attach(AdHoc::config::()); let config: Config = rkt.figment().extract()?; + if !std::fs::exists(&config.slurp_cache_path)? { + info!("Creating slurp cache @ '{}'", &config.slurp_cache_path); + std::fs::create_dir_all(&config.slurp_cache_path)?; + } let pool = PgPool::connect(&config.newsreader_database_url).await?; + let tantivy_newsreader_index = Index::open_in_dir(&config.newsreader_tantivy_db_path)?; + let tantivy_newsreader_reader = tantivy_newsreader_index.reader()?; let schema = Schema::build(QueryRoot, Mutation, EmptySubscription) .data(Notmuch::default()) + .data(config) .data(pool.clone()) .extension(async_graphql::extensions::Logger) .finish(); - let rkt = rkt.manage(schema).manage(pool).manage(Notmuch::default()); + let rkt = rkt + .manage(schema) + .manage(pool) + .manage(Notmuch::default()) + .manage(tantivy_newsreader_index) + .manage(tantivy_newsreader_reader); //.manage(Notmuch::with_config("../notmuch/testdata/notmuch.config")) rkt.launch().await?; diff --git a/server/src/config.rs b/server/src/config.rs new file mode 100644 index 0000000..15fe116 --- /dev/null +++ b/server/src/config.rs @@ -0,0 +1,7 @@ +use serde::Deserialize; +#[derive(Deserialize)] +pub struct Config { + pub newsreader_database_url: String, + pub newsreader_tantivy_db_path: String, + pub slurp_cache_path: String, +} diff --git a/server/src/error.rs b/server/src/error.rs index 7797c16..f07142c 100644 --- a/server/src/error.rs +++ b/server/src/error.rs @@ -1,6 +1,8 @@ use std::{convert::Infallible, str::Utf8Error, string::FromUtf8Error}; use mailparse::MailParseError; +use tantivy::TantivyError; +use tantivy::query::QueryParserError; use thiserror::Error; use crate::TransformError; @@ -29,6 +31,10 @@ pub enum ServerError { StringError(String), #[error("invalid url: {0}")] UrlParseError(#[from] url::ParseError), + #[error("tantivy error: {0}")] + TantivyError(#[from] TantivyError), + #[error("tantivy query parse error: {0}")] + QueryParseError(#[from] QueryParserError), #[error("impossible: {0}")] InfaillibleError(#[from] Infallible), } diff --git a/server/src/graphql.rs b/server/src/graphql.rs index 2aa5a78..a9ae478 100644 --- a/server/src/graphql.rs +++ b/server/src/graphql.rs @@ -8,7 +8,7 @@ use notmuch::Notmuch; use serde::{Deserialize, Serialize}; use sqlx::postgres::PgPool; -use crate::{newsreader, nm, Query}; +use crate::{config::Config, newsreader, nm, Query}; /// # Number of seconds since the Epoch pub type UnixTime = isize; @@ -384,6 +384,7 @@ impl QueryRoot { async fn thread<'ctx>(&self, ctx: &Context<'ctx>, thread_id: String) -> Result { let nm = ctx.data_unchecked::(); let pool = ctx.data_unchecked::(); + let config = ctx.data_unchecked::(); let debug_content_tree = ctx .look_ahead() .field("messages") @@ -392,7 +393,7 @@ impl QueryRoot { .exists(); // TODO: look at thread_id and conditionally load newsreader if newsreader::is_newsreader_thread(&thread_id) { - Ok(newsreader::thread(pool, thread_id).await?) + Ok(newsreader::thread(config, pool, thread_id).await?) } else { Ok(nm::thread(nm, thread_id, debug_content_tree).await?) } diff --git a/server/src/lib.rs b/server/src/lib.rs index 47892c3..04d8b19 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -1,14 +1,16 @@ +pub mod config; pub mod error; pub mod graphql; pub mod newsreader; pub mod nm; -use std::{collections::HashMap, convert::Infallible, str::FromStr}; +use std::{collections::HashMap, convert::Infallible, str::FromStr, sync::Arc}; use async_trait::async_trait; +use cacher::{Cacher, FilesystemCacher}; use css_inline::{CSSInliner, InlineError, InlineOptions}; use linkify::{LinkFinder, LinkKind}; -use log::{error, warn}; +use log::{error, info, warn}; use lol_html::{ element, errors::RewritingError, html_content::ContentType, rewrite_str, text, RewriteStrSettings, @@ -16,6 +18,7 @@ use lol_html::{ use maplit::{hashmap, hashset}; use scraper::{Html, Selector}; use thiserror::Error; +use tokio::sync::Mutex; use url::Url; use crate::newsreader::{extract_thread_id, is_newsreader_thread}; @@ -109,16 +112,17 @@ impl Transformer for InlineStyle { include_str!("custom.css"), ); let inline_opts = InlineOptions { - inline_style_tags: false, + inline_style_tags: true, keep_style_tags: false, - keep_link_tags: false, + keep_link_tags: true, base_url: None, - load_remote_stylesheets: false, + load_remote_stylesheets: true, extra_css: Some(css.into()), preallocate_node_capacity: 32, ..InlineOptions::default() }; + //info!("HTML:\n{html}"); Ok(match CSSInliner::new(inline_opts).inline(&html) { Ok(inlined_html) => inlined_html, Err(err) => { @@ -212,6 +216,7 @@ impl Transformer for AddOutlink { } struct SlurpContents { + cacher: Arc>, site_selectors: HashMap>, } @@ -241,19 +246,26 @@ impl Transformer for SlurpContents { let Some(selectors) = self.get_selectors(&link) else { return Ok(html.to_string()); }; - let body = reqwest::get(link.as_str()).await?.text().await?; + let mut cacher = self.cacher.lock().await; + let body = if let Some(body) = cacher.get(link.as_str()) { + info!("cache hit for {link}"); + String::from_utf8_lossy(&body).to_string() + } else { + let body = reqwest::get(link.as_str()).await?.text().await?; + cacher.set(link.as_str(), body.as_bytes()); + body + }; let doc = Html::parse_document(&body); let mut results = Vec::new(); for selector in selectors { - if let Some(frag) = doc.select(&selector).next() { + for frag in doc.select(&selector) { results.push(frag.html()) - } else { - warn!("couldn't find '{:?}' in {}", selector, link); - return Ok(html.to_string()); + // TODO: figure out how to warn if there were no hits + //warn!("couldn't find '{:?}' in {}", selector, link); } } - Ok(results.join("

")) + Ok(results.join("")) } } @@ -292,7 +304,7 @@ pub fn sanitize_html( ) -> Result { let inline_opts = InlineOptions { inline_style_tags: true, - keep_style_tags: false, + keep_style_tags: true, keep_link_tags: false, base_url: None, load_remote_stylesheets: false, @@ -335,6 +347,30 @@ pub fn sanitize_html( el.set_attribute("src", &src)?; + Ok(()) + }), + // Add https to href with // + element!("link[href]", |el| { + info!("found link[href] {el:?}"); + let mut href = el.get_attribute("href").expect("href was required"); + if href.starts_with("//") { + warn!("adding https to {href}"); + href.insert_str(0, "https:"); + } + + el.set_attribute("href", &href)?; + + Ok(()) + }), + // Add https to src with // + element!("style[src]", |el| { + let mut src = el.get_attribute("src").expect("src was required"); + if src.starts_with("//") { + src.insert_str(0, "https:"); + } + + el.set_attribute("src", &src)?; + Ok(()) }), ]; diff --git a/server/src/newsreader.rs b/server/src/newsreader.rs index b33a566..bbf4ff0 100644 --- a/server/src/newsreader.rs +++ b/server/src/newsreader.rs @@ -1,24 +1,26 @@ -use std::hash::{DefaultHasher, Hash, Hasher}; +use std::sync::Arc; +use cacher::FilesystemCacher; use log::info; use maplit::hashmap; use scraper::Selector; +use shared::compute_color; use sqlx::postgres::PgPool; +use tokio::sync::Mutex; use url::Url; -use crate::Query; - -const TAG_PREFIX: &'static str = "News/"; -const THREAD_PREFIX: &'static str = "news:"; - use crate::{ compute_offset_limit, + config::Config, error::ServerError, graphql::{NewsPost, Tag, Thread, ThreadSummary}, - AddOutlink, EscapeHtml, FrameImages, InlineStyle, SanitizeHtml, SlurpContents, StripHtml, - Transformer, + AddOutlink, EscapeHtml, FrameImages, InlineStyle, Query, SanitizeHtml, SlurpContents, + StripHtml, Transformer, }; +const TAG_PREFIX: &'static str = "News/"; +const THREAD_PREFIX: &'static str = "news:"; + pub fn is_newsreader_search(query: &str) -> bool { query.contains(TAG_PREFIX) } @@ -128,11 +130,9 @@ pub async fn tags(pool: &PgPool, _needs_unread: bool) -> Result, Server let tags = tags .into_iter() .map(|tag| { - let mut hasher = DefaultHasher::new(); - tag.site.hash(&mut hasher); - let hex = format!("#{:06x}", hasher.finish() % (1 << 24)); let unread = tag.unread.unwrap_or(0).try_into().unwrap_or(0); let name = format!("{TAG_PREFIX}{}", tag.site.expect("tag must have site")); + let hex = compute_color(&name); Tag { name, fg_color: "white".to_string(), @@ -144,7 +144,11 @@ pub async fn tags(pool: &PgPool, _needs_unread: bool) -> Result, Server Ok(tags) } -pub async fn thread(pool: &PgPool, thread_id: String) -> Result { +pub async fn thread( + config: &Config, + pool: &PgPool, + thread_id: String, +) -> Result { let id = thread_id .strip_prefix(THREAD_PREFIX) .expect("news thread doesn't start with '{THREAD_PREFIX}'") @@ -173,8 +177,10 @@ pub async fn thread(pool: &PgPool, thread_id: String) -> Result // * Some sites appear to be HTML encoded, unencode them, i.e. imperialviolent + let cacher = Arc::new(Mutex::new(FilesystemCacher::new(&config.slurp_cache_path)?)); let body_tranformers: Vec> = vec![ Box::new(SlurpContents { + cacher, site_selectors: hashmap![ "atmeta.com".to_string() => vec![ Selector::parse("div.entry-content").unwrap(),