diff --git a/.circleci/config.yml b/.circleci/config.yml index f5ac952d..62a5643a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ executors: type: boolean default: false docker: - - image: plumeorg/plume-buildenv:v0.7.0 + - image: plumeorg/plume-buildenv:v0.8.0 - image: <<#parameters.postgres>>cimg/postgres:14.2<><<^parameters.postgres>>alpine:latest<> environment: POSTGRES_USER: postgres @@ -63,7 +63,7 @@ commands: type: boolean default: false steps: - - run: rustup component add clippy --toolchain nightly-2022-01-27-x86_64-unknown-linux-gnu + - run: rustup component add clippy --toolchain nightly-2022-07-19-x86_64-unknown-linux-gnu - run: cargo clippy <<^parameters.no_feature>>--no-default-features --features="${FEATURES}"<> --release -p <> -- -D warnings run_with_coverage: @@ -112,7 +112,7 @@ jobs: name: default steps: - restore_env - - run: rustup component add rustfmt --toolchain nightly-2022-01-27-x86_64-unknown-linux-gnu + - run: rustup component add rustfmt --toolchain nightly-2022-07-19-x86_64-unknown-linux-gnu - run: cargo fmt --all -- --check clippy: diff --git a/.circleci/images/plume-buildenv/Dockerfile b/.circleci/images/plume-buildenv/Dockerfile index 216b30e1..ceafef65 100644 --- a/.circleci/images/plume-buildenv/Dockerfile +++ b/.circleci/images/plume-buildenv/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1-buster +FROM rust:1 ENV PATH="/root/.cargo/bin:${PATH}" #install native/circleci/build dependancies @@ -14,6 +14,7 @@ RUN apt update &&\ #stick rust environment COPY rust-toolchain ./ +RUN rustup component add rustfmt clippy #compile some deps RUN cargo install wasm-pack &&\ diff --git a/.circleci/images/plume-buildenv/rust-toolchain b/.circleci/images/plume-buildenv/rust-toolchain index 63af764b..b57117c9 100644 --- a/.circleci/images/plume-buildenv/rust-toolchain +++ b/.circleci/images/plume-buildenv/rust-toolchain @@ -1 +1 @@ -nightly-2022-01-27 +nightly-2022-07-19 diff --git a/.dockerignore b/.dockerignore index 98547cd9..0e8239d0 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,3 +3,5 @@ data Dockerfile docker-compose.yml .env +target +data diff --git a/.github/workflows/deploy-docker-latest.yaml b/.github/workflows/deploy-docker-latest.yaml index 8ff8f7a4..ac989f68 100644 --- a/.github/workflows/deploy-docker-latest.yaml +++ b/.github/workflows/deploy-docker-latest.yaml @@ -11,20 +11,20 @@ jobs: steps: - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3 with: push: true tags: plumeorg/plume:latest diff --git a/.github/workflows/deploy-docker-tag.yaml b/.github/workflows/deploy-docker-tag.yaml index 5e4a764e..73466183 100644 --- a/.github/workflows/deploy-docker-tag.yaml +++ b/.github/workflows/deploy-docker-tag.yaml @@ -11,10 +11,10 @@ jobs: steps: - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Docker meta id: meta @@ -23,14 +23,14 @@ jobs: images: plumeorg/plume - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3 with: push: true tags: ${{ steps.meta.outputs.tags }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a818a97..12cf7c81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,25 @@ ## [Unreleased] - ReleaseDate +### Added + +- Add 'My feed' to i18n timeline name (#1084) +- Bidirectional support for user page header (#1092) + +### Changed + +- Use blog title as slug (#1094, #1126, #1127) +- Bump Rust to nightly 2022-07-19 (#1119) + +### Fixed + +- Malfunction while creating a blog post in Persian (#1116) +- Email block list is ignored when email sign-up (#1122) +- Bug that some Activity Sytreams properties are not parsed properly (#1129) +- Allow empty avatar for remote users (#1129) +- Percent encode blog FQN for federation interoperability (#1129) +- The same to `preferredUsername` (#1129) + ## [[0.7.2]] - 2022-05-11 ### Added diff --git a/Cargo.lock b/Cargo.lock index fd91e109..1a4e162d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,9 +11,9 @@ dependencies = [ "activitystreams-kinds", "iri-string", "mime 0.3.16", - "serde 1.0.137", + "serde 1.0.152", "serde_json", - "time 0.3.9", + "time 0.3.17", ] [[package]] @@ -23,7 +23,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb8e19a0810cc25df3535061a08b7d8f8a734d309ea4411c57a9767e4a2ffa0e" dependencies = [ "activitystreams", - "serde 1.0.137", + "serde 1.0.152", "serde_json", ] @@ -34,14 +34,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d014a4fb8828870b7b46bee6257b9a89d06188ae8d435381ba94f14c8c697d8" dependencies = [ "iri-string", - "serde 1.0.137", + "serde 1.0.152", ] [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ "gimli", ] @@ -121,31 +121,40 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.8", "once_cell", "version_check 0.9.4", ] [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] [[package]] name = "ammonia" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5ed2509ee88cc023cccee37a6fab35826830fe8b748b3869790e7720c2c4a74" +checksum = "64e6d1c7838db705c9b756557ee27c384ce695a1c51a6fe528784cb1c6840170" dependencies = [ "html5ever", "maplit", "once_cell", "tendril", - "url 2.2.2", + "url 2.3.1", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", ] [[package]] @@ -159,9 +168,9 @@ dependencies = [ [[package]] name = "arc-swap" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d78ce20460b82d3fa150275ed9d55e21064fc7951177baacf86a145c4a4b1f" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "array_tool" @@ -189,30 +198,30 @@ checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" [[package]] name = "assert-json-diff" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f1c3703dd33532d7f0ca049168930e9099ecac238e23cf932f3a69c42f06da" +checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" dependencies = [ - "serde 1.0.137", + "serde 1.0.152", "serde_json", ] [[package]] name = "async-trait" -version = "0.1.53" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" +checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "atom_syndication" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21fb6a0b39c6517edafe46f8137e53c51742425a4dae1c73ee12264a37ad7541" +checksum = "91a85f2ee28cbd1ecf91288460f6dc74661fd99b4e9a559836a667ccf63aa38c" dependencies = [ "chrono", "derive_builder", @@ -238,7 +247,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi 0.3.9", ] @@ -275,9 +284,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.65" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", @@ -325,9 +334,9 @@ checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bcrypt" @@ -335,9 +344,9 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe4fef31efb0f76133ae8e3576a88e58edb7cfc5584c81c758c349ba46b43fc" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "blowfish", - "getrandom 0.2.6", + "getrandom 0.2.8", "zeroize", ] @@ -347,7 +356,7 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "serde 1.0.137", + "serde 1.0.152", ] [[package]] @@ -408,15 +417,15 @@ checksum = "40e38929add23cdf8a366df9b0e088953150724bcbe5fc330b0d8eb3b328eec8" [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "bytecount" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72feb31ffc86498dacdbd0fcebb56138e7177a8cc5cea4516031d15ae85a742e" +checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" [[package]] name = "byteorder" @@ -431,7 +440,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" dependencies = [ "byteorder", - "either 1.6.1", + "either 1.8.0", "iovec", ] @@ -443,21 +452,21 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "bytes" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" [[package]] name = "census" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5927edd8345aef08578bcbb4aea7314f340d80c7f4931f99fbeb40b99d8f5060" +checksum = "0fafee10a5dd1cffcb5cc560e0d0df8803d7355a2b12272e3557dee57314cb6e" [[package]] name = "cfg-if" @@ -485,15 +494,17 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits 0.2.15", - "serde 1.0.137", - "time 0.1.43", + "serde 1.0.152", + "time 0.1.45", + "wasm-bindgen", "winapi 0.3.9", ] @@ -541,10 +552,20 @@ dependencies = [ ] [[package]] -name = "combine" -version = "4.6.4" +name = "codespan-reporting" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948" +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 = [ "memchr", ] @@ -558,10 +579,10 @@ dependencies = [ "lazy_static", "nom 5.1.2", "rust-ini", - "serde 1.0.137", + "serde 1.0.152", "serde-hjson", "serde_json", - "toml 0.5.9", + "toml 0.5.10", "yaml-rust", ] @@ -577,23 +598,23 @@ dependencies = [ [[package]] name = "const-random" -version = "0.1.13" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f590d95d011aa80b063ffe3253422ed5aa462af4e9867d43ce8337562bac77c4" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" dependencies = [ "const-random-macro", - "proc-macro-hack 0.5.19", + "proc-macro-hack 0.5.20+deprecated", ] [[package]] name = "const-random-macro" -version = "0.1.13" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615f6e27d000a2bffbc7f2f6a8669179378fa27ee4d0a509e985dfc0a7defb40" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" dependencies = [ - "getrandom 0.2.6", - "lazy_static", - "proc-macro-hack 0.5.19", + "getrandom 0.2.8", + "once_cell", + "proc-macro-hack 0.5.20+deprecated", "tiny-keccak", ] @@ -608,18 +629,18 @@ dependencies = [ [[package]] name = "cookie" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f6044740a4a516b8aac14c140cdf35c1a640b1bd6b98b6224e49143b2f1566" +checksum = "be2018768ed1d848cc4d347d551546474025ba820e5db70e4c9aaa349f678bd7" dependencies = [ "aes-gcm", - "base64 0.13.0", + "base64 0.13.1", "hkdf", "hmac", - "percent-encoding 2.1.0", + "percent-encoding 2.2.0", "rand 0.8.5", "sha2", - "time 0.1.43", + "time 0.1.45", ] [[package]] @@ -628,7 +649,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" dependencies = [ - "time 0.1.43", + "time 0.1.45", "url 1.7.2", ] @@ -643,9 +664,9 @@ dependencies = [ "idna 0.1.5", "log 0.4.17", "publicsuffix", - "serde 1.0.137", + "serde 1.0.152", "serde_json", - "time 0.1.43", + "time 0.1.45", "try_from", "url 1.7.2", ] @@ -668,9 +689,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -706,16 +727,16 @@ dependencies = [ [[package]] name = "crossbeam" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" +checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" dependencies = [ "cfg-if 1.0.0", - "crossbeam-channel 0.5.4", - "crossbeam-deque 0.8.1", - "crossbeam-epoch 0.9.8", - "crossbeam-queue 0.3.5", - "crossbeam-utils 0.8.8", + "crossbeam-channel 0.5.6", + "crossbeam-deque 0.8.2", + "crossbeam-epoch 0.9.13", + "crossbeam-queue 0.3.8", + "crossbeam-utils 0.8.14", ] [[package]] @@ -730,12 +751,12 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.8", + "crossbeam-utils 0.8.14", ] [[package]] @@ -751,13 +772,13 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.8", - "crossbeam-utils 0.8.8", + "crossbeam-epoch 0.9.13", + "crossbeam-utils 0.8.14", ] [[package]] @@ -777,15 +798,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.8" +version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" dependencies = [ "autocfg 1.1.0", "cfg-if 1.0.0", - "crossbeam-utils 0.8.8", - "lazy_static", - "memoffset 0.6.5", + "crossbeam-utils 0.8.14", + "memoffset 0.7.1", "scopeguard", ] @@ -802,12 +822,12 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.8", + "crossbeam-utils 0.8.14", ] [[package]] @@ -823,12 +843,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if 1.0.0", - "lazy_static", ] [[package]] @@ -839,9 +858,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", "typenum", @@ -868,12 +887,12 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.2.2" +version = "3.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b37feaa84e6861e00a1f5e5aa8da3ee56d605c9992d33e082786754828e20865" +checksum = "1631ca6e3c59112501a9d87fd86f21591ff77acd31331e8a73f8d80a65bbdd71" dependencies = [ - "nix 0.24.1", - "winapi 0.3.9", + "nix 0.26.1", + "windows-sys 0.42.0", ] [[package]] @@ -883,10 +902,54 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" [[package]] -name = "darling" -version = "0.12.4" +name = "cxx" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c" +checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2 1.0.49", + "quote 1.0.23", + "scratch", + "syn 1.0.107", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6" +dependencies = [ + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", +] + +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" dependencies = [ "darling_core", "darling_macro", @@ -894,27 +957,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.12.4" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.37", - "quote 1.0.18", + "proc-macro2 1.0.49", + "quote 1.0.23", "strsim 0.10.0", - "syn 1.0.92", + "syn 1.0.107", ] [[package]] name = "darling_macro" -version = "0.12.4" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" dependencies = [ "darling_core", - "quote 1.0.18", - "syn 1.0.92", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -961,33 +1024,33 @@ dependencies = [ [[package]] name = "derive_builder" -version = "0.10.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d13202debe11181040ae9063d739fa32cfcaaebe2275fe387703460ae2365b30" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.10.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66e616858f6187ed828df7c64a6d71720d83767a7f19740b2d1b6fe6327b36e5" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" dependencies = [ "darling", - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "derive_builder_macro" -version = "0.10.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ "derive_builder_core", - "syn 1.0.92", + "syn 1.0.107", ] [[package]] @@ -1054,9 +1117,9 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -1080,9 +1143,9 @@ dependencies = [ [[package]] name = "diligent-date-parser" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d0fd95c7c02e2d6c588c6c5628466fff9bdde4b8c6196465e087b08e792720" +checksum = "f6cf7fe294274a222363f84bcb63cdea762979a0443b4cf1f4f8fd17c86b1182" dependencies = [ "chrono", ] @@ -1113,9 +1176,9 @@ checksum = "a39bffec1e2015c5d8a6773cb0cf48d0d758c842398f624c34969071f5499ea7" [[package]] name = "either" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "email" @@ -1128,7 +1191,7 @@ dependencies = [ "encoding", "lazy_static", "rand 0.4.6", - "time 0.1.43", + "time 0.1.45", "version_check 0.1.5", ] @@ -1222,7 +1285,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" dependencies = [ - "backtrace 0.3.65", + "backtrace 0.3.67", "failure_derive", ] @@ -1232,9 +1295,9 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", "synstructure", ] @@ -1249,48 +1312,46 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] [[package]] name = "filetime" -version = "0.2.16" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0408e2626025178a6a7f7ffc05a25bc47103229f19c113755de7bf63816290c" +checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.13", - "winapi 0.3.9", + "redox_syscall 0.2.16", + "windows-sys 0.42.0", ] [[package]] name = "flate2" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ - "cfg-if 1.0.0", "crc32fast", - "libc", "miniz_oxide", ] [[package]] name = "flume" -version = "0.10.13" +version = "0.10.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ceeb589a3157cac0ab8cc585feb749bd2cea5cb55a6ee802ad72d9fd38303da" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" dependencies = [ "futures-core", "futures-sink", "nanorand", "pin-project", - "spin", + "spin 0.9.4", ] [[package]] @@ -1316,12 +1377,11 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", - "percent-encoding 2.1.0", + "percent-encoding 2.2.0", ] [[package]] @@ -1393,9 +1453,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -1408,9 +1468,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -1418,9 +1478,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-cpupool" @@ -1434,9 +1494,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -1446,38 +1506,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-channel", "futures-core", @@ -1493,9 +1553,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check 0.9.4", @@ -1514,14 +1574,14 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if 1.0.0", "js-sys", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -1543,9 +1603,9 @@ checksum = "649db3b5cda06091ea6aacb9f66f7002dfe885505b324b8ed795261253ffc2b3" dependencies = [ "gettext", "gettext-utils", - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -1566,15 +1626,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "guid" @@ -1657,7 +1717,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.7", + "http 0.2.8", "indexmap", "slab", "tokio 0.2.25", @@ -1668,20 +1728,20 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ - "bytes 1.1.0", + "bytes 1.3.0", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.7", + "http 0.2.8", "indexmap", "slab", - "tokio 1.19.2", - "tokio-util 0.7.1", + "tokio 1.24.1", + "tokio-util 0.7.4", "tracing", ] @@ -1696,9 +1756,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash 0.7.6", ] @@ -1712,6 +1772,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hex" version = "0.4.3" @@ -1757,9 +1826,9 @@ dependencies = [ "log 0.4.17", "mac", "markup5ever", - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -1781,13 +1850,13 @@ dependencies = [ [[package]] name = "http" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8670570af52249509a86f5e3e18a08c60b177071826898fde8997cf5f6bfbb" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ - "bytes 1.1.0", + "bytes 1.3.0", "fnv", - "itoa 1.0.1", + "itoa 1.0.5", ] [[package]] @@ -1809,25 +1878,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ "bytes 0.5.6", - "http 0.2.7", + "http 0.2.8", ] [[package]] name = "http-body" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.1.0", - "http 0.2.7", + "bytes 1.3.0", + "http 0.2.8", "pin-project-lite 0.2.9", ] [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -1853,7 +1922,7 @@ dependencies = [ "log 0.3.9", "mime 0.2.6", "num_cpus", - "time 0.1.43", + "time 0.1.45", "traitobject", "typeable", "unicase 1.4.2", @@ -1878,7 +1947,7 @@ dependencies = [ "log 0.4.17", "net2", "rustc_version", - "time 0.1.43", + "time 0.1.45", "tokio 0.1.22", "tokio-buf", "tokio-executor", @@ -1901,7 +1970,7 @@ dependencies = [ "futures-core", "futures-util", "h2 0.2.7", - "http 0.2.7", + "http 0.2.8", "http-body 0.3.1", "httparse", "httpdate 0.3.2", @@ -1916,23 +1985,23 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.18" +version = "0.14.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" dependencies = [ - "bytes 1.1.0", + "bytes 1.3.0", "futures-channel", "futures-core", "futures-util", - "h2 0.3.13", - "http 0.2.7", - "http-body 0.4.4", + "h2 0.3.15", + "http 0.2.8", + "http-body 0.4.5", "httparse", "httpdate 1.0.2", - "itoa 1.0.1", + "itoa 1.0.5", "pin-project-lite 0.2.9", - "socket2 0.4.4", - "tokio 1.19.2", + "socket2 0.4.7", + "tokio 1.24.1", "tower-service", "tracing", "want 0.3.0", @@ -1970,13 +2039,37 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 1.1.0", - "hyper 0.14.18", + "bytes 1.3.0", + "hyper 0.14.23", "native-tls", - "tokio 1.19.2", + "tokio 1.24.1", "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi 0.3.9", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2005,6 +2098,16 @@ dependencies = [ "unicode-normalization", ] +[[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 = "if_chain" version = "1.0.2" @@ -2013,12 +2116,12 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "1.8.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg 1.1.0", - "hashbrown 0.11.2", + "hashbrown 0.12.3", ] [[package]] @@ -2070,17 +2173,17 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.5.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" [[package]] name = "iri-string" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e76a2a488a2bce15f9e696e3b9b66a4e1412c13339344bba8a24b7eae30f91b" +checksum = "bf071934ee7ee97e52fa1868a9540a7885eab75926bd70794030304a9797cea1" dependencies = [ - "serde 1.0.137", + "serde 1.0.152", ] [[package]] @@ -2089,16 +2192,16 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" dependencies = [ - "either 1.6.1", + "either 1.8.0", ] [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ - "either 1.6.1", + "either 1.8.0", ] [[package]] @@ -2109,15 +2212,15 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "js-sys" -version = "0.3.58" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -2152,37 +2255,36 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "lber" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a99b520993b21a6faab32643cf4726573dc18ca4cf2d48cbeb24d248c86c930" +checksum = "b5d85f5e00e12cb50c70c3b1c1f0daff6546eb4c608b44d0a990e38a539e0446" dependencies = [ - "byteorder", - "bytes 1.1.0", - "nom 2.2.1", + "bytes 1.3.0", + "nom 7.1.2", ] [[package]] name = "ldap3" -version = "0.10.5" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef35dc747152dd47bdc6aaeb35a232f84cbc8d84ae4cb9673aea810a6570ab8f" +checksum = "c5cfbd3c59ca16d6671b002b8b3dd013cd825d9c77a1664a3135194d3270511e" dependencies = [ "async-trait", - "bytes 1.1.0", - "futures 0.3.21", + "bytes 1.3.0", + "futures 0.3.25", "futures-util", "lazy_static", "lber", "log 0.4.17", "native-tls", - "nom 2.2.1", - "percent-encoding 2.1.0", + "nom 7.1.2", + "percent-encoding 2.2.0", "thiserror", - "tokio 1.19.2", + "tokio 1.24.1", "tokio-native-tls", "tokio-stream", - "tokio-util 0.7.1", - "url 2.2.2", + "tokio-util 0.7.4", + "url 2.3.1", ] [[package]] @@ -2198,7 +2300,7 @@ dependencies = [ "log 0.4.17", "native-tls", "nom 4.2.3", - "serde 1.0.137", + "serde 1.0.152", "serde_derive", "serde_json", ] @@ -2213,7 +2315,7 @@ dependencies = [ "email", "lettre", "mime 0.3.16", - "time 0.1.43", + "time 0.1.45", "uuid 0.7.4", ] @@ -2238,9 +2340,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.125" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libsqlite3-sys" @@ -2265,7 +2367,7 @@ dependencies = [ "lindera-dictionary", "lindera-ipadic", "lindera-ipadic-builder", - "serde 1.0.137", + "serde 1.0.152", "serde_json", ] @@ -2278,7 +2380,7 @@ dependencies = [ "bincode", "byteorder", "encoding", - "serde 1.0.137", + "serde 1.0.152", "yada", ] @@ -2344,6 +2446,15 @@ dependencies = [ "safemem", ] +[[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + [[package]] name = "linked-hash-map" version = "0.3.0" @@ -2356,9 +2467,9 @@ dependencies = [ [[package]] name = "linked-hash-map" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "lock_api" @@ -2371,9 +2482,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg 1.1.0", "scopeguard", @@ -2477,9 +2588,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg 1.1.0", ] @@ -2500,9 +2611,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9753f12909fd8d923f75ae5c3258cae1ed3c8ec052e1b38c93c21a6d157f789c" dependencies = [ "migrations_internals", - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -2538,9 +2649,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -2566,16 +2677,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log 0.4.17", - "miow 0.3.7", - "ntapi", "wasi 0.11.0+wasi-snapshot-preview1", - "winapi 0.3.9", + "windows-sys 0.42.0", ] [[package]] @@ -2667,14 +2776,14 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.8", ] [[package]] name = "native-tls" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", @@ -2690,9 +2799,9 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.37" +version = "0.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" +checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" dependencies = [ "cfg-if 0.1.10", "libc", @@ -2726,21 +2835,16 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.1" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9" +checksum = "46a58d1d356c6597d08cde02c2f09d785b09e28711837b1ed667dc652c08a694" dependencies = [ "bitflags 1.3.2", "cfg-if 1.0.0", "libc", + "static_assertions", ] -[[package]] -name = "nom" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf51a729ecf40266a2368ad335a5fdde43471f545a967109cd62146ecf8b66ff" - [[package]] name = "nom" version = "4.2.3" @@ -2764,9 +2868,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.1.1" +version = "7.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c" dependencies = [ "memchr", "minimal-lexical", @@ -2780,7 +2884,7 @@ checksum = "37794436ca3029a3089e0b95d42da1f0b565ad271e4d3bb4bad0c7bb70b10605" dependencies = [ "bytecount", "memchr", - "nom 7.1.1", + "nom 7.1.2", ] [[package]] @@ -2802,11 +2906,12 @@ dependencies = [ ] [[package]] -name = "ntapi" -version = "0.3.7" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ + "overload", "winapi 0.3.9", ] @@ -2833,9 +2938,9 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg 1.1.0", "num-integer", @@ -2862,55 +2967,46 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ + "hermit-abi 0.2.6", "libc", ] [[package]] name = "object" -version = "0.28.3" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "8d864c91689fdc196779b98dba0aceac6118594c2df6ee5d943eb6a8df4d107a" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.12.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "onig" -version = "6.3.1" +version = "6.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ddfe2c93bb389eea6e6d713306880c7f6dcc99a75b659ce145d962c861b225" +checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" dependencies = [ "bitflags 1.3.2", - "lazy_static", "libc", + "once_cell", "onig_sys", ] [[package]] name = "onig_sys" -version = "69.7.1" +version = "69.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd3eee045c84695b53b20255bb7317063df090b68e18bfac0abb6c39cf7f33e" +checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" dependencies = [ "cc", "pkg-config", @@ -2924,9 +3020,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.40" +version = "0.10.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" +checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" dependencies = [ "bitflags 1.3.2", "cfg-if 1.0.0", @@ -2943,9 +3039,9 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -2956,9 +3052,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.73" +version = "0.9.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5fd19fb3e0a8191c1e34935718976a3e70c112ab9a24af6d7cadccd9d90bc0" +checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" dependencies = [ "autocfg 1.1.0", "cc", @@ -2967,6 +3063,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "owned-read" version = "0.4.1" @@ -2992,36 +3094,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" dependencies = [ "lock_api 0.3.4", - "parking_lot_core 0.6.2", + "parking_lot_core 0.6.3", "rustc_version", ] [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "instant", - "lock_api 0.4.7", - "parking_lot_core 0.8.5", -] - -[[package]] -name = "parking_lot" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" -dependencies = [ - "lock_api 0.4.7", - "parking_lot_core 0.9.3", + "lock_api 0.4.9", + "parking_lot_core 0.9.5", ] [[package]] name = "parking_lot_core" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +checksum = "bda66b810a62be75176a80873726630147a5ca780cd33921e0b5709033e66b0a" dependencies = [ "cfg-if 0.1.10", "cloudabi", @@ -3034,29 +3125,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall 0.2.13", - "smallvec 1.8.0", - "winapi 0.3.9", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.13", - "smallvec 1.8.0", - "windows-sys", + "redox_syscall 0.2.16", + "smallvec 1.10.0", + "windows-sys 0.42.0", ] [[package]] @@ -3070,9 +3147,9 @@ dependencies = [ [[package]] name = "pear_codegen" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfc1c836fdc3d1ef87c348b237b5b5c4dff922156fb2d968f57734f9669768ca" +checksum = "c0288ba5d581afbc93e2bbd931c1013584c15ecf46b1cdb927edc7abddbc8ca6" dependencies = [ "proc-macro2 0.4.30", "quote 0.6.13", @@ -3089,9 +3166,9 @@ checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "phf" @@ -3133,22 +3210,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -3171,9 +3248,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "plist" @@ -3181,11 +3258,11 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "indexmap", "line-wrap", - "serde 1.0.137", - "time 0.3.9", + "serde 1.0.152", + "time 0.3.17", "xml-rs", ] @@ -3218,7 +3295,7 @@ dependencies = [ "rsass", "ructe", "scheduled-thread-pool", - "serde 1.0.137", + "serde 1.0.152", "serde_json", "shrinkwraprs", "tracing", @@ -3231,7 +3308,7 @@ dependencies = [ name = "plume-api" version = "0.7.2" dependencies = [ - "serde 1.0.137", + "serde 1.0.152", "serde_derive", ] @@ -3255,25 +3332,25 @@ dependencies = [ "array_tool", "askama_escape", "assert-json-diff", - "base64 0.13.0", + "base64 0.13.1", "chrono", "flume", - "futures 0.3.21", + "futures 0.3.25", "hex", "once_cell", "openssl", "pulldown-cmark", - "regex-syntax 0.6.26", - "reqwest 0.11.11", + "regex-syntax 0.6.28", + "reqwest 0.11.13", "rocket", - "serde 1.0.137", + "serde 1.0.152", "serde_derive", "serde_json", "shrinkwraprs", "syntect", - "tokio 1.19.2", + "tokio 1.24.1", "tracing", - "url 2.2.2", + "url 2.3.1", ] [[package]] @@ -3286,7 +3363,7 @@ dependencies = [ "gettext-utils", "js-sys", "lazy_static", - "serde 1.0.137", + "serde 1.0.152", "serde_derive", "serde_json", "wasm-bindgen", @@ -3316,7 +3393,7 @@ dependencies = [ "diesel_migrations", "glob", "guid-create", - "itertools 0.10.3", + "itertools 0.10.5", "lazy_static", "ldap3", "lettre", @@ -3328,18 +3405,18 @@ dependencies = [ "plume-api", "plume-common", "plume-macro", - "reqwest 0.11.11", + "reqwest 0.11.13", "riker", "rocket", "rocket_i18n", "scheduled-thread-pool", - "serde 1.0.137", + "serde 1.0.152", "serde_derive", "serde_json", "shrinkwraprs", "tantivy 0.13.3", "tracing", - "url 2.2.2", + "url 2.3.1", "walkdir", "webfinger", "whatlang", @@ -3358,15 +3435,15 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "pq-sys" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac25eee5a0582f45a67e837e350d784e7003bd29a5f460796772061ca49ffda" +checksum = "3b845d6d8ec554f972a2c5298aad68953fd64e7441e846075450b44656a016d1" dependencies = [ "vcpkg", ] @@ -3384,9 +3461,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", "version_check 0.9.4", ] @@ -3396,8 +3473,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", + "proc-macro2 1.0.49", + "quote 1.0.23", "version_check 0.9.4", ] @@ -3412,9 +3489,9 @@ dependencies = [ [[package]] name = "proc-macro-hack" -version = "0.5.19" +version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro-hack-impl" @@ -3442,11 +3519,11 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.37" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ - "unicode-xid 0.2.3", + "unicode-ident", ] [[package]] @@ -3456,7 +3533,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95b4ce31ff0a27d93c8de1849cf58162283752f065a90d508f1105fa6c9a213f" dependencies = [ "idna 0.2.3", - "url 2.2.2", + "url 2.3.1", ] [[package]] @@ -3477,9 +3554,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quick-xml" -version = "0.22.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" +checksum = "ffc053f057dd768a56f62cd7e434c42c831d296968997e9ac1f76ea7c2d14c41" dependencies = [ "encoding_rs", "memchr", @@ -3505,21 +3582,21 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.18" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ - "proc-macro2 1.0.37", + "proc-macro2 1.0.49", ] [[package]] name = "r2d2" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f" +checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93" dependencies = [ "log 0.4.17", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "scheduled-thread-pool", ] @@ -3576,7 +3653,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -3606,7 +3683,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -3635,11 +3712,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.8", ] [[package]] @@ -3715,25 +3792,23 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.2" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" dependencies = [ - "autocfg 1.1.0", - "crossbeam-deque 0.8.1", - "either 1.6.1", + "either 1.8.0", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.2" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" +checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" dependencies = [ - "crossbeam-channel 0.5.4", - "crossbeam-deque 0.8.1", - "crossbeam-utils 0.8.8", + "crossbeam-channel 0.5.6", + "crossbeam-deque 0.8.2", + "crossbeam-utils 0.8.14", "num_cpus", ] @@ -3754,22 +3829,22 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.5.5" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.6.26", + "regex-syntax 0.6.28", ] [[package]] @@ -3780,9 +3855,9 @@ checksum = "8e931c58b93d86f080c734bfd2bce7dd0079ae2331235818133c8be7f422e20e" [[package]] name = "regex-syntax" -version = "0.6.26" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "remove_dir_all" @@ -3813,10 +3888,10 @@ dependencies = [ "mime 0.3.16", "mime_guess", "native-tls", - "serde 1.0.137", + "serde 1.0.152", "serde_json", "serde_urlencoded 0.5.5", - "time 0.1.43", + "time 0.1.45", "tokio 0.1.22", "tokio-executor", "tokio-io", @@ -3833,12 +3908,12 @@ version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "bytes 0.5.6", "encoding_rs", "futures-core", "futures-util", - "http 0.2.7", + "http 0.2.8", "http-body 0.3.1", "hyper 0.13.10", "hyper-tls 0.4.3", @@ -3849,13 +3924,13 @@ dependencies = [ "mime 0.3.16", "mime_guess", "native-tls", - "percent-encoding 2.1.0", + "percent-encoding 2.2.0", "pin-project-lite 0.2.9", - "serde 1.0.137", + "serde 1.0.152", "serde_urlencoded 0.7.1", "tokio 0.2.25", "tokio-tls", - "url 2.2.2", + "url 2.3.1", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3864,36 +3939,36 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.11" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" dependencies = [ - "base64 0.13.0", - "bytes 1.1.0", + "base64 0.13.1", + "bytes 1.3.0", "encoding_rs", "futures-core", "futures-util", - "h2 0.3.13", - "http 0.2.7", - "http-body 0.4.4", - "hyper 0.14.18", + "h2 0.3.15", + "http 0.2.8", + "http-body 0.4.5", + "hyper 0.14.23", "hyper-tls 0.5.0", "ipnet", "js-sys", - "lazy_static", "log 0.4.17", "mime 0.3.16", "native-tls", - "percent-encoding 2.1.0", + "once_cell", + "percent-encoding 2.2.0", "pin-project-lite 0.2.9", - "serde 1.0.137", + "serde 1.0.152", "serde_json", "serde_urlencoded 0.7.1", - "tokio 1.19.2", + "tokio 1.24.1", "tokio-native-tls", "tokio-socks", "tower-service", - "url 2.2.2", + "url 2.3.1", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3909,7 +3984,7 @@ dependencies = [ "chrono", "config", "dashmap", - "futures 0.3.21", + "futures 0.3.25", "num_cpus", "pin-utils", "rand 0.7.3", @@ -3934,14 +4009,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.13.5" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4db68a2e35f3497146b7e4563df7d4773a2433230c5e4b448328e31740458a" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", - "lazy_static", "libc", + "once_cell", + "spin 0.5.2", "untrusted", + "web-sys", + "winapi 0.3.9", ] [[package]] @@ -3951,7 +4029,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83b9d9dc08c5dcc1d8126a9dd615545e6a358f8c13c883c8dfed8c0376fa355e" dependencies = [ "atty", - "base64 0.13.0", + "base64 0.13.1", "log 0.4.17", "memchr", "num_cpus", @@ -3959,7 +4037,7 @@ dependencies = [ "rocket_codegen", "rocket_http", "state", - "time 0.1.43", + "time 0.1.45", "toml 0.4.10", "version_check 0.9.4", "yansi", @@ -3989,20 +4067,20 @@ dependencies = [ "log 0.4.17", "notify", "rocket", - "serde 1.0.137", + "serde 1.0.152", "serde_json", ] [[package]] name = "rocket_csrf" -version = "0.1.0" -source = "git+https://github.com/fdb-hiroshima/rocket_csrf?rev=29910f2829e7e590a540da3804336577b48c7b31#29910f2829e7e590a540da3804336577b48c7b31" +version = "0.1.2" +source = "git+https://git.joinplu.me/plume/rocket_csrf?rev=0.1.2#446d306ec5f08773253eb380f62d77077d306143" dependencies = [ "data-encoding", "ring", "rocket", - "serde 1.0.137", - "time 0.1.43", + "serde 1.0.152", + "time 0.1.45", ] [[package]] @@ -4011,14 +4089,14 @@ version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf9cbd128e1f321a2d0bebd2b7cf0aafd89ca43edf69e49b56a5c46e48eb19f" dependencies = [ - "cookie 0.11.4", + "cookie 0.11.5", "hyper 0.10.16", "indexmap", "pear", "percent-encoding 1.0.1", - "smallvec 1.8.0", + "smallvec 1.10.0", "state", - "time 0.1.43", + "time 0.1.45", "unicode-xid 0.1.0", ] @@ -4039,20 +4117,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf099a1888612545b683d2661a1940089f6c2e5a8e38979b2159da876bfd956" dependencies = [ "libc", - "serde 1.0.137", + "serde 1.0.152", "serde_json", "winapi 0.3.9", ] [[package]] name = "rsass" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0a591e01b92182a881aa6d89df6e56c6923a6589662c0194921466024d7d78b" +checksum = "665387d3be91521de331a04cc7118c8c129ffe43c5f4e8a61e78990850046b5a" dependencies = [ + "arc-swap", "fastrand", "lazy_static", - "nom 7.1.1", + "nom 7.1.2", "nom_locate", "num-bigint", "num-integer", @@ -4063,15 +4142,15 @@ dependencies = [ [[package]] name = "ructe" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef88d8c2492d7266e264b31e0ffcf1149d5ba183bccd3abaf1483ee905fc85de" +checksum = "85517cd381cf0c34694881d8aaf173107c6af7670e66cec18d7a1a8bfce3b758" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "bytecount", - "itertools 0.10.3", + "itertools 0.10.5", "md5", - "nom 7.1.1", + "nom 7.1.2", ] [[package]] @@ -4086,7 +4165,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54" dependencies = [ - "serde 1.0.137", + "serde 1.0.152", "serde_derive", ] @@ -4107,9 +4186,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "safemem" @@ -4128,12 +4207,12 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "winapi 0.3.9", + "windows-sys 0.36.1", ] [[package]] @@ -4142,7 +4221,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "977a7519bff143a44f842fd07e80ad1329295bd71686457f18e496736f4bf9bf" dependencies = [ - "parking_lot 0.12.0", + "parking_lot 0.12.1", ] [[package]] @@ -4152,10 +4231,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "security-framework" -version = "2.6.1" +name = "scratch" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -4197,9 +4282,9 @@ checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" [[package]] name = "serde" -version = "1.0.137" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] @@ -4219,24 +4304,24 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.137" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ - "itoa 1.0.1", + "itoa 1.0.5", "ryu", - "serde 1.0.137", + "serde 1.0.152", ] [[package]] @@ -4256,7 +4341,7 @@ checksum = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" dependencies = [ "dtoa", "itoa 0.4.8", - "serde 1.0.137", + "serde 1.0.152", "url 1.7.2", ] @@ -4267,9 +4352,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.1", + "itoa 1.0.5", "ryu", - "serde 1.0.137", + "serde 1.0.152", ] [[package]] @@ -4302,9 +4387,9 @@ checksum = "e63e6744142336dfb606fe2b068afa2e1cca1ee6a5d8377277a92945d81fa331" dependencies = [ "bitflags 1.3.2", "itertools 0.8.2", - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -4324,9 +4409,12 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg 1.1.0", +] [[package]] name = "slog" @@ -4367,15 +4455,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "snap" -version = "1.0.5" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45456094d1983e2ee2a18fdfebce3189fa451699d0502cb8e3b49dba5ba41451" +checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "socket2" @@ -4390,9 +4478,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi 0.3.9", @@ -4400,11 +4488,17 @@ dependencies = [ [[package]] name = "spin" -version = "0.9.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530c2b0d0bf8b69304b39fe2001993e267461948b890cd037d8ad4293fa1a0d" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" dependencies = [ - "lock_api 0.4.7", + "lock_api 0.4.9", ] [[package]] @@ -4442,10 +4536,10 @@ checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.0", + "parking_lot 0.12.1", "phf_shared", "precomputed-hash", - "serde 1.0.137", + "serde 1.0.152", ] [[package]] @@ -4456,8 +4550,8 @@ checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" dependencies = [ "phf_generator", "phf_shared", - "proc-macro2 1.0.37", - "quote 1.0.18", + "proc-macro2 1.0.49", + "quote 1.0.23", ] [[package]] @@ -4513,13 +4607,13 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.92" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "unicode-xid 0.2.3", + "proc-macro2 1.0.49", + "quote 1.0.23", + "unicode-ident", ] [[package]] @@ -4528,10 +4622,10 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", - "unicode-xid 0.2.3", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", + "unicode-xid 0.2.4", ] [[package]] @@ -4548,8 +4642,8 @@ dependencies = [ "lazycell", "onig", "plist", - "regex-syntax 0.6.26", - "serde 1.0.137", + "regex-syntax 0.6.28", + "serde 1.0.152", "serde_derive", "serde_json", "walkdir", @@ -4575,7 +4669,7 @@ dependencies = [ "failure", "fnv", "fs2", - "futures 0.3.21", + "futures 0.3.25", "htmlescape", "levenshtein_automata", "log 0.4.17", @@ -4589,9 +4683,9 @@ dependencies = [ "rayon", "regex", "rust-stemmers", - "serde 1.0.137", + "serde 1.0.152", "serde_json", - "smallvec 1.8.0", + "smallvec 1.10.0", "snap", "stable_deref_trait", "tantivy-fst", @@ -4607,18 +4701,18 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edca90bddda472f39fdc74a031d61d52b08b1de97f2a704afae726a8004abb0d" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "bitpacking", "byteorder", "census", "chrono", "crc32fast", - "crossbeam 0.8.1", + "crossbeam 0.8.2", "downcast-rs", "fail", "fnv", "fs2", - "futures 0.3.21", + "futures 0.3.25", "htmlescape", "levenshtein_automata", "log 0.4.17", @@ -4630,9 +4724,9 @@ dependencies = [ "rayon", "regex", "rust-stemmers", - "serde 1.0.137", + "serde 1.0.152", "serde_json", - "smallvec 1.8.0", + "smallvec 1.10.0", "snap", "stable_deref_trait", "tantivy-fst", @@ -4702,7 +4796,7 @@ dependencies = [ "cfg-if 1.0.0", "fastrand", "libc", - "redox_syscall 0.2.13", + "redox_syscall 0.2.16", "remove_dir_all", "winapi 0.3.9", ] @@ -4718,6 +4812,15 @@ dependencies = [ "utf-8", ] +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -4729,22 +4832,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -4758,23 +4861,40 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] [[package]] name = "time" -version = "0.3.9" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" dependencies = [ - "itoa 1.0.1", - "libc", - "num_threads", + "itoa 1.0.5", + "serde 1.0.152", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", ] [[package]] @@ -4846,22 +4966,22 @@ dependencies = [ [[package]] name = "tokio" -version = "1.19.2" +version = "1.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae" dependencies = [ - "bytes 1.1.0", + "autocfg 1.1.0", + "bytes 1.3.0", "libc", "memchr", - "mio 0.8.2", + "mio 0.8.5", "num_cpus", - "once_cell", - "parking_lot 0.12.0", + "parking_lot 0.12.1", "pin-project-lite 0.2.9", "signal-hook-registry", - "socket2 0.4.4", - "tokio-macros 1.7.0", - "winapi 0.3.9", + "socket2 0.4.7", + "tokio-macros 1.8.2", + "windows-sys 0.42.0", ] [[package]] @@ -4871,7 +4991,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" dependencies = [ "bytes 0.4.12", - "either 1.6.1", + "either 1.8.0", "futures 0.1.31", ] @@ -4912,20 +5032,20 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "tokio-macros" -version = "1.7.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] @@ -4935,7 +5055,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.19.2", + "tokio 1.24.1", ] [[package]] @@ -4963,21 +5083,21 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0" dependencies = [ - "either 1.6.1", + "either 1.8.0", "futures-util", "thiserror", - "tokio 1.19.2", + "tokio 1.24.1", ] [[package]] name = "tokio-stream" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", "pin-project-lite 0.2.9", - "tokio 1.19.2", + "tokio 1.24.1", ] [[package]] @@ -5059,15 +5179,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ - "bytes 1.1.0", + "bytes 1.3.0", "futures-core", "futures-sink", "pin-project-lite 0.2.9", - "tokio 1.19.2", + "tokio 1.24.1", "tracing", ] @@ -5077,29 +5197,29 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" dependencies = [ - "serde 1.0.137", + "serde 1.0.152", ] [[package]] name = "toml" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" dependencies = [ - "serde 1.0.137", + "serde 1.0.152", ] [[package]] name = "tower-service" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "log 0.4.17", @@ -5110,20 +5230,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", ] [[package]] name = "tracing-core" -version = "0.1.27" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", "valuable", @@ -5152,13 +5272,13 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.11" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bc28f93baff38037f64e6f43d34cfa1605f27a49c34e8a04c5e78b0babf2596" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" dependencies = [ - "ansi_term", + "nu-ansi-term", "sharded-slab", - "smallvec 1.8.0", + "smallvec 1.10.0", "thread_local", "tracing-core", "tracing-log", @@ -5202,9 +5322,9 @@ checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicase" @@ -5231,19 +5351,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] -name = "unicode-normalization" -version = "0.1.19" +name = "unicode-ident" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode-xid" @@ -5253,9 +5379,9 @@ checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "unicode-xid" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "universal-hash" @@ -5269,9 +5395,9 @@ dependencies = [ [[package]] name = "untrusted" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" @@ -5286,14 +5412,13 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", - "idna 0.2.3", - "matches", - "percent-encoding 2.1.0", + "idna 0.3.0", + "percent-encoding 2.2.0", ] [[package]] @@ -5323,8 +5448,8 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.6", - "serde 1.0.137", + "getrandom 0.2.8", + "serde 1.0.152", ] [[package]] @@ -5336,10 +5461,10 @@ dependencies = [ "idna 0.2.3", "lazy_static", "regex", - "serde 1.0.137", + "serde 1.0.152", "serde_derive", "serde_json", - "url 2.2.2", + "url 2.3.1", "validator_derive", ] @@ -5352,10 +5477,10 @@ dependencies = [ "if_chain", "lazy_static", "proc-macro-error", - "proc-macro2 1.0.37", - "quote 1.0.18", + "proc-macro2 1.0.49", + "quote 1.0.23", "regex", - "syn 1.0.92", + "syn 1.0.107", "validator_types", ] @@ -5365,8 +5490,8 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2ddf34293296847abfc1493b15c6e2f5d3cd19f57ad7d22673bf4c6278da329" dependencies = [ - "proc-macro2 1.0.37", - "syn 1.0.92", + "proc-macro2 1.0.49", + "syn 1.0.107", ] [[package]] @@ -5445,9 +5570,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasi" @@ -5457,36 +5582,36 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if 1.0.0", - "serde 1.0.137", + "serde 1.0.152", "serde_json", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", - "lazy_static", "log 0.4.17", - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "once_cell", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.30" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -5496,38 +5621,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ - "quote 1.0.18", + "quote 1.0.23", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ - "proc-macro2 1.0.37", - "quote 1.0.18", - "syn 1.0.92", + "proc-macro2 1.0.49", + "quote 1.0.23", + "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "web-sys" -version = "0.3.58" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -5540,17 +5665,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec24b1b0700d4b466d280228ed0f62274eedeaa80206820f071fdc8ed787b664" dependencies = [ "reqwest 0.9.24", - "serde 1.0.137", + "serde 1.0.152", "serde_derive", ] [[package]] name = "whatlang" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2989d7e9d3cb96a76438e879144030b1be0931b944fbfed65e89e2ae536cd3b9" +checksum = "9c531a2dc4c462b833788be2c07eef4e621d0e9edbd55bf280cc164c1c1aa043" dependencies = [ - "hashbrown 0.12.1", + "hashbrown 0.12.3", "once_cell", ] @@ -5603,43 +5728,100 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "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.6.2" @@ -5713,7 +5895,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ - "linked-hash-map 0.5.4", + "linked-hash-map 0.5.6", ] [[package]] @@ -5724,6 +5906,6 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zeroize" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94693807d016b2f2d2e14420eb3bfcca689311ff775dcf113d74ea624b7cdf07" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" diff --git a/Cargo.toml b/Cargo.toml index 3632d47f..2c2e1d30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ repository = "https://github.com/Plume-org/Plume" edition = "2018" [dependencies] -atom_syndication = "0.11.0" +atom_syndication = "0.12.0" clap = "2.33" dotenv = "0.15.0" gettext = "0.4.0" @@ -19,7 +19,7 @@ rocket = "0.4.11" rocket_contrib = { version = "0.4.11", features = ["json"] } rocket_i18n = "0.4.1" scheduled-thread-pool = "0.2.6" -serde = "1.0" +serde = "1.0.137" serde_json = "1.0.81" shrinkwraprs = "0.3.0" validator = { version = "0.15", features = ["derive"] } @@ -27,7 +27,7 @@ webfinger = "0.4.1" tracing = "0.1.35" tracing-subscriber = "0.3.10" riker = "0.4.2" -activitystreams = "0.7.0-alpha.18" +activitystreams = "=0.7.0-alpha.20" [[bin]] name = "plume" @@ -60,12 +60,12 @@ path = "plume-common" path = "plume-models" [dependencies.rocket_csrf] -git = "https://github.com/fdb-hiroshima/rocket_csrf" -rev = "29910f2829e7e590a540da3804336577b48c7b31" +git = "https://git.joinplu.me/plume/rocket_csrf" +rev = "0.1.2" [build-dependencies] -ructe = "0.14.0" -rsass = "0.25" +ructe = "0.15.0" +rsass = "0.26" [features] default = ["postgres"] diff --git a/Dockerfile b/Dockerfile index f6196e73..cfd52f1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1-buster as builder +FROM rust:1 as builder RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ @@ -18,17 +18,15 @@ COPY script/wasm-deps.sh . RUN chmod a+x ./wasm-deps.sh && sleep 1 && ./wasm-deps.sh WORKDIR /app -COPY Cargo.toml Cargo.lock rust-toolchain ./ -RUN cargo install wasm-pack COPY . . - +RUN cargo install wasm-pack RUN chmod a+x ./script/plume-front.sh && sleep 1 && ./script/plume-front.sh RUN cargo install --path ./ --force --no-default-features --features postgres RUN cargo install --path plume-cli --force --no-default-features --features postgres RUN cargo clean -FROM debian:buster-slim +FROM debian:stable-slim RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ diff --git a/plume-api/Cargo.toml b/plume-api/Cargo.toml index 3d608b63..54d18fb8 100644 --- a/plume-api/Cargo.toml +++ b/plume-api/Cargo.toml @@ -5,5 +5,5 @@ authors = ["Plume contributors"] edition = "2018" [dependencies] -serde = "1.0" +serde = "1.0.137" serde_derive = "1.0" diff --git a/plume-common/Cargo.toml b/plume-common/Cargo.toml index ffa1bb47..ac24594d 100644 --- a/plume-common/Cargo.toml +++ b/plume-common/Cargo.toml @@ -11,7 +11,7 @@ hex = "0.4" openssl = "0.10.40" rocket = "0.4.11" reqwest = { version = "0.11.11", features = ["blocking", "json", "socks"] } -serde = "1.0" +serde = "1.0.137" serde_derive = "1.0" serde_json = "1.0.81" shrinkwraprs = "0.3.0" @@ -19,12 +19,12 @@ syntect = "4.5.0" regex-syntax = { version = "0.6.26", default-features = false, features = ["unicode-perl"] } tracing = "0.1.35" askama_escape = "0.10.3" -activitystreams = "0.7.0-alpha.18" +activitystreams = "=0.7.0-alpha.20" activitystreams-ext = "0.1.0-alpha.2" url = "2.2.2" flume = "0.10.13" tokio = { version = "1.19.2", features = ["full"] } -futures = "0.3.21" +futures = "0.3.25" [dependencies.chrono] features = ["serde"] diff --git a/plume-common/src/activity_pub/inbox.rs b/plume-common/src/activity_pub/inbox.rs index e2a769ee..e8d36ccb 100644 --- a/plume-common/src/activity_pub/inbox.rs +++ b/plume-common/src/activity_pub/inbox.rs @@ -561,7 +561,7 @@ mod tests { use once_cell::sync::Lazy; use openssl::{hash::MessageDigest, pkey::PKey, rsa::Rsa}; - static MY_SIGNER: Lazy = Lazy::new(|| MySigner::new()); + static MY_SIGNER: Lazy = Lazy::new(MySigner::new); struct MySigner { public_key: String, @@ -596,7 +596,7 @@ mod tests { .unwrap(); let mut verifier = openssl::sign::Verifier::new(MessageDigest::sha256(), &key).unwrap(); verifier.update(data.as_bytes()).unwrap(); - verifier.verify(&signature).map_err(|_| SignError()) + verifier.verify(signature).map_err(|_| SignError()) } } @@ -782,7 +782,7 @@ mod tests { .done(); assert!(res.is_err()); - let res: Result<(), ()> = Inbox::handle(&(), act.clone()) + let res: Result<(), ()> = Inbox::handle(&(), act) .with::(None) .with::(None) .done(); diff --git a/plume-common/src/activity_pub/mod.rs b/plume-common/src/activity_pub/mod.rs index fc5c7bd7..34637399 100644 --- a/plume-common/src/activity_pub/mod.rs +++ b/plume-common/src/activity_pub/mod.rs @@ -518,7 +518,8 @@ mod tests { use super::*; use activitystreams::{ activity::{ActorAndObjectRef, Create}, - object::kind::ArticleType, + object::{kind::ArticleType, Image}, + prelude::{ApActorExt, BaseExt, ExtendsExt, ObjectExt}, }; use assert_json_diff::assert_json_eq; use serde_json::{from_str, json, to_value}; @@ -592,7 +593,7 @@ mod tests { } #[test] - fn de_custom_group() { + fn se_custom_group() { let group = CustomGroup::new( ApActor::new("https://example.com/inbox".parse().unwrap(), Group::new()), ApSignature { @@ -625,6 +626,71 @@ mod tests { assert_eq!(to_value(group).unwrap(), expected); } + #[test] + fn de_custom_group() { + let value: CustomGroup = from_str( + r#" + { + "icon": { + "type": "Image" + }, + "id": "https://plume01.localhost/~/Plume01%20Blog%202/", + "image": { + "type": "Image" + }, + "inbox": "https://plume01.localhost/~/Plume01%20Blog%202/inbox", + "name": "Plume01 Blog 2", + "outbox": "https://plume01.localhost/~/Plume01%20Blog%202/outbox", + "preferredUsername": "Plume01 Blog 2", + "publicKey": { + "id": "https://plume01.localhost/~/Plume01%20Blog%202/#main-key", + "owner": "https://plume01.localhost/~/Plume01%20Blog%202/", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwPGtKkl/iMsNAyeVaJGz\noEz5PoNkjRnKK7G97MFvb4zw9zs5SpzWW7b/pKHa4dODcGDJXmkCJ1H5JWyguzN8\n2GNoFjtEOJHxEGwBHSYDsTmhuLNB0DKxMU2iu55g8iIiXhZiIW1FBNGs/Geaymvr\nh/TEtzdReN8wzloRR55kOVcU49xBkqx8cfDSk/lrrDLlpveHdqgaFnIvuw2vycK0\nxFzS3xlEUpzJk9kHxoR1uEAfZ+gCv26Sgo/HqOAhqSD5IU3QZC3kdkr/hwVqtr8U\nXGkGG6Mo1rgzhkYiCFkWrV2WoKkcEHD4nEzbgoZZ5MyuSoloxnyF3NiScqmqW+Yx\nkQIDAQAB\n-----END PUBLIC KEY-----\n" + }, + "source": { + "content": "", + "mediaType": "text/markdown" + }, + "summary": "", + "type": "Group" + } + "# + ).unwrap(); + let mut expected = CustomGroup::new( + ApActor::new("https://plume01.localhost/~/Plume01%20Blog%202/inbox".parse().unwrap(), Group::new()), + ApSignature { + public_key: PublicKey { + id: "https://plume01.localhost/~/Plume01%20Blog%202/#main-key".parse().unwrap(), + owner: "https://plume01.localhost/~/Plume01%20Blog%202/".parse().unwrap(), + public_key_pem: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwPGtKkl/iMsNAyeVaJGz\noEz5PoNkjRnKK7G97MFvb4zw9zs5SpzWW7b/pKHa4dODcGDJXmkCJ1H5JWyguzN8\n2GNoFjtEOJHxEGwBHSYDsTmhuLNB0DKxMU2iu55g8iIiXhZiIW1FBNGs/Geaymvr\nh/TEtzdReN8wzloRR55kOVcU49xBkqx8cfDSk/lrrDLlpveHdqgaFnIvuw2vycK0\nxFzS3xlEUpzJk9kHxoR1uEAfZ+gCv26Sgo/HqOAhqSD5IU3QZC3kdkr/hwVqtr8U\nXGkGG6Mo1rgzhkYiCFkWrV2WoKkcEHD4nEzbgoZZ5MyuSoloxnyF3NiScqmqW+Yx\nkQIDAQAB\n-----END PUBLIC KEY-----\n".into(), + } + }, + SourceProperty { + source: Source { + content: String::from(""), + media_type: String::from("text/markdown") + } + } + ); + expected.set_icon(Image::new().into_any_base().unwrap()); + expected.set_id( + "https://plume01.localhost/~/Plume01%20Blog%202/" + .parse() + .unwrap(), + ); + expected.set_image(Image::new().into_any_base().unwrap()); + expected.set_name("Plume01 Blog 2"); + expected.set_outbox( + "https://plume01.localhost/~/Plume01%20Blog%202/outbox" + .parse() + .unwrap(), + ); + expected.set_preferred_username("Plume01 Blog 2"); + expected.set_summary(""); + + assert_json_eq!(value, expected); + } + #[test] fn se_licensed_article() { let object = ApObject::new(Article::new()); diff --git a/plume-common/src/activity_pub/request.rs b/plume-common/src/activity_pub/request.rs index 3d60b820..4d5a4097 100644 --- a/plume-common/src/activity_pub/request.rs +++ b/plume-common/src/activity_pub/request.rs @@ -253,7 +253,7 @@ mod tests { .unwrap(); let mut verifier = openssl::sign::Verifier::new(MessageDigest::sha256(), &key).unwrap(); verifier.update(data.as_bytes()).unwrap(); - verifier.verify(&signature).map_err(|_| Error()) + verifier.verify(signature).map_err(|_| Error()) } } @@ -262,7 +262,7 @@ mod tests { let signer = MySigner::new(); let headers = HeaderMap::new(); let result = signature(&signer, &headers, ("post", "/inbox", None)).unwrap(); - let fields: Vec<&str> = result.to_str().unwrap().split(",").collect(); + let fields: Vec<&str> = result.to_str().unwrap().split(',').collect(); assert_eq!(r#"headers="(request-target)""#, fields[2]); let sign = &fields[3][11..(fields[3].len() - 1)]; assert!(signer.verify("post /inbox", sign.as_bytes()).is_ok()); diff --git a/plume-common/src/activity_pub/sign.rs b/plume-common/src/activity_pub/sign.rs index 22aaf9d6..b7613b01 100644 --- a/plume-common/src/activity_pub/sign.rs +++ b/plume-common/src/activity_pub/sign.rs @@ -119,7 +119,7 @@ impl Signable for serde_json::Value { } } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum SignatureValidity { Invalid, ValidNoDigest, diff --git a/plume-front/Cargo.toml b/plume-front/Cargo.toml index 3ea82f17..70e12cff 100644 --- a/plume-front/Cargo.toml +++ b/plume-front/Cargo.toml @@ -4,6 +4,9 @@ version = "0.7.2" authors = ["Plume contributors"] edition = "2018" +[package.metadata.wasm-pack.profile.release] +wasm-opt = false + [lib] crate-type = ["cdylib"] @@ -12,7 +15,7 @@ gettext = "0.4.0" gettext-macros = "0.6.1" gettext-utils = "0.1.0" lazy_static = "1.3" -serde = "1.0" +serde = "1.0.137" serde_json = "1.0" wasm-bindgen = "0.2.81" js-sys = "0.3.58" diff --git a/plume-models/Cargo.toml b/plume-models/Cargo.toml index 49d57365..914bf803 100644 --- a/plume-models/Cargo.toml +++ b/plume-models/Cargo.toml @@ -10,31 +10,31 @@ bcrypt = "0.12.1" guid-create = "0.2" itertools = "0.10.3" lazy_static = "1.0" -ldap3 = "0.10.5" +ldap3 = "0.11.1" migrations_internals= "1.4.0" openssl = "0.10.40" rocket = "0.4.11" rocket_i18n = "0.4.1" reqwest = "0.11.11" scheduled-thread-pool = "0.2.6" -serde = "1.0" +serde = "1.0.137" serde_derive = "1.0" serde_json = "1.0.81" tantivy = "0.13.3" url = "2.1" walkdir = "2.2" webfinger = "0.4.1" -whatlang = "0.16.0" +whatlang = "0.16.2" shrinkwraprs = "0.3.0" diesel-derive-newtype = "1.0.0" -glob = "0.3.0" +glob = "0.3.1" lindera-tantivy = { version = "0.7.1", optional = true } tracing = "0.1.35" riker = "0.4.2" once_cell = "1.12.0" lettre = "0.9.6" native-tls = "0.2.10" -activitystreams = "0.7.0-alpha.18" +activitystreams = "=0.7.0-alpha.20" [dependencies.chrono] features = ["serde"] diff --git a/plume-models/src/api_tokens.rs b/plume-models/src/api_tokens.rs index dfff4135..2a9d3618 100644 --- a/plume-models/src/api_tokens.rs +++ b/plume-models/src/api_tokens.rs @@ -103,7 +103,7 @@ impl<'a, 'r> FromRequest<'a, 'r> for ApiToken { let conn = request .guard::() .map_failure(|_| (Status::InternalServerError, TokenError::DbError))?; - if let Ok(token) = ApiToken::find_by_value(&*conn, val) { + if let Ok(token) = ApiToken::find_by_value(&conn, val) { return Outcome::Success(token); } } diff --git a/plume-models/src/blocklisted_emails.rs b/plume-models/src/blocklisted_emails.rs index 3d9928b3..ce258c85 100644 --- a/plume-models/src/blocklisted_emails.rs +++ b/plume-models/src/blocklisted_emails.rs @@ -126,12 +126,9 @@ pub(crate) mod tests { .id, various[1].id ); - assert_eq!( - BlocklistedEmail::matches_blocklist(&conn, no_match) - .unwrap() - .is_none(), - true - ); + assert!(BlocklistedEmail::matches_blocklist(&conn, no_match) + .unwrap() + .is_none()); Ok(()) }); } diff --git a/plume-models/src/blogs.rs b/plume-models/src/blogs.rs index 0331cbaf..478283e5 100644 --- a/plume-models/src/blogs.rs +++ b/plume-models/src/blogs.rs @@ -18,10 +18,13 @@ use openssl::{ rsa::Rsa, sign::{Signer, Verifier}, }; -use plume_common::activity_pub::{ - inbox::{AsActor, FromId}, - sign, ActivityStream, ApSignature, CustomGroup, Id, IntoId, PublicKey, Source, SourceProperty, - ToAsString, ToAsUri, +use plume_common::{ + activity_pub::{ + inbox::{AsActor, FromId}, + sign, ActivityStream, ApSignature, CustomGroup, Id, IntoId, PublicKey, Source, + SourceProperty, ToAsString, ToAsUri, + }, + utils::iri_percent_encode_seg, }; use webfinger::*; @@ -83,9 +86,13 @@ impl Blog { if inserted.fqn.is_empty() { if instance.local { - inserted.fqn = inserted.actor_id.clone(); + inserted.fqn = iri_percent_encode_seg(&inserted.actor_id); } else { - inserted.fqn = format!("{}@{}", inserted.actor_id, instance.public_domain); + inserted.fqn = format!( + "{}@{}", + iri_percent_encode_seg(&inserted.actor_id), + instance.public_domain + ); } } @@ -166,7 +173,7 @@ impl Blog { pub fn to_activity(&self, conn: &Connection) -> Result { let mut blog = ApActor::new(self.inbox_url.parse()?, Group::new()); - blog.set_preferred_username(self.actor_id.clone()); + blog.set_preferred_username(iri_percent_encode_seg(&self.actor_id)); blog.set_name(self.title.clone()); blog.set_outbox(self.outbox_url.parse()?); blog.set_summary(self.summary_html.to_string()); @@ -381,6 +388,7 @@ impl FromId for Blog { .ok_or(Error::MissingApProperty)? .to_string(); if name.contains(&['<', '>', '&', '@', '\'', '"', ' ', '\t'][..]) { + tracing::error!("preferredUsername includes invalid character(s): {}", &name); return Err(Error::InvalidValue); } ( @@ -660,7 +668,7 @@ pub(crate) mod tests { .unwrap() .id, ); - let _: Blog = blog1.save_changes(&*conn).unwrap(); + let _: Blog = blog1.save_changes(conn).unwrap(); (users, vec![blog1, blog2, blog3]) } @@ -669,10 +677,10 @@ pub(crate) mod tests { fn get_instance() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - fill_database(&conn); + fill_database(conn); let blog = Blog::insert( - &conn, + conn, NewBlog::new_local( "SomeName".to_owned(), "Some name".to_owned(), @@ -684,7 +692,7 @@ pub(crate) mod tests { .unwrap(); assert_eq!( - blog.get_instance(&conn).unwrap().id, + blog.get_instance(conn).unwrap().id, Instance::get_local().unwrap().id ); // TODO add tests for remote instance @@ -696,10 +704,10 @@ pub(crate) mod tests { fn authors() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (user, _) = fill_database(&conn); + let (user, _) = fill_database(conn); let b1 = Blog::insert( - &conn, + conn, NewBlog::new_local( "SomeName".to_owned(), "Some name".to_owned(), @@ -710,7 +718,7 @@ pub(crate) mod tests { ) .unwrap(); let b2 = Blog::insert( - &conn, + conn, NewBlog::new_local( "Blog".to_owned(), "Blog".to_owned(), @@ -723,7 +731,7 @@ pub(crate) mod tests { let blog = vec![b1, b2]; BlogAuthor::insert( - &conn, + conn, NewBlogAuthor { blog_id: blog[0].id, author_id: user[0].id, @@ -733,7 +741,7 @@ pub(crate) mod tests { .unwrap(); BlogAuthor::insert( - &conn, + conn, NewBlogAuthor { blog_id: blog[0].id, author_id: user[1].id, @@ -743,7 +751,7 @@ pub(crate) mod tests { .unwrap(); BlogAuthor::insert( - &conn, + conn, NewBlogAuthor { blog_id: blog[1].id, author_id: user[0].id, @@ -753,39 +761,39 @@ pub(crate) mod tests { .unwrap(); assert!(blog[0] - .list_authors(&conn) + .list_authors(conn) .unwrap() .iter() .any(|a| a.id == user[0].id)); assert!(blog[0] - .list_authors(&conn) + .list_authors(conn) .unwrap() .iter() .any(|a| a.id == user[1].id)); assert!(blog[1] - .list_authors(&conn) + .list_authors(conn) .unwrap() .iter() .any(|a| a.id == user[0].id)); assert!(!blog[1] - .list_authors(&conn) + .list_authors(conn) .unwrap() .iter() .any(|a| a.id == user[1].id)); - assert!(Blog::find_for_author(&conn, &user[0]) + assert!(Blog::find_for_author(conn, &user[0]) .unwrap() .iter() .any(|b| b.id == blog[0].id)); - assert!(Blog::find_for_author(&conn, &user[1]) + assert!(Blog::find_for_author(conn, &user[1]) .unwrap() .iter() .any(|b| b.id == blog[0].id)); - assert!(Blog::find_for_author(&conn, &user[0]) + assert!(Blog::find_for_author(conn, &user[0]) .unwrap() .iter() .any(|b| b.id == blog[1].id)); - assert!(!Blog::find_for_author(&conn, &user[1]) + assert!(!Blog::find_for_author(conn, &user[1]) .unwrap() .iter() .any(|b| b.id == blog[1].id)); @@ -797,10 +805,10 @@ pub(crate) mod tests { fn find_local() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - fill_database(&conn); + fill_database(conn); let blog = Blog::insert( - &conn, + conn, NewBlog::new_local( "SomeName".to_owned(), "Some name".to_owned(), @@ -811,7 +819,7 @@ pub(crate) mod tests { ) .unwrap(); - assert_eq!(Blog::find_by_fqn(&conn, "SomeName").unwrap().id, blog.id); + assert_eq!(Blog::find_by_fqn(conn, "SomeName").unwrap().id, blog.id); Ok(()) }) } @@ -820,10 +828,10 @@ pub(crate) mod tests { fn get_fqn() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - fill_database(&conn); + fill_database(conn); let blog = Blog::insert( - &conn, + conn, NewBlog::new_local( "SomeName".to_owned(), "Some name".to_owned(), @@ -843,10 +851,10 @@ pub(crate) mod tests { fn delete() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (_, blogs) = fill_database(&conn); + let (_, blogs) = fill_database(conn); - blogs[0].delete(&conn).unwrap(); - assert!(Blog::get(&conn, blogs[0].id).is_err()); + blogs[0].delete(conn).unwrap(); + assert!(Blog::get(conn, blogs[0].id).is_err()); Ok(()) }) } @@ -855,10 +863,10 @@ pub(crate) mod tests { fn delete_via_user() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (user, _) = fill_database(&conn); + let (user, _) = fill_database(conn); let b1 = Blog::insert( - &conn, + conn, NewBlog::new_local( "SomeName".to_owned(), "Some name".to_owned(), @@ -869,7 +877,7 @@ pub(crate) mod tests { ) .unwrap(); let b2 = Blog::insert( - &conn, + conn, NewBlog::new_local( "Blog".to_owned(), "Blog".to_owned(), @@ -882,7 +890,7 @@ pub(crate) mod tests { let blog = vec![b1, b2]; BlogAuthor::insert( - &conn, + conn, NewBlogAuthor { blog_id: blog[0].id, author_id: user[0].id, @@ -892,7 +900,7 @@ pub(crate) mod tests { .unwrap(); BlogAuthor::insert( - &conn, + conn, NewBlogAuthor { blog_id: blog[0].id, author_id: user[1].id, @@ -902,7 +910,7 @@ pub(crate) mod tests { .unwrap(); BlogAuthor::insert( - &conn, + conn, NewBlogAuthor { blog_id: blog[1].id, author_id: user[0].id, @@ -911,11 +919,11 @@ pub(crate) mod tests { ) .unwrap(); - user[0].delete(&conn).unwrap(); - assert!(Blog::get(&conn, blog[0].id).is_ok()); - assert!(Blog::get(&conn, blog[1].id).is_err()); - user[1].delete(&conn).unwrap(); - assert!(Blog::get(&conn, blog[0].id).is_err()); + user[0].delete(conn).unwrap(); + assert!(Blog::get(conn, blog[0].id).is_ok()); + assert!(Blog::get(conn, blog[1].id).is_err()); + user[1].delete(conn).unwrap(); + assert!(Blog::get(conn, blog[0].id).is_err()); Ok(()) }) } @@ -924,10 +932,10 @@ pub(crate) mod tests { fn self_federation() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (users, mut blogs) = fill_database(&conn); + let (users, mut blogs) = fill_database(conn); blogs[0].icon_id = Some( Media::insert( - &conn, + conn, NewMedia { file_path: "aaa.png".into(), alt_text: String::new(), @@ -943,7 +951,7 @@ pub(crate) mod tests { ); blogs[0].banner_id = Some( Media::insert( - &conn, + conn, NewMedia { file_path: "bbb.png".into(), alt_text: String::new(), @@ -958,9 +966,9 @@ pub(crate) mod tests { .id, ); let _: Blog = blogs[0].save_changes(&**conn).unwrap(); - let ap_repr = blogs[0].to_activity(&conn).unwrap(); - blogs[0].delete(&conn).unwrap(); - let blog = Blog::from_activity(&conn, ap_repr).unwrap(); + let ap_repr = blogs[0].to_activity(conn).unwrap(); + blogs[0].delete(conn).unwrap(); + let blog = Blog::from_activity(conn, ap_repr).unwrap(); assert_eq!(blog.actor_id, blogs[0].actor_id); assert_eq!(blog.title, blogs[0].title); @@ -972,8 +980,8 @@ pub(crate) mod tests { assert_eq!(blog.public_key, blogs[0].public_key); assert_eq!(blog.fqn, blogs[0].fqn); assert_eq!(blog.summary_html, blogs[0].summary_html); - assert_eq!(blog.icon_url(&conn), blogs[0].icon_url(&conn)); - assert_eq!(blog.banner_url(&conn), blogs[0].banner_url(&conn)); + assert_eq!(blog.icon_url(conn), blogs[0].icon_url(conn)); + assert_eq!(blog.banner_url(conn), blogs[0].banner_url(conn)); Ok(()) }) @@ -983,7 +991,7 @@ pub(crate) mod tests { fn to_activity() { let conn = &db(); conn.test_transaction::<_, Error, _>(|| { - let (_users, blogs) = fill_database(&conn); + let (_users, blogs) = fill_database(conn); let blog = &blogs[0]; let act = blog.to_activity(conn)?; diff --git a/plume-models/src/comments.rs b/plume-models/src/comments.rs index 6c133dd2..2f06dada 100644 --- a/plume-models/src/comments.rs +++ b/plume-models/src/comments.rs @@ -430,7 +430,7 @@ mod tests { use serde_json::{json, to_value}; fn prepare_activity(conn: &DbConn) -> (Comment, Vec, Vec, Vec) { - let (posts, users, blogs) = fill_database(&conn); + let (posts, users, blogs) = fill_database(conn); let comment = Comment::insert( conn, @@ -456,8 +456,8 @@ mod tests { fn self_federation() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (original_comm, posts, users, _blogs) = prepare_activity(&conn); - let act = original_comm.create_activity(&conn).unwrap(); + let (original_comm, posts, users, _blogs) = prepare_activity(conn); + let act = original_comm.create_activity(conn).unwrap(); assert_json_eq!(to_value(&act).unwrap(), json!({ "actor": "https://plu.me/@/admin/", @@ -499,7 +499,7 @@ mod tests { }, ) .unwrap(); - let reply_act = reply.create_activity(&conn).unwrap(); + let reply_act = reply.create_activity(conn).unwrap(); assert_json_eq!(to_value(&reply_act).unwrap(), json!({ "actor": "https://plu.me/@/user/", @@ -521,12 +521,12 @@ mod tests { })); inbox( - &conn, - serde_json::to_value(original_comm.build_delete(&conn).unwrap()).unwrap(), + conn, + serde_json::to_value(original_comm.build_delete(conn).unwrap()).unwrap(), ) .unwrap(); - match inbox(&conn, to_value(act).unwrap()).unwrap() { + match inbox(conn, to_value(act).unwrap()).unwrap() { InboxResult::Commented(c) => { // TODO: one is HTML, the other markdown: assert_eq!(c.content, original_comm.content); assert_eq!(c.in_response_to_id, original_comm.in_response_to_id); diff --git a/plume-models/src/db_conn.rs b/plume-models/src/db_conn.rs index 5e461b18..1f683f7f 100644 --- a/plume-models/src/db_conn.rs +++ b/plume-models/src/db_conn.rs @@ -69,7 +69,8 @@ pub(crate) mod tests { impl CustomizeConnection for TestConnectionCustomizer { fn on_acquire(&self, conn: &mut Connection) -> Result<(), ConnError> { PragmaForeignKey.on_acquire(conn)?; - Ok(conn.begin_test_transaction().unwrap()) + conn.begin_test_transaction().unwrap(); + Ok(()) } } } diff --git a/plume-models/src/email_signups.rs b/plume-models/src/email_signups.rs index 6867e7c7..55fa1646 100644 --- a/plume-models/src/email_signups.rs +++ b/plume-models/src/email_signups.rs @@ -1,4 +1,5 @@ use crate::{ + blocklisted_emails::BlocklistedEmail, db_conn::DbConn, schema::email_signups, users::{NewUser, Role, User}, @@ -60,6 +61,8 @@ pub struct NewEmailSignup<'a> { impl EmailSignup { pub fn start(conn: &DbConn, email: &str) -> Result { + Self::ensure_email_not_blocked(conn, email)?; + conn.transaction(|| { Self::ensure_user_not_exist_by_email(conn, email)?; let _rows = Self::delete_existings_by_email(conn, email)?; @@ -90,6 +93,8 @@ impl EmailSignup { } pub fn confirm(&self, conn: &DbConn) -> Result<()> { + Self::ensure_email_not_blocked(conn, &self.email)?; + conn.transaction(|| { Self::ensure_user_not_exist_by_email(conn, &self.email)?; if self.expired() { @@ -101,6 +106,8 @@ impl EmailSignup { } pub fn complete(&self, conn: &DbConn, username: String, password: String) -> Result { + Self::ensure_email_not_blocked(conn, &self.email)?; + conn.transaction(|| { Self::ensure_user_not_exist_by_email(conn, &self.email)?; let user = NewUser::new_local( @@ -122,6 +129,14 @@ impl EmailSignup { Ok(()) } + fn ensure_email_not_blocked(conn: &DbConn, email: &str) -> Result<()> { + if let Some(x) = BlocklistedEmail::matches_blocklist(conn, email)? { + Err(Error::Blocklisted(x.notify_user, x.notification_text)) + } else { + Ok(()) + } + } + fn ensure_user_not_exist_by_email(conn: &DbConn, email: &str) -> Result<()> { if User::email_used(conn, email)? { let _rows = Self::delete_existings_by_email(conn, email)?; diff --git a/plume-models/src/follows.rs b/plume-models/src/follows.rs index 91624ee3..8f79430b 100644 --- a/plume-models/src/follows.rs +++ b/plume-models/src/follows.rs @@ -107,12 +107,7 @@ impl Follow { res.notify(conn)?; let accept = res.build_accept(from, target, follow)?; - broadcast( - &*target, - accept, - vec![from.clone()], - CONFIG.proxy().cloned(), - ); + broadcast(target, accept, vec![from.clone()], CONFIG.proxy().cloned()); Ok(res) } diff --git a/plume-models/src/inbox.rs b/plume-models/src/inbox.rs index e52b0168..ab10ca8e 100644 --- a/plume-models/src/inbox.rs +++ b/plume-models/src/inbox.rs @@ -82,9 +82,9 @@ pub(crate) mod tests { use crate::post_authors::*; use crate::posts::*; - let (users, blogs) = blog_fill_db(&conn); + let (users, blogs) = blog_fill_db(conn); let post = Post::insert( - &conn, + conn, NewPost { blog_id: blogs[0].id, slug: "testing".to_owned(), @@ -102,7 +102,7 @@ pub(crate) mod tests { .unwrap(); PostAuthor::insert( - &conn, + conn, NewPostAuthor { post_id: post.id, author_id: users[0].id, @@ -190,7 +190,7 @@ pub(crate) mod tests { }); assert!(matches!( - super::inbox(&conn, act.clone()), + super::inbox(&conn, act), Err(super::Error::Inbox( box plume_common::activity_pub::inbox::InboxError::InvalidObject(_), )) @@ -221,7 +221,7 @@ pub(crate) mod tests { }); assert!(matches!( - super::inbox(&conn, act.clone()), + super::inbox(&conn, act), Err(super::Error::Inbox( box plume_common::activity_pub::inbox::InboxError::InvalidObject(_), )) @@ -249,7 +249,7 @@ pub(crate) mod tests { }); assert!(matches!( - super::inbox(&conn, act.clone()), + super::inbox(&conn, act), Err(super::Error::Inbox( box plume_common::activity_pub::inbox::InboxError::InvalidObject(_), )) @@ -324,7 +324,7 @@ pub(crate) mod tests { }); assert!(matches!( - super::inbox(&conn, act.clone()), + super::inbox(&conn, act), Err(super::Error::Inbox( box plume_common::activity_pub::inbox::InboxError::InvalidObject(_), )) @@ -362,7 +362,7 @@ pub(crate) mod tests { }); assert!(matches!( - super::inbox(&conn, act.clone()), + super::inbox(&conn, act), Err(super::Error::Inbox( box plume_common::activity_pub::inbox::InboxError::InvalidObject(_), )) @@ -397,7 +397,7 @@ pub(crate) mod tests { }); assert!(matches!( - super::inbox(&conn, act.clone()), + super::inbox(&conn, act), Err(super::Error::Inbox( box plume_common::activity_pub::inbox::InboxError::InvalidObject(_), )) diff --git a/plume-models/src/instance.rs b/plume-models/src/instance.rs index 86cb3d46..3da8cbb8 100644 --- a/plume-models/src/instance.rs +++ b/plume-models/src/instance.rs @@ -9,7 +9,7 @@ use crate::{ use chrono::NaiveDateTime; use diesel::{self, result::Error::NotFound, ExpressionMethods, QueryDsl, RunQueryDsl}; use once_cell::sync::OnceCell; -use plume_common::utils::md_to_html; +use plume_common::utils::{iri_percent_encode_seg, md_to_html}; use std::sync::RwLock; #[derive(Clone, Identifiable, Queryable)] @@ -173,8 +173,8 @@ impl Instance { "{instance}/{prefix}/{name}/{box_name}", instance = self.public_domain, prefix = prefix, - name = name, - box_name = box_name + name = iri_percent_encode_seg(name), + box_name = iri_percent_encode_seg(box_name) )) } @@ -523,7 +523,7 @@ pub(crate) mod tests { .unwrap(); let inst = Instance::get(conn, inst.id).unwrap(); assert_eq!(inst.name, "NewName".to_owned()); - assert_eq!(inst.open_registrations, false); + assert!(!inst.open_registrations); assert_eq!( inst.long_description.get(), "[long_description](/with_link)" diff --git a/plume-models/src/lib.rs b/plume-models/src/lib.rs index c9c991b4..e74a201c 100644 --- a/plume-models/src/lib.rs +++ b/plume-models/src/lib.rs @@ -177,7 +177,7 @@ pub type Result = std::result::Result; /// /// Usage: /// -/// ```rust +/// ```ignore /// impl Model { /// find_by!(model_table, name_of_the_function, field1 as String, field2 as i32); /// } @@ -201,7 +201,7 @@ macro_rules! find_by { /// /// Usage: /// -/// ```rust +/// ```ignore /// impl Model { /// list_by!(model_table, name_of_the_function, field1 as String); /// } @@ -225,7 +225,7 @@ macro_rules! list_by { /// /// # Usage /// -/// ```rust +/// ```ignore /// impl Model { /// get!(model_table); /// } @@ -248,7 +248,7 @@ macro_rules! get { /// /// # Usage /// -/// ```rust +/// ```ignore /// impl Model { /// insert!(model_table, NewModelType); /// } @@ -280,7 +280,7 @@ macro_rules! insert { /// /// # Usage /// -/// ```rust +/// ```ignore /// impl Model { /// last!(model_table); /// } @@ -354,7 +354,7 @@ mod tests { }; } - pub fn db<'a>() -> db_conn::DbConn { + pub fn db() -> db_conn::DbConn { db_conn::DbConn((*DB_POOL).get().unwrap()) } diff --git a/plume-models/src/likes.rs b/plume-models/src/likes.rs index 7a517d9c..e76d625d 100644 --- a/plume-models/src/likes.rs +++ b/plume-models/src/likes.rs @@ -199,7 +199,7 @@ mod tests { let (posts, _users, _blogs) = fill_database(&conn); let post = &posts[0]; let user = &post.get_authors(&conn)?[0]; - let like = Like::insert(&*conn, NewLike::new(post, user))?; + let like = Like::insert(&conn, NewLike::new(post, user))?; let act = like.to_activity(&conn).unwrap(); let expected = json!({ @@ -223,8 +223,8 @@ mod tests { let (posts, _users, _blogs) = fill_database(&conn); let post = &posts[0]; let user = &post.get_authors(&conn)?[0]; - let like = Like::insert(&*conn, NewLike::new(post, user))?; - let act = like.build_undo(&*conn)?; + let like = Like::insert(&conn, NewLike::new(post, user))?; + let act = like.build_undo(&conn)?; let expected = json!({ "actor": "https://plu.me/@/admin/", diff --git a/plume-models/src/lists.rs b/plume-models/src/lists.rs index 9dea12d7..6e7899ad 100644 --- a/plume-models/src/lists.rs +++ b/plume-models/src/lists.rs @@ -435,7 +435,7 @@ mod tests { &List::find_for_user_by_name(conn, l1.user_id, &l1.name).unwrap(), ); l_eq( - &&l1u, + &l1u, &List::find_for_user_by_name(conn, l1u.user_id, &l1u.name).unwrap(), ); Ok(()) diff --git a/plume-models/src/medias.rs b/plume-models/src/medias.rs index 078ea913..d3474a2b 100644 --- a/plume-models/src/medias.rs +++ b/plume-models/src/medias.rs @@ -42,7 +42,7 @@ pub struct NewMedia { pub owner_id: i32, } -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub enum MediaCategory { Image, Audio, @@ -343,7 +343,7 @@ pub(crate) mod tests { use std::path::Path; pub(crate) fn fill_database(conn: &Conn) -> (Vec, Vec) { - let mut wd = current_dir().unwrap().to_path_buf(); + let mut wd = current_dir().unwrap(); while wd.pop() { if wd.join(".git").exists() { set_current_dir(wd).unwrap(); @@ -456,7 +456,7 @@ pub(crate) mod tests { let media = Media::insert( conn, NewMedia { - file_path: path.clone(), + file_path: path, alt_text: "alt message".to_owned(), is_remote: false, remote_url: None, diff --git a/plume-models/src/password_reset_requests.rs b/plume-models/src/password_reset_requests.rs index cfd93529..332fdf93 100644 --- a/plume-models/src/password_reset_requests.rs +++ b/plume-models/src/password_reset_requests.rs @@ -89,7 +89,7 @@ mod tests { let request = PasswordResetRequest::find_by_token(&conn, &token) .expect("couldn't retrieve request"); - assert!(&token.len() > &32); + assert!(token.len() > 32); assert_eq!(&request.email, &admin_email); Ok(()) @@ -103,8 +103,8 @@ mod tests { user_tests::fill_database(&conn); let admin_email = "admin@example.com"; - PasswordResetRequest::insert(&conn, &admin_email).expect("couldn't insert new request"); - PasswordResetRequest::insert(&conn, &admin_email) + PasswordResetRequest::insert(&conn, admin_email).expect("couldn't insert new request"); + PasswordResetRequest::insert(&conn, admin_email) .expect("couldn't insert second request"); let count = password_reset_requests::table.count().get_result(&*conn); @@ -132,7 +132,7 @@ mod tests { .execute(&*conn) .expect("could not insert request"); - match PasswordResetRequest::find_by_token(&conn, &token) { + match PasswordResetRequest::find_by_token(&conn, token) { Err(Error::Expired) => (), _ => panic!("Received unexpected result finding expired token"), } @@ -148,7 +148,7 @@ mod tests { user_tests::fill_database(&conn); let admin_email = "admin@example.com"; - let token = PasswordResetRequest::insert(&conn, &admin_email) + let token = PasswordResetRequest::insert(&conn, admin_email) .expect("couldn't insert new request"); PasswordResetRequest::find_and_delete_by_token(&conn, &token) .expect("couldn't find and delete request"); diff --git a/plume-models/src/posts.rs b/plume-models/src/posts.rs index 0137dd2b..d9a63c3b 100644 --- a/plume-models/src/posts.rs +++ b/plume-models/src/posts.rs @@ -134,7 +134,7 @@ impl Post { .filter(posts::published.eq(true)) .count() .load(conn)? - .get(0) + .first() .cloned() .ok_or(Error::NotFound) } @@ -255,7 +255,7 @@ impl Post { ap_url(&format!( "{}/~/{}/{}/", CONFIG.base_url, - blog.fqn, + iri_percent_encode_seg(&blog.fqn), iri_percent_encode_seg(slug) )) } @@ -465,7 +465,7 @@ impl Post { .collect::>(); for (m, id) in &mentions { if !old_user_mentioned.contains(id) { - Mention::from_activity(&*conn, m, self.id, true, true)?; + Mention::from_activity(conn, m, self.id, true, true)?; } } @@ -488,7 +488,7 @@ impl Post { .filter_map(|t| t.name.as_ref().map(|name| name.as_str().to_string())) .collect::>(); - let old_tags = Tag::for_post(&*conn, self.id)?; + let old_tags = Tag::for_post(conn, self.id)?; let old_tags_name = old_tags .iter() .filter_map(|tag| { @@ -525,7 +525,7 @@ impl Post { .filter_map(|t| t.name.as_ref().map(|name| name.as_str().to_string())) .collect::>(); - let old_tags = Tag::for_post(&*conn, self.id)?; + let old_tags = Tag::for_post(conn, self.id)?; let old_tags_name = old_tags .iter() .filter_map(|tag| { @@ -756,7 +756,11 @@ impl FromId for Post { let timestamp_secs = published.unix_timestamp(); let timestamp_nanos = published.unix_timestamp_nanos() - (timestamp_secs as i128) * 1000i128 * 1000i128 * 1000i128; - NaiveDateTime::from_timestamp(timestamp_secs, timestamp_nanos as u32) + NaiveDateTime::from_timestamp_opt( + timestamp_secs, + timestamp_nanos as u32, + ) + .unwrap() }), subtitle: article .summary() @@ -1036,7 +1040,7 @@ mod tests { let post = &posts[0]; let mentioned = &users[1]; let mention = Mention::insert( - &conn, + conn, NewMention { mentioned_id: mentioned.id, post_id: Some(post.id), @@ -1044,7 +1048,7 @@ mod tests { }, ) .unwrap(); - (post.to_owned(), mention.to_owned(), posts, users, blogs) + (post.to_owned(), mention, posts, users, blogs) } // creates a post, get it's Create activity, delete the post, @@ -1053,9 +1057,9 @@ mod tests { fn self_federation() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (_, users, blogs) = fill_database(&conn); + let (_, users, blogs) = fill_database(conn); let post = Post::insert( - &conn, + conn, NewPost { blog_id: blogs[0].id, slug: "yo".into(), @@ -1072,19 +1076,19 @@ mod tests { ) .unwrap(); PostAuthor::insert( - &conn, + conn, NewPostAuthor { post_id: post.id, author_id: users[0].id, }, ) .unwrap(); - let create = post.create_activity(&conn).unwrap(); - post.delete(&conn).unwrap(); + let create = post.create_activity(conn).unwrap(); + post.delete(conn).unwrap(); - match inbox(&conn, serde_json::to_value(create).unwrap()).unwrap() { + match inbox(conn, serde_json::to_value(create).unwrap()).unwrap() { InboxResult::Post(p) => { - assert!(p.is_author(&conn, users[0].id).unwrap()); + assert!(p.is_author(conn, users[0].id).unwrap()); assert_eq!(p.source, "Hello".to_owned()); assert_eq!(p.blog_id, blogs[0].id); assert_eq!(p.content, SafeString::new("Hello")); @@ -1221,7 +1225,7 @@ mod tests { let actual = to_value(act)?; let id = actual["id"].to_string(); - let (id_pre, id_post) = id.rsplit_once("-").unwrap(); + let (id_pre, id_post) = id.rsplit_once('-').unwrap(); assert_eq!(post.ap_url, "https://plu.me/~/BlogName/testing"); assert_eq!( id_pre, diff --git a/plume-models/src/remote_fetch_actor.rs b/plume-models/src/remote_fetch_actor.rs index e45a0e46..ea0ecc2d 100644 --- a/plume-models/src/remote_fetch_actor.rs +++ b/plume-models/src/remote_fetch_actor.rs @@ -45,6 +45,12 @@ impl Actor for RemoteFetchActor { RemoteUserFound(user) => match self.conn.get() { Ok(conn) => { let conn = DbConn(conn); + if user + .get_instance(&conn) + .map_or(false, |instance| instance.blocked) + { + return; + } // Don't call these functions in parallel // for the case database connections limit is too small fetch_and_cache_articles(&user, &conn); diff --git a/plume-models/src/reshares.rs b/plume-models/src/reshares.rs index 46ab1760..709f73b8 100644 --- a/plume-models/src/reshares.rs +++ b/plume-models/src/reshares.rs @@ -229,7 +229,7 @@ mod test { let (posts, _users, _blogs) = fill_database(&conn); let post = &posts[0]; let user = &post.get_authors(&conn)?[0]; - let reshare = Reshare::insert(&*conn, NewReshare::new(post, user))?; + let reshare = Reshare::insert(&conn, NewReshare::new(post, user))?; let act = reshare.to_activity(&conn).unwrap(); let expected = json!({ @@ -253,8 +253,8 @@ mod test { let (posts, _users, _blogs) = fill_database(&conn); let post = &posts[0]; let user = &post.get_authors(&conn)?[0]; - let reshare = Reshare::insert(&*conn, NewReshare::new(post, user))?; - let act = reshare.build_undo(&*conn)?; + let reshare = Reshare::insert(&conn, NewReshare::new(post, user))?; + let act = reshare.build_undo(&conn)?; let expected = json!({ "actor": "https://plu.me/@/admin/", diff --git a/plume-models/src/safe_string.rs b/plume-models/src/safe_string.rs index fedcdd70..7560aa43 100644 --- a/plume-models/src/safe_string.rs +++ b/plume-models/src/safe_string.rs @@ -93,7 +93,7 @@ fn url_add_prefix(url: &str) -> Option> { } } -#[derive(Debug, Clone, PartialEq, AsExpression, FromSqlRow, Default)] +#[derive(Debug, Clone, PartialEq, Eq, AsExpression, FromSqlRow, Default)] #[sql_type = "Text"] pub struct SafeString { value: String, diff --git a/plume-models/src/search/actor.rs b/plume-models/src/search/actor.rs index d97718e0..0b8afcfb 100644 --- a/plume-models/src/search/actor.rs +++ b/plume-models/src/search/actor.rs @@ -108,7 +108,7 @@ mod tests { let searcher = Arc::new(get_searcher(&CONFIG.search_tokenizers)); SearchActor::init(searcher.clone(), db_pool.clone()); - let conn = db_pool.clone().get().unwrap(); + let conn = db_pool.get().unwrap(); let title = random_hex()[..8].to_owned(); let (_instance, _user, blog) = fill_database(&conn); @@ -161,41 +161,43 @@ mod tests { long_description_html: "

Good morning

".to_string(), short_description: SafeString::new("Hello"), short_description_html: "

Hello

".to_string(), - name: random_hex().to_string(), + name: random_hex(), open_registrations: true, - public_domain: random_hex().to_string(), + public_domain: random_hex(), }, ) .unwrap(); let user = User::insert( conn, NewUser { - username: random_hex().to_string(), - display_name: random_hex().to_string(), - outbox_url: random_hex().to_string(), - inbox_url: random_hex().to_string(), + username: random_hex(), + display_name: random_hex(), + outbox_url: random_hex(), + inbox_url: random_hex(), summary: "".to_string(), email: None, hashed_password: None, instance_id: instance.id, - ap_url: random_hex().to_string(), + ap_url: random_hex(), private_key: None, public_key: "".to_string(), shared_inbox_url: None, - followers_endpoint: random_hex().to_string(), + followers_endpoint: random_hex(), avatar_id: None, summary_html: SafeString::new(""), role: 0, - fqn: random_hex().to_string(), + fqn: random_hex(), }, ) .unwrap(); - let mut blog = NewBlog::default(); - blog.instance_id = instance.id; - blog.actor_id = random_hex().to_string(); - blog.ap_url = random_hex().to_string(); - blog.inbox_url = random_hex().to_string(); - blog.outbox_url = random_hex().to_string(); + let blog = NewBlog { + instance_id: instance.id, + actor_id: random_hex(), + ap_url: random_hex(), + inbox_url: random_hex(), + outbox_url: random_hex(), + ..Default::default() + }; let blog = Blog::insert(conn, blog).unwrap(); BlogAuthor::insert( conn, diff --git a/plume-models/src/search/mod.rs b/plume-models/src/search/mod.rs index 917f7778..2948ac36 100644 --- a/plume-models/src/search/mod.rs +++ b/plume-models/src/search/mod.rs @@ -154,7 +154,7 @@ pub(crate) mod tests { }, ) .unwrap(); - searcher.add_document(&conn, &post).unwrap(); + searcher.add_document(conn, &post).unwrap(); searcher.commit(); assert_eq!( searcher.search_document(conn, Query::from_str(&title).unwrap(), (0, 1))[0].id, diff --git a/plume-models/src/search/query.rs b/plume-models/src/search/query.rs index a2c4f252..5dcd605c 100644 --- a/plume-models/src/search/query.rs +++ b/plume-models/src/search/query.rs @@ -94,7 +94,7 @@ macro_rules! gen_to_string { )* $( for val in &$self.$date { - $result.push_str(&format!("{}:{} ", stringify!($date), NaiveDate::from_num_days_from_ce(*val as i32).format("%Y-%m-%d"))); + $result.push_str(&format!("{}:{} ", stringify!($date), NaiveDate::from_num_days_from_ce_opt(*val as i32).unwrap().format("%Y-%m-%d"))); } )* } @@ -180,12 +180,16 @@ impl PlumeQuery { if self.before.is_some() || self.after.is_some() { // if at least one range bound is provided - let after = self - .after - .unwrap_or_else(|| i64::from(NaiveDate::from_ymd(2000, 1, 1).num_days_from_ce())); + let after = self.after.unwrap_or_else(|| { + i64::from( + NaiveDate::from_ymd_opt(2000, 1, 1) + .unwrap() + .num_days_from_ce(), + ) + }); let before = self .before - .unwrap_or_else(|| i64::from(Utc::today().num_days_from_ce())); + .unwrap_or_else(|| i64::from(Utc::now().date_naive().num_days_from_ce())); let field = Searcher::schema().get_field("creation_date").unwrap(); let range = RangeQuery::new_i64_bounds(field, Bound::Included(after), Bound::Included(before)); @@ -202,16 +206,20 @@ impl PlumeQuery { pub fn before(&mut self, date: &D) -> &mut Self { let before = self .before - .unwrap_or_else(|| i64::from(Utc::today().num_days_from_ce())); + .unwrap_or_else(|| i64::from(Utc::now().date_naive().num_days_from_ce())); self.before = Some(cmp::min(before, i64::from(date.num_days_from_ce()))); self } // documents older than the provided date will be ignored pub fn after(&mut self, date: &D) -> &mut Self { - let after = self - .after - .unwrap_or_else(|| i64::from(NaiveDate::from_ymd(2000, 1, 1).num_days_from_ce())); + let after = self.after.unwrap_or_else(|| { + i64::from( + NaiveDate::from_ymd_opt(2000, 1, 1) + .unwrap() + .num_days_from_ce(), + ) + }); self.after = Some(cmp::max(after, i64::from(date.num_days_from_ce()))); self } diff --git a/plume-models/src/tags.rs b/plume-models/src/tags.rs index 681de5e1..2d5cb08c 100644 --- a/plume-models/src/tags.rs +++ b/plume-models/src/tags.rs @@ -92,7 +92,7 @@ mod tests { let (posts, _users, _blogs) = fill_database(conn); let post_id = posts[0].id; let mut ht = Hashtag::new(); - ht.set_href(ap_url(&format!("https://plu.me/tag/a_tag")).parse::()?); + ht.set_href(ap_url("https://plu.me/tag/a_tag").parse::()?); ht.set_name("a_tag".to_string()); let tag = Tag::from_activity(conn, &ht, post_id, true)?; diff --git a/plume-models/src/timeline/mod.rs b/plume-models/src/timeline/mod.rs index 8aad5278..d8cc7e32 100644 --- a/plume-models/src/timeline/mod.rs +++ b/plume-models/src/timeline/mod.rs @@ -13,7 +13,7 @@ pub(crate) mod query; pub use self::query::Kind; pub use self::query::{QueryError, TimelineQuery}; -#[derive(Clone, Debug, PartialEq, Queryable, Identifiable, AsChangeset)] +#[derive(Clone, Debug, PartialEq, Eq, Queryable, Identifiable, AsChangeset)] #[table_name = "timeline_definition"] pub struct Timeline { pub id: i32, @@ -300,73 +300,63 @@ mod tests { fn test_timeline() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let users = userTests::fill_database(&conn); + let users = userTests::fill_database(conn); let mut tl1_u1 = Timeline::new_for_user( - &conn, + conn, users[0].id, "my timeline".to_owned(), "all".to_owned(), ) .unwrap(); - List::new( - &conn, - "languages I speak", - Some(&users[1]), - ListType::Prefix, - ) - .unwrap(); + List::new(conn, "languages I speak", Some(&users[1]), ListType::Prefix).unwrap(); let tl2_u1 = Timeline::new_for_user( - &conn, + conn, users[0].id, "another timeline".to_owned(), "followed".to_owned(), ) .unwrap(); let tl1_u2 = Timeline::new_for_user( - &conn, + conn, users[1].id, "english posts".to_owned(), "lang in \"languages I speak\"".to_owned(), ) .unwrap(); let tl1_instance = Timeline::new_for_instance( - &conn, + conn, "english posts".to_owned(), "license in [cc]".to_owned(), ) .unwrap(); - assert_eq!(tl1_u1, Timeline::get(&conn, tl1_u1.id).unwrap()); + assert_eq!(tl1_u1, Timeline::get(conn, tl1_u1.id).unwrap()); assert_eq!( tl2_u1, - Timeline::find_for_user_by_name(&conn, Some(users[0].id), "another timeline") + Timeline::find_for_user_by_name(conn, Some(users[0].id), "another timeline") .unwrap() ); assert_eq!( tl1_instance, - Timeline::find_for_user_by_name(&conn, None, "english posts").unwrap() + Timeline::find_for_user_by_name(conn, None, "english posts").unwrap() ); - let tl_u1 = Timeline::list_for_user(&conn, Some(users[0].id)).unwrap(); + let tl_u1 = Timeline::list_for_user(conn, Some(users[0].id)).unwrap(); assert_eq!(3, tl_u1.len()); // it is not 2 because there is a "Your feed" tl created for each user automatically - assert!(tl_u1.iter().fold(false, |res, tl| { res || *tl == tl1_u1 })); - assert!(tl_u1.iter().fold(false, |res, tl| { res || *tl == tl2_u1 })); + assert!(tl_u1.iter().any(|tl| *tl == tl1_u1)); + assert!(tl_u1.iter().any(|tl| *tl == tl2_u1)); - let tl_instance = Timeline::list_for_user(&conn, None).unwrap(); + let tl_instance = Timeline::list_for_user(conn, None).unwrap(); assert_eq!(3, tl_instance.len()); // there are also the local and federated feed by default - assert!(tl_instance - .iter() - .fold(false, |res, tl| { res || *tl == tl1_instance })); + assert!(tl_instance.iter().any(|tl| *tl == tl1_instance)); tl1_u1.name = "My Super TL".to_owned(); - let new_tl1_u2 = tl1_u2.update(&conn).unwrap(); + let new_tl1_u2 = tl1_u2.update(conn).unwrap(); - let tl_u2 = Timeline::list_for_user(&conn, Some(users[1].id)).unwrap(); + let tl_u2 = Timeline::list_for_user(conn, Some(users[1].id)).unwrap(); assert_eq!(2, tl_u2.len()); // same here - assert!(tl_u2 - .iter() - .fold(false, |res, tl| { res || *tl == new_tl1_u2 })); + assert!(tl_u2.iter().any(|tl| *tl == new_tl1_u2)); Ok(()) }); @@ -376,48 +366,48 @@ mod tests { fn test_timeline_creation_error() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let users = userTests::fill_database(&conn); + let users = userTests::fill_database(conn); assert!(Timeline::new_for_user( - &conn, + conn, users[0].id, "my timeline".to_owned(), "invalid keyword".to_owned(), ) .is_err()); assert!(Timeline::new_for_instance( - &conn, + conn, "my timeline".to_owned(), "invalid keyword".to_owned(), ) .is_err()); assert!(Timeline::new_for_user( - &conn, + conn, users[0].id, "my timeline".to_owned(), "author in non_existant_list".to_owned(), ) .is_err()); assert!(Timeline::new_for_instance( - &conn, + conn, "my timeline".to_owned(), "lang in dont-exist".to_owned(), ) .is_err()); - List::new(&conn, "friends", Some(&users[0]), ListType::User).unwrap(); - List::new(&conn, "idk", None, ListType::Blog).unwrap(); + List::new(conn, "friends", Some(&users[0]), ListType::User).unwrap(); + List::new(conn, "idk", None, ListType::Blog).unwrap(); assert!(Timeline::new_for_user( - &conn, + conn, users[0].id, "my timeline".to_owned(), "blog in friends".to_owned(), ) .is_err()); assert!(Timeline::new_for_instance( - &conn, + conn, "my timeline".to_owned(), "not author in idk".to_owned(), ) @@ -431,10 +421,10 @@ mod tests { fn test_simple_match() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (users, blogs) = blogTests::fill_database(&conn); + let (users, blogs) = blogTests::fill_database(conn); let gnu_tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "GNU timeline".to_owned(), "license in [AGPL, LGPL, GPL]".to_owned(), @@ -442,7 +432,7 @@ mod tests { .unwrap(); let gnu_post = Post::insert( - &conn, + conn, NewPost { blog_id: blogs[0].id, slug: "slug".to_string(), @@ -458,10 +448,10 @@ mod tests { }, ) .unwrap(); - assert!(gnu_tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); + assert!(gnu_tl.matches(conn, &gnu_post, Kind::Original).unwrap()); let non_free_post = Post::insert( - &conn, + conn, NewPost { blog_id: blogs[0].id, slug: "slug2".to_string(), @@ -478,7 +468,7 @@ mod tests { ) .unwrap(); assert!(!gnu_tl - .matches(&conn, &non_free_post, Kind::Original) + .matches(conn, &non_free_post, Kind::Original) .unwrap()); Ok(()) @@ -489,9 +479,9 @@ mod tests { fn test_complex_match() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (users, blogs) = blogTests::fill_database(&conn); + let (users, blogs) = blogTests::fill_database(conn); Follow::insert( - &conn, + conn, NewFollow { follower_id: users[0].id, following_id: users[1].id, @@ -501,11 +491,11 @@ mod tests { .unwrap(); let fav_blogs_list = - List::new(&conn, "fav_blogs", Some(&users[0]), ListType::Blog).unwrap(); - fav_blogs_list.add_blogs(&conn, &[blogs[0].id]).unwrap(); + List::new(conn, "fav_blogs", Some(&users[0]), ListType::Blog).unwrap(); + fav_blogs_list.add_blogs(conn, &[blogs[0].id]).unwrap(); let my_tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "My timeline".to_owned(), "blog in fav_blogs and not has_cover or local and followed exclude likes" @@ -514,7 +504,7 @@ mod tests { .unwrap(); let post = Post::insert( - &conn, + conn, NewPost { blog_id: blogs[0].id, slug: "about-linux".to_string(), @@ -530,10 +520,10 @@ mod tests { }, ) .unwrap(); - assert!(my_tl.matches(&conn, &post, Kind::Original).unwrap()); // matches because of "blog in fav_blogs" (and there is no cover) + assert!(my_tl.matches(conn, &post, Kind::Original).unwrap()); // matches because of "blog in fav_blogs" (and there is no cover) let post = Post::insert( - &conn, + conn, NewPost { blog_id: blogs[1].id, slug: "about-linux-2".to_string(), @@ -551,7 +541,7 @@ mod tests { }, ) .unwrap(); - assert!(!my_tl.matches(&conn, &post, Kind::Like(&users[1])).unwrap()); + assert!(!my_tl.matches(conn, &post, Kind::Like(&users[1])).unwrap()); Ok(()) }); @@ -561,17 +551,17 @@ mod tests { fn test_add_to_all_timelines() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (users, blogs) = blogTests::fill_database(&conn); + let (users, blogs) = blogTests::fill_database(conn); let gnu_tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "GNU timeline".to_owned(), "license in [AGPL, LGPL, GPL]".to_owned(), ) .unwrap(); let non_gnu_tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "Stallman disapproved timeline".to_owned(), "not license in [AGPL, LGPL, GPL]".to_owned(), @@ -579,7 +569,7 @@ mod tests { .unwrap(); let gnu_post = Post::insert( - &conn, + conn, NewPost { blog_id: blogs[0].id, slug: "slug".to_string(), @@ -597,7 +587,7 @@ mod tests { .unwrap(); let non_free_post = Post::insert( - &conn, + conn, NewPost { blog_id: blogs[0].id, slug: "slug2".to_string(), @@ -614,13 +604,13 @@ mod tests { ) .unwrap(); - Timeline::add_to_all_timelines(&conn, &gnu_post, Kind::Original).unwrap(); - Timeline::add_to_all_timelines(&conn, &non_free_post, Kind::Original).unwrap(); + Timeline::add_to_all_timelines(conn, &gnu_post, Kind::Original).unwrap(); + Timeline::add_to_all_timelines(conn, &non_free_post, Kind::Original).unwrap(); - let res = gnu_tl.get_latest(&conn, 2).unwrap(); + let res = gnu_tl.get_latest(conn, 2).unwrap(); assert_eq!(res.len(), 1); assert_eq!(res[0].id, gnu_post.id); - let res = non_gnu_tl.get_latest(&conn, 2).unwrap(); + let res = non_gnu_tl.get_latest(conn, 2).unwrap(); assert_eq!(res.len(), 1); assert_eq!(res[0].id, non_free_post.id); @@ -632,10 +622,10 @@ mod tests { fn test_matches_lists_direct() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (users, blogs) = blogTests::fill_database(&conn); + let (users, blogs) = blogTests::fill_database(conn); let gnu_post = Post::insert( - &conn, + conn, NewPost { blog_id: blogs[0].id, slug: "slug".to_string(), @@ -652,63 +642,63 @@ mod tests { ) .unwrap(); gnu_post - .update_tags(&conn, vec![Tag::build_activity("free".to_owned()).unwrap()]) + .update_tags(conn, vec![Tag::build_activity("free".to_owned()).unwrap()]) .unwrap(); PostAuthor::insert( - &conn, + conn, NewPostAuthor { post_id: gnu_post.id, - author_id: blogs[0].list_authors(&conn).unwrap()[0].id, + author_id: blogs[0].list_authors(conn).unwrap()[0].id, }, ) .unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "blog timeline".to_owned(), format!("blog in [{}]", blogs[0].fqn), ) .unwrap(); - assert!(tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "blog timeline".to_owned(), "blog in [no_one@nowhere]".to_owned(), ) .unwrap(); - assert!(!tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(!tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "author timeline".to_owned(), format!( "author in [{}]", - blogs[0].list_authors(&conn).unwrap()[0].fqn + blogs[0].list_authors(conn).unwrap()[0].fqn ), ) .unwrap(); - assert!(tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "author timeline".to_owned(), format!("author in [{}]", users[2].fqn), ) .unwrap(); - assert!(!tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); + assert!(!tl.matches(conn, &gnu_post, Kind::Original).unwrap()); assert!(tl - .matches(&conn, &gnu_post, Kind::Reshare(&users[2])) + .matches(conn, &gnu_post, Kind::Reshare(&users[2])) .unwrap()); - assert!(!tl.matches(&conn, &gnu_post, Kind::Like(&users[2])).unwrap()); - tl.delete(&conn).unwrap(); + assert!(!tl.matches(conn, &gnu_post, Kind::Like(&users[2])).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "author timeline".to_owned(), format!( @@ -717,50 +707,50 @@ mod tests { ), ) .unwrap(); - assert!(!tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); + assert!(!tl.matches(conn, &gnu_post, Kind::Original).unwrap()); assert!(!tl - .matches(&conn, &gnu_post, Kind::Reshare(&users[2])) + .matches(conn, &gnu_post, Kind::Reshare(&users[2])) .unwrap()); - assert!(tl.matches(&conn, &gnu_post, Kind::Like(&users[2])).unwrap()); - tl.delete(&conn).unwrap(); + assert!(tl.matches(conn, &gnu_post, Kind::Like(&users[2])).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "tag timeline".to_owned(), "tags in [free]".to_owned(), ) .unwrap(); - assert!(tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "tag timeline".to_owned(), "tags in [private]".to_owned(), ) .unwrap(); - assert!(!tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(!tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "english timeline".to_owned(), "lang in [en]".to_owned(), ) .unwrap(); - assert!(tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "franco-italian timeline".to_owned(), "lang in [fr, it]".to_owned(), ) .unwrap(); - assert!(!tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(!tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); Ok(()) }); @@ -804,10 +794,10 @@ mod tests { fn test_matches_keyword() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let (users, blogs) = blogTests::fill_database(&conn); + let (users, blogs) = blogTests::fill_database(conn); let gnu_post = Post::insert( - &conn, + conn, NewPost { blog_id: blogs[0].id, slug: "slug".to_string(), @@ -825,61 +815,61 @@ mod tests { .unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "Linux title".to_owned(), "title contains Linux".to_owned(), ) .unwrap(); - assert!(tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "Microsoft title".to_owned(), "title contains Microsoft".to_owned(), ) .unwrap(); - assert!(!tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(!tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "Linux subtitle".to_owned(), "subtitle contains Stallman".to_owned(), ) .unwrap(); - assert!(tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "Microsoft subtitle".to_owned(), "subtitle contains Nadella".to_owned(), ) .unwrap(); - assert!(!tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(!tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "Linux content".to_owned(), "content contains Linux".to_owned(), ) .unwrap(); - assert!(tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); let tl = Timeline::new_for_user( - &conn, + conn, users[0].id, "Microsoft content".to_owned(), "subtitle contains Windows".to_owned(), ) .unwrap(); - assert!(!tl.matches(&conn, &gnu_post, Kind::Original).unwrap()); - tl.delete(&conn).unwrap(); + assert!(!tl.matches(conn, &gnu_post, Kind::Original).unwrap()); + tl.delete(conn).unwrap(); Ok(()) }); diff --git a/plume-models/src/timeline/query.rs b/plume-models/src/timeline/query.rs index be2ec566..ddc52fa6 100644 --- a/plume-models/src/timeline/query.rs +++ b/plume-models/src/timeline/query.rs @@ -10,7 +10,7 @@ use crate::{ use plume_common::activity_pub::inbox::AsActor; use whatlang::{self, Lang}; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum QueryError { SyntaxError(usize, usize, String), UnexpectedEndOfQuery, @@ -19,7 +19,7 @@ pub enum QueryError { pub type QueryResult = std::result::Result; -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Kind<'a> { Original, Reshare(&'a User), diff --git a/plume-models/src/users.rs b/plume-models/src/users.rs index 76ee1182..b3dd0368 100644 --- a/plume-models/src/users.rs +++ b/plume-models/src/users.rs @@ -187,7 +187,7 @@ impl User { users::table .filter(users::instance_id.eq(Instance::get_local()?.id)) .count() - .get_result(&*conn) + .get_result(conn) .map_err(Error::from) } @@ -246,20 +246,7 @@ impl User { fn fetch(url: &str) -> Result { let res = get(url, Self::get_sender(), CONFIG.proxy().cloned())?; let text = &res.text()?; - // without this workaround, publicKey is not correctly deserialized - let ap_sign = serde_json::from_str::(text)?; - let person = serde_json::from_str::(text)?; - let json = CustomPerson::new( - ApActor::new( - person - .clone() - .id_unchecked() - .ok_or(Error::MissingApProperty)? - .to_owned(), - person, - ), - ap_sign, - ); // FIXME: Don't clone() + let json = serde_json::from_str::(text)?; Ok(json) } @@ -269,23 +256,13 @@ impl User { pub fn refetch(&self, conn: &Connection) -> Result<()> { User::fetch(&self.ap_url.clone()).and_then(|json| { - let avatar = Media::save_remote( - conn, - json.ap_actor_ref() - .icon() - .ok_or(Error::MissingApProperty)? // FIXME: Fails when icon is not set - .iter() - .next() - .and_then(|i| { - i.clone() - .extend::() // FIXME: Don't clone() - .ok()? - .and_then(|url| Some(url.id_unchecked()?.to_string())) - }) - .ok_or(Error::MissingApProperty)?, - self, - ) - .ok(); + let avatar = json + .icon() + .and_then(|icon| icon.iter().next()) + .and_then(|i| i.clone().extend::().ok()) + .and_then(|image| image) + .and_then(|image| image.id_unchecked().map(|url| url.to_string())) + .and_then(|url| Media::save_remote(conn, url, self).ok()); let pub_key = &json.ext_one.public_key.public_key_pem; diesel::update(self) @@ -435,7 +412,7 @@ impl User { } // if no user was found, and we were unable to auto-register from ldap // fake-verify a password, and return an error. - let other = User::get(&*conn, 1) + let other = User::get(conn, 1) .expect("No user is registered") .hashed_password; other.map(|pass| bcrypt::verify(password, &pass)); @@ -931,7 +908,7 @@ impl<'a, 'r> FromRequest<'a, 'r> for User { .cookies() .get_private(AUTH_COOKIE) .and_then(|cookie| cookie.value().parse().ok()) - .and_then(|id| User::get(&*conn, id).ok()) + .and_then(|id| User::get(&conn, id).ok()) .or_forward(()) } } @@ -960,6 +937,10 @@ impl FromId for User { .to_string(); if username.contains(&['<', '>', '&', '@', '\'', '"', ' ', '\t'][..]) { + tracing::error!( + "preferredUsername includes invalid character(s): {}", + &username + ); return Err(Error::InvalidValue); } @@ -1232,7 +1213,7 @@ pub(crate) mod tests { ) .unwrap(); other.avatar_id = Some(avatar.id); - let other = other.save_changes::(&*conn).unwrap(); + let other = other.save_changes::(conn).unwrap(); vec![admin, user, other] } @@ -1335,11 +1316,11 @@ pub(crate) mod tests { fn delete() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let inserted = fill_database(&conn); + let inserted = fill_database(conn); - assert!(User::get(&conn, inserted[0].id).is_ok()); - inserted[0].delete(&conn).unwrap(); - assert!(User::get(&conn, inserted[0].id).is_err()); + assert!(User::get(conn, inserted[0].id).is_ok()); + inserted[0].delete(conn).unwrap(); + assert!(User::get(conn, inserted[0].id).is_err()); Ok(()) }); } @@ -1348,20 +1329,20 @@ pub(crate) mod tests { fn admin() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - let inserted = fill_database(&conn); + let inserted = fill_database(conn); let local_inst = Instance::get_local().unwrap(); let mut i = 0; - while local_inst.has_admin(&conn).unwrap() { + while local_inst.has_admin(conn).unwrap() { assert!(i < 100); //prevent from looping indefinitelly local_inst - .main_admin(&conn) + .main_admin(conn) .unwrap() - .set_role(&conn, Role::Normal) + .set_role(conn, Role::Normal) .unwrap(); i += 1; } - inserted[0].set_role(&conn, Role::Admin).unwrap(); - assert_eq!(inserted[0].id, local_inst.main_admin(&conn).unwrap().id); + inserted[0].set_role(conn, Role::Admin).unwrap(); + assert_eq!(inserted[0].id, local_inst.main_admin(conn).unwrap().id); Ok(()) }); } @@ -1370,9 +1351,9 @@ pub(crate) mod tests { fn auth() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - fill_database(&conn); + fill_database(conn); let test_user = NewUser::new_local( - &conn, + conn, "test".to_owned(), "test user".to_owned(), Role::Normal, @@ -1383,10 +1364,10 @@ pub(crate) mod tests { .unwrap(); assert_eq!( - User::login(&conn, "test", "test_password").unwrap().id, + User::login(conn, "test", "test_password").unwrap().id, test_user.id ); - assert!(User::login(&conn, "test", "other_password").is_err()); + assert!(User::login(conn, "test", "other_password").is_err()); Ok(()) }); } @@ -1395,26 +1376,26 @@ pub(crate) mod tests { fn get_local_page() { let conn = &db(); conn.test_transaction::<_, (), _>(|| { - fill_database(&conn); + fill_database(conn); - let page = User::get_local_page(&conn, (0, 2)).unwrap(); + let page = User::get_local_page(conn, (0, 2)).unwrap(); assert_eq!(page.len(), 2); assert!(page[0].username <= page[1].username); - let mut last_username = User::get_local_page(&conn, (0, 1)).unwrap()[0] + let mut last_username = User::get_local_page(conn, (0, 1)).unwrap()[0] .username .clone(); - for i in 1..User::count_local(&conn).unwrap() as i32 { - let page = User::get_local_page(&conn, (i, i + 1)).unwrap(); + for i in 1..User::count_local(conn).unwrap() as i32 { + let page = User::get_local_page(conn, (i, i + 1)).unwrap(); assert_eq!(page.len(), 1); assert!(last_username <= page[0].username); last_username = page[0].username.clone(); } assert_eq!( - User::get_local_page(&conn, (0, User::count_local(&conn).unwrap() as i32 + 10)) + User::get_local_page(conn, (0, User::count_local(conn).unwrap() as i32 + 10)) .unwrap() .len() as i64, - User::count_local(&conn).unwrap() + User::count_local(conn).unwrap() ); Ok(()) }); diff --git a/rust-toolchain b/rust-toolchain index 63af764b..b57117c9 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2022-01-27 +nightly-2022-07-19 diff --git a/script/prebuild-in-docker.sh b/script/prebuild-in-docker.sh index 64171e5c..766930ab 100755 --- a/script/prebuild-in-docker.sh +++ b/script/prebuild-in-docker.sh @@ -3,4 +3,4 @@ set -euo pipefail version="$1" -docker run --rm -v $PWD:/repo -v $PWD/pkg:/pkg -v $PWD/script/prebuild.sh:/prebuild.sh plumeorg/plume-buildenv:v0.4.0 /prebuild.sh "$version" /repo /prebuild /pkg +docker run --rm -v $PWD:/repo -v $PWD/pkg:/pkg -v $PWD/script/prebuild.sh:/prebuild.sh plumeorg/plume-buildenv:v0.7.0 /prebuild.sh "$version" /repo /prebuild /pkg diff --git a/script/run_browser_test.sh b/script/run_browser_test.sh index 96294500..9f1ac83c 100755 --- a/script/run_browser_test.sh +++ b/script/run_browser_test.sh @@ -10,7 +10,7 @@ plm instance new -d plume-test.local -n plume-test plm users new -n admin -N 'Admin' -e 'email@exemple.com' -p 'password' plume & -caddy run -config /Caddyfile & +caddy run --config /Caddyfile & until curl http://localhost:7878/test/health -f; do sleep 1; done 2>/dev/null >/dev/null diff --git a/src/api/apps.rs b/src/api/apps.rs index 7bbc2d7a..b3fa280d 100644 --- a/src/api/apps.rs +++ b/src/api/apps.rs @@ -10,7 +10,7 @@ pub fn create(conn: DbConn, data: Json) -> Api { let client_id = random_hex(); let client_secret = random_hex(); let app = App::insert( - &*conn, + &conn, NewApp { name: data.name.clone(), client_id, diff --git a/src/routes/blogs.rs b/src/routes/blogs.rs index b8f28959..295d08a8 100644 --- a/src/routes/blogs.rs +++ b/src/routes/blogs.rs @@ -160,7 +160,7 @@ pub fn delete(name: String, conn: DbConn, rockets: PlumeRocket) -> RespondOrRedi .and_then(|u| u.is_author_in(&conn, &blog).ok()) .unwrap_or(false) { - blog.delete(&*conn).expect("blog::expect: deletion error"); + blog.delete(&conn).expect("blog::expect: deletion error"); Flash::success( Redirect::to(uri!(super::instance::index)), i18n!(rockets.intl.catalog, "Your blog was deleted."), @@ -364,7 +364,7 @@ pub fn outbox_page( #[get("/~//atom.xml")] pub fn atom_feed(name: String, conn: DbConn) -> Option> { let blog = Blog::find_by_fqn(&conn, &name).ok()?; - let entries = Post::get_recents_for_blog(&*conn, &blog, 15).ok()?; + let entries = Post::get_recents_for_blog(&conn, &blog, 15).ok()?; let uri = Instance::get_local() .ok()? .compute_box("~", &name, "atom.xml"); @@ -454,29 +454,33 @@ mod tests { long_description_html: "

Good morning

".to_string(), short_description: SafeString::new("Hello"), short_description_html: "

Hello

".to_string(), - name: random_hex().to_string(), + name: random_hex(), open_registrations: true, - public_domain: random_hex().to_string(), + public_domain: random_hex(), }, ) .unwrap(); Instance::cache_local(conn); instance }); - let mut user = NewUser::default(); - user.instance_id = instance.id; - user.username = random_hex().to_string(); - user.ap_url = random_hex().to_string(); - user.inbox_url = random_hex().to_string(); - user.outbox_url = random_hex().to_string(); - user.followers_endpoint = random_hex().to_string(); + let user = NewUser { + instance_id: instance.id, + username: random_hex(), + ap_url: random_hex(), + inbox_url: random_hex(), + outbox_url: random_hex(), + followers_endpoint: random_hex(), + ..Default::default() + }; let user = User::insert(conn, user).unwrap(); - let mut blog = NewBlog::default(); - blog.instance_id = instance.id; - blog.actor_id = random_hex().to_string(); - blog.ap_url = random_hex().to_string(); - blog.inbox_url = random_hex().to_string(); - blog.outbox_url = random_hex().to_string(); + let blog = NewBlog { + instance_id: instance.id, + actor_id: random_hex(), + ap_url: random_hex(), + inbox_url: random_hex(), + outbox_url: random_hex(), + ..Default::default() + }; let blog = Blog::insert(conn, blog).unwrap(); BlogAuthor::insert( conn, diff --git a/src/routes/comments.rs b/src/routes/comments.rs index 5f60aae3..c60382be 100644 --- a/src/routes/comments.rs +++ b/src/routes/comments.rs @@ -125,7 +125,7 @@ pub fn create( user.has_reshared(&conn, &post) .expect("comments::create: reshared error"), user.is_following( - &*conn, + &conn, post.get_authors(&conn) .expect("comments::create: authors error")[0] .id diff --git a/src/routes/email_signups.rs b/src/routes/email_signups.rs index 7a364dd0..c36b7a91 100644 --- a/src/routes/email_signups.rs +++ b/src/routes/email_signups.rs @@ -3,6 +3,7 @@ use crate::{ routes::{errors::ErrorPage, RespondOrRedirect}, template_utils::{IntoContext, Ructe}, }; + use plume_models::{ db_conn::DbConn, email_signups::EmailSignup, instance::Instance, lettre::Transport, signups, Error, PlumeRocket, CONFIG, @@ -13,7 +14,11 @@ use rocket::{ response::{Flash, Redirect}, State, }; -use std::sync::{Arc, Mutex}; +use std::{ + borrow::Cow, + collections::HashMap, + sync::{Arc, Mutex}, +}; use tracing::warn; use validator::{Validate, ValidationError, ValidationErrors}; @@ -105,6 +110,26 @@ pub fn create( render!(email_signups::create(&(&conn, &rockets).to_context())).into() } Error::NotFound => render!(errors::not_found(&(&conn, &rockets).to_context())).into(), + Error::Blocklisted(show, msg) => { + let mut errors = ValidationErrors::new(); + if *show { + errors.add( + "email", + ValidationError { + code: Cow::from("blocklisted"), + message: Some(Cow::from(msg.clone())), + params: HashMap::new(), + }, + ); + } + render!(email_signups::new( + &(&conn, &rockets).to_context(), + registration_open, + &form, + errors + )) + .into() + } _ => render!(errors::not_found(&(&conn, &rockets).to_context())).into(), // FIXME }); } @@ -153,6 +178,28 @@ pub fn show( ))) } // TODO: Flash and redirect Error::NotFound => return Err(Error::NotFound.into()), + Error::Blocklisted(show, msg) => { + let mut errors = ValidationErrors::new(); + if show { + errors.add( + "email", + ValidationError { + code: Cow::from("blocklisted"), + message: Some(Cow::from(msg)), + params: HashMap::new(), + }, + ); + } + return Ok(render!(email_signups::new( + &(&conn, &rockets).to_context(), + Instance::get_local()?.open_registrations, + &EmailSignupForm { + email: signup.email.clone(), + email_confirmation: signup.email + }, + errors + ))); + } _ => return Err(Error::NotFound.into()), // FIXME } } @@ -207,12 +254,38 @@ pub fn signup( err )))); } - let _user = signup - .complete(&conn, form.username.clone(), form.password.clone()) - .map_err(|e| { + let user = signup.complete(&conn, form.username.clone(), form.password.clone()); + match user { + Err(Error::Blocklisted(show, msg)) => { + let instance = Instance::get_local().map_err(|_| Status::UnprocessableEntity)?; + let mut errors = ValidationErrors::new(); + if show { + errors.add( + "email", + ValidationError { + code: Cow::from("blocklisted"), + message: Some(Cow::from(msg)), + params: HashMap::new(), + }, + ); + } + return Ok(render!(email_signups::new( + &(&conn, &rockets).to_context(), + instance.open_registrations, + &EmailSignupForm { + email: signup.email.clone(), + email_confirmation: signup.email + }, + errors + )) + .into()); + } + Err(e) => { warn!("{:?}", e); - Status::UnprocessableEntity - })?; + return Err(Status::UnprocessableEntity); + } + _ => {} + } Ok(FlashRedirect(Flash::success( Redirect::to(uri!(super::session::new: m = _)), i18n!( diff --git a/src/routes/instance.rs b/src/routes/instance.rs index 526bde31..b4ac399b 100644 --- a/src/routes/instance.rs +++ b/src/routes/instance.rs @@ -105,7 +105,7 @@ pub fn update_settings( Instance::get_local().expect("instance::update_settings: local instance error"); instance .update( - &*conn, + &conn, form.name.clone(), form.open_registrations, form.short_description.clone(), @@ -366,8 +366,8 @@ pub fn edit_users( } fn ban(id: i32, conn: &Connection, worker: &ScheduledThreadPool) -> Result<(), ErrorPage> { - let u = User::get(&*conn, id)?; - u.delete(&*conn)?; + let u = User::get(conn, id)?; + u.delete(conn)?; if Instance::get_local() .map(|i| u.instance_id == i.id) .unwrap_or(false) @@ -382,8 +382,8 @@ fn ban(id: i32, conn: &Connection, worker: &ScheduledThreadPool) -> Result<(), E }, ) .unwrap(); - let target = User::one_by_instance(&*conn)?; - let delete_act = u.delete_activity(&*conn)?; + let target = User::one_by_instance(conn)?; + let delete_act = u.delete_activity(conn)?; worker.execute(move || broadcast(&u, delete_act, target, CONFIG.proxy().cloned())); } diff --git a/src/routes/likes.rs b/src/routes/likes.rs index 25ca68bf..687b23a8 100644 --- a/src/routes/likes.rs +++ b/src/routes/likes.rs @@ -20,14 +20,14 @@ pub fn create( let b = Blog::find_by_fqn(&conn, &blog)?; let post = Post::find_by_slug(&conn, &slug, b.id)?; - if !user.has_liked(&*conn, &post)? { - let like = likes::Like::insert(&*conn, likes::NewLike::new(&post, &user))?; - like.notify(&*conn)?; + if !user.has_liked(&conn, &post)? { + let like = likes::Like::insert(&conn, likes::NewLike::new(&post, &user))?; + like.notify(&conn)?; Timeline::add_to_all_timelines(&conn, &post, Kind::Like(&user))?; - let dest = User::one_by_instance(&*conn)?; - let act = like.to_activity(&*conn)?; + let dest = User::one_by_instance(&conn)?; + let act = like.to_activity(&conn)?; rockets .worker .execute(move || broadcast(&user, act, dest, CONFIG.proxy().cloned())); diff --git a/src/routes/medias.rs b/src/routes/medias.rs index 8f920036..1981c542 100644 --- a/src/routes/medias.rs +++ b/src/routes/medias.rs @@ -145,9 +145,9 @@ pub fn details( #[post("/medias//delete")] pub fn delete(id: i32, user: User, conn: DbConn, intl: I18n) -> Result, ErrorPage> { - let media = Media::get(&*conn, id)?; + let media = Media::get(&conn, id)?; if media.owner_id == user.id { - media.delete(&*conn)?; + media.delete(&conn)?; Ok(Flash::success( Redirect::to(uri!(list: page = _)), i18n!(intl.catalog, "Your media have been deleted."), @@ -167,9 +167,9 @@ pub fn set_avatar( conn: DbConn, intl: I18n, ) -> Result, ErrorPage> { - let media = Media::get(&*conn, id)?; + let media = Media::get(&conn, id)?; if media.owner_id == user.id { - user.set_avatar(&*conn, media.id)?; + user.set_avatar(&conn, media.id)?; Ok(Flash::success( Redirect::to(uri!(details: id = id)), i18n!(intl.catalog, "Your avatar has been updated."), diff --git a/src/routes/mod.rs b/src/routes/mod.rs index 5ea53c96..58d71aa6 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -165,7 +165,7 @@ fn post_to_atom(post: Post, conn: &Connection) -> Entry { .build(), ) .authors( - post.get_authors(&*conn) + post.get_authors(conn) .expect("Atom feed: author error") .into_iter() .map(|a| { diff --git a/src/routes/search.rs b/src/routes/search.rs index 33d8443f..0807b792 100644 --- a/src/routes/search.rs +++ b/src/routes/search.rs @@ -65,7 +65,7 @@ pub fn search(query: Option>, conn: DbConn, rockets: PlumeRock if str_query.is_empty() { render!(search::index( &(&conn, &rockets).to_context(), - &format!("{}", Utc::today().format("%Y-%m-d")) + &format!("{}", Utc::now().date_naive().format("%Y-%m-d")) )) } else { let res = rockets diff --git a/src/routes/user.rs b/src/routes/user.rs index e1b1cfdd..c71be6e2 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -48,10 +48,10 @@ pub fn me(user: Option) -> RespondOrRedirect { #[get("/@/", rank = 2)] pub fn details(name: String, rockets: PlumeRocket, conn: DbConn) -> Result { let user = User::find_by_fqn(&conn, &name)?; - let recents = Post::get_recents_for_author(&*conn, &user, 6)?; - let reshares = Reshare::get_recents_for_author(&*conn, &user, 6)?; + let recents = Post::get_recents_for_author(&conn, &user, 6)?; + let reshares = Reshare::get_recents_for_author(&conn, &user, 6)?; - if !user.get_instance(&*conn)?.local { + if !user.get_instance(&conn)?.local { tracing::trace!("remote user found"); user.remote_user_found(); // Doesn't block } @@ -62,14 +62,14 @@ pub fn details(name: String, rockets: PlumeRocket, conn: DbConn) -> Result for WebfingerResolver { fn find(prefix: Prefix, acct: String, conn: DbConn) -> Result { match prefix { Prefix::Acct => User::find_by_fqn(&conn, &acct) - .and_then(|usr| usr.webfinger(&*conn)) + .and_then(|usr| usr.webfinger(&conn)) .or(Err(ResolverError::NotFound)), Prefix::Group => Blog::find_by_fqn(&conn, &acct) - .and_then(|blog| blog.webfinger(&*conn)) + .and_then(|blog| blog.webfinger(&conn)) .or(Err(ResolverError::NotFound)), Prefix::Custom(_) => Err(ResolverError::NotFound), } diff --git a/src/template_utils.rs b/src/template_utils.rs index 1dfcc56d..9d4095b0 100644 --- a/src/template_utils.rs +++ b/src/template_utils.rs @@ -85,7 +85,7 @@ impl<'r> Responder<'r> for Ructe { macro_rules! render { ($group:tt :: $page:tt ( $( $param:expr ),* ) ) => { { - use crate::templates; + use $crate::templates; let mut res = vec![]; templates::$group::$page(