diff --git a/.woodpecker.yml b/.woodpecker.yml index 50403711e..078561be6 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -157,7 +157,7 @@ steps: CARGO_HOME: .cargo_home commands: - rustup component add clippy - - cargo clippy --workspace --tests --all-targets --features console -- -D warnings + - cargo clippy --workspace --tests --all-targets -- -D warnings when: *slow_check_paths cargo_build: @@ -240,10 +240,13 @@ steps: publish_release_docker: image: woodpeckerci/plugin-docker-buildx - secrets: [docker_username, docker_password] settings: repo: dessalines/lemmy dockerfile: docker/Dockerfile + username: + from_secret: docker_username + password: + from_secret: docker_password platforms: linux/amd64, linux/arm64 build_args: - RUST_RELEASE_MODE=release @@ -253,10 +256,13 @@ steps: nightly_build: image: woodpeckerci/plugin-docker-buildx - secrets: [docker_username, docker_password] settings: repo: dessalines/lemmy dockerfile: docker/Dockerfile + username: + from_secret: docker_username + password: + from_secret: docker_password platforms: linux/amd64,linux/arm64 build_args: - RUST_RELEASE_MODE=release diff --git a/Cargo.lock b/Cargo.lock index f40a9efc1..0c413e887 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,9 +16,9 @@ checksum = "8f27d075294830fcab6f66e320dab524bc6d048f4a151698e153205559113772" [[package]] name = "activitypub_federation" -version = "0.5.8" +version = "0.6.0-alpha2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b86eea7a032da501fe07b04a83c10716ea732c45e6943d7f045bc053aca03f2a" +checksum = "4877d467ddf2fac85e9ee33aba6f2560df14125b8bfa864f85ab40e9b87753a9" dependencies = [ "activitystreams-kinds", "actix-web", @@ -32,6 +32,7 @@ dependencies = [ "futures", "futures-core", "http 0.2.12", + "http 1.1.0", "http-signature-normalization", "http-signature-normalization-reqwest", "httpdate", @@ -41,8 +42,8 @@ dependencies = [ "pin-project-lite", "rand", "regex", - "reqwest 0.11.27", - "reqwest-middleware 0.2.5", + "reqwest 0.12.7", + "reqwest-middleware", "rsa", "serde", "serde_json", @@ -158,7 +159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -316,7 +317,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -364,6 +365,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" version = "0.8.11" @@ -473,9 +480,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" dependencies = [ "backtrace", ] @@ -539,31 +546,31 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] name = "atom_syndication" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f34613907f31c9dbef0240156db3c9263f34842b6e1a8999d2304ea62c8a30" +checksum = "2a3a5ed3201df5658d1aa45060c5a57dc9dba8a8ada20d696d67cb0c479ee043" dependencies = [ "chrono", "derive_builder", "diligent-date-parser", "never", - "quick-xml 0.31.0", + "quick-xml 0.36.1", ] [[package]] @@ -580,9 +587,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-lc-rs" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae74d9bd0a7530e8afd1770739ad34b36838829d6ad61818f9230f683f5ad77" +checksum = "2f95446d919226d587817a7d21379e6eb099b97b45110a7f272a444ca5c54070" dependencies = [ "aws-lc-sys", "mirai-annotations", @@ -593,9 +600,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.20.1" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0e249228c6ad2d240c2dc94b714d711629d52bad946075d8e9b2f5391f0703" +checksum = "234314bd569802ec87011d653d6815c6d7b9ffb969e9fee5b8b20ef860e8dce9" dependencies = [ "bindgen", "cc", @@ -613,7 +620,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core 0.3.4", + "axum-core", "bitflags 1.3.2", "bytes", "futures-util", @@ -634,33 +641,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "axum" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" -dependencies = [ - "async-trait", - "axum-core 0.4.3", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "http-body-util", - "itoa", - "matchit 0.7.3", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper 1.0.1", - "tower", - "tower-layer", - "tower-service", -] - [[package]] name = "axum-core" version = "0.3.4" @@ -678,26 +658,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "axum-core" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper 0.1.2", - "tower-layer", - "tower-service", -] - [[package]] name = "backtrace" version = "0.3.71" @@ -708,7 +668,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.4", "object", "rustc-demangle", ] @@ -812,7 +772,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.74", + "syn 2.0.77", "which", ] @@ -900,9 +860,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.16.3" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder" @@ -941,12 +901,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.10" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e8aabfac534be767c909e0690571677d49f41bd8465ae876fe043d52ba5292" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -1018,9 +979,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.15" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -1028,9 +989,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", @@ -1047,7 +1008,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1067,9 +1028,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" dependencies = [ "cc", ] @@ -1155,38 +1116,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd326812b3fd01da5bb1af7d340d0d555fd3d4b641e7f1dfcf5962a902952787" dependencies = [ "futures-core", - "prost 0.12.6", - "prost-types 0.12.6", + "prost", + "prost-types", "tonic 0.10.2", "tracing-core", ] -[[package]] -name = "console-api" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ed14aa9c9f927213c6e4f3ef75faaad3406134efe84ba2cb7983431d5f0931" -dependencies = [ - "futures-core", - "prost 0.13.1", - "prost-types 0.13.1", - "tonic 0.12.1", - "tracing-core", -] - [[package]] name = "console-subscriber" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7481d4c57092cd1c19dd541b92bdce883de840df30aa5d03fd48a3935c01842e" dependencies = [ - "console-api 0.6.0", + "console-api", "crossbeam-channel", "crossbeam-utils", "futures-task", "hdrhistogram", "humantime", - "prost-types 0.12.6", + "prost-types", "serde", "serde_json", "thread_local", @@ -1198,32 +1146,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "console-subscriber" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e3a111a37f3333946ebf9da370ba5c5577b18eb342ec683eb488dd21980302" -dependencies = [ - "console-api 0.8.0", - "crossbeam-channel", - "crossbeam-utils", - "futures-task", - "hdrhistogram", - "humantime", - "hyper-util", - "prost 0.13.1", - "prost-types 0.13.1", - "serde", - "serde_json", - "thread_local", - "tokio", - "tokio-stream", - "tonic 0.12.1", - "tracing", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "const-oid" version = "0.9.6" @@ -1232,18 +1154,18 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const_format" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1" dependencies = [ "proc-macro2", "quote", @@ -1291,9 +1213,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1386,7 +1308,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1408,7 +1330,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1478,7 +1400,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1504,44 +1426,44 @@ dependencies = [ [[package]] name = "derive-new" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad" +checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] name = "derive_builder" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" +checksum = "cd33f37ee6a119146a1781d3356a7c26028f83d779b2e04ecd45fdc75c76877b" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" +checksum = "7431fa049613920234f22c47fdc33e6cf3ee83067091ea4277a3f8c4587aae38" dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] name = "derive_builder_macro" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" +checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc" dependencies = [ "derive_builder_core", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1554,7 +1476,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1608,7 +1530,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1619,7 +1541,7 @@ checksum = "d5adf688c584fe33726ce0e2898f608a2a92578ac94a4a92fcecf73214fe0716" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1631,7 +1553,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1661,7 +1583,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1691,6 +1613,17 @@ dependencies = [ "chrono", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "doku" version = "0.21.1" @@ -1802,7 +1735,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -1882,15 +1815,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" -[[package]] -name = "fallible_collections" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88c69768c0a15262df21899142bc6df9b9b823546d4b4b9a7bc2d6c448ec6fd" -dependencies = [ - "hashbrown 0.13.2", -] - [[package]] name = "fancy-regex" version = "0.11.0" @@ -1903,9 +1827,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fdeflate" @@ -1924,12 +1848,12 @@ checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" [[package]] name = "flate2" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -2035,7 +1959,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -2124,7 +2048,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.3.0", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2133,9 +2057,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", "bytes", @@ -2143,7 +2067,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.3.0", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2156,15 +2080,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.14.5" @@ -2297,7 +2212,7 @@ dependencies = [ "markup5ever 0.12.1", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -2367,16 +2282,16 @@ dependencies = [ [[package]] name = "http-signature-normalization-reqwest" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cfb84663420ec12c4422820bfdf5e8e5e57467892587f43ac432e73ebce880" +checksum = "b8822f7eab343cae1ce3bd3b6d0b9b58c72adaf3463627cfe150f8f5406f27aa" dependencies = [ "async-trait", - "base64 0.13.1", + "base64 0.22.1", "http-signature-normalization", "httpdate", - "reqwest 0.11.27", - "reqwest-middleware 0.2.5", + "reqwest 0.12.7", + "reqwest-middleware", "sha2", "thiserror", "tokio", @@ -2433,7 +2348,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "httparse", @@ -2461,20 +2376,20 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", "hyper 1.4.1", "hyper-util", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", ] [[package]] @@ -2489,24 +2404,11 @@ dependencies = [ "tokio-io-timeout", ] -[[package]] -name = "hyper-timeout" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" -dependencies = [ - "hyper 1.4.1", - "hyper-util", - "pin-project-lite", - "tokio", - "tower-service", -] - [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", @@ -2539,7 +2441,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8215279f83f9b829403812f845aa2d0dd5966332aa2fd0334a375256f3dd0322" dependencies = [ "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -2565,6 +2467,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2591,6 +2611,18 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd69211b9b519e98303c015e21a007e293db403b6c85b9b124e133d25e242cdd" +dependencies = [ + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", +] + [[package]] name = "image" version = "0.24.9" @@ -2629,9 +2661,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -2658,9 +2690,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is_terminal_polyfill" @@ -2668,15 +2700,6 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -2777,7 +2800,7 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "lemmy_api" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "activitypub_federation", "actix-web", @@ -2790,6 +2813,7 @@ dependencies = [ "elementtree", "hound", "lemmy_api_common", + "lemmy_api_crud", "lemmy_db_schema", "lemmy_db_views", "lemmy_db_views_actor", @@ -2806,7 +2830,7 @@ dependencies = [ [[package]] name = "lemmy_api_common" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "activitypub_federation", "actix-web", @@ -2826,8 +2850,8 @@ dependencies = [ "moka", "pretty_assertions", "regex", - "reqwest 0.11.27", - "reqwest-middleware 0.2.5", + "reqwest 0.12.7", + "reqwest-middleware", "rosetta-i18n", "serde", "serde_with", @@ -2843,7 +2867,7 @@ dependencies = [ [[package]] name = "lemmy_api_crud" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "accept-language", "activitypub_federation", @@ -2865,7 +2889,7 @@ dependencies = [ [[package]] name = "lemmy_apub" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "activitypub_federation", "actix-web", @@ -2878,7 +2902,7 @@ dependencies = [ "futures", "html2md", "html2text", - "http 0.2.12", + "http 1.1.0", "itertools 0.13.0", "lemmy_api_common", "lemmy_db_schema", @@ -2887,7 +2911,7 @@ dependencies = [ "lemmy_utils", "moka", "pretty_assertions", - "reqwest 0.11.27", + "reqwest 0.12.7", "serde", "serde_json", "serde_with", @@ -2902,7 +2926,7 @@ dependencies = [ [[package]] name = "lemmy_db_perf" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "anyhow", "clap", @@ -2917,7 +2941,7 @@ dependencies = [ [[package]] name = "lemmy_db_schema" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "activitypub_federation", "anyhow", @@ -2938,7 +2962,7 @@ dependencies = [ "moka", "pretty_assertions", "regex", - "rustls 0.23.12", + "rustls 0.23.13", "serde", "serde_json", "serde_with", @@ -2956,7 +2980,7 @@ dependencies = [ [[package]] name = "lemmy_db_views" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "actix-web", "chrono", @@ -2978,7 +3002,7 @@ dependencies = [ [[package]] name = "lemmy_db_views_actor" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "chrono", "diesel", @@ -2998,7 +3022,7 @@ dependencies = [ [[package]] name = "lemmy_db_views_moderator" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "diesel", "diesel-async", @@ -3010,7 +3034,7 @@ dependencies = [ [[package]] name = "lemmy_federate" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "activitypub_federation", "actix-web", @@ -3027,7 +3051,7 @@ dependencies = [ "lemmy_utils", "mockall", "moka", - "reqwest 0.11.27", + "reqwest 0.12.7", "serde_json", "serial_test", "test-context", @@ -3041,31 +3065,31 @@ dependencies = [ [[package]] name = "lemmy_routes" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "activitypub_federation", "actix-web", "anyhow", "chrono", "futures", + "http 1.1.0", "lemmy_api_common", "lemmy_db_schema", "lemmy_db_views", "lemmy_db_views_actor", "lemmy_utils", - "reqwest 0.11.27", - "reqwest-middleware 0.2.5", + "reqwest 0.12.7", + "reqwest-middleware", "rss", "serde", "tokio", "tracing", "url", - "urlencoding", ] [[package]] name = "lemmy_server" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "activitypub_federation", "actix-cors", @@ -3074,7 +3098,6 @@ dependencies = [ "chrono", "clap", "clokwerk", - "console-subscriber 0.4.0", "diesel", "diesel-async", "futures-util", @@ -3086,30 +3109,25 @@ dependencies = [ "lemmy_federate", "lemmy_routes", "lemmy_utils", - "opentelemetry 0.19.0", - "opentelemetry-otlp 0.12.0", "pict-rs", "pretty_assertions", "prometheus", - "reqwest 0.11.27", - "reqwest-middleware 0.2.5", - "reqwest-tracing 0.4.8", - "rustls 0.23.12", + "reqwest 0.12.7", + "reqwest-middleware", + "reqwest-tracing", + "rustls 0.23.13", "serde_json", "serial_test", "tokio", "tracing", "tracing-actix-web", - "tracing-error", - "tracing-log 0.2.0", - "tracing-opentelemetry 0.19.0", "tracing-subscriber", "url", ] [[package]] name = "lemmy_utils" -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" dependencies = [ "actix-web", "anyhow", @@ -3120,14 +3138,14 @@ dependencies = [ "enum-map", "futures", "html2text", - "http 0.2.12", + "http 1.1.0", "itertools 0.13.0", "lettre", "markdown-it", "pretty_assertions", "regex", - "reqwest 0.11.27", - "reqwest-middleware 0.2.5", + "reqwest 0.12.7", + "reqwest-middleware", "rosetta-build", "rosetta-i18n", "serde", @@ -3136,7 +3154,6 @@ dependencies = [ "strum", "tokio", "tracing", - "tracing-error", "ts-rs", "url", "urlencoding", @@ -3145,9 +3162,9 @@ dependencies = [ [[package]] name = "lettre" -version = "0.11.7" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a62049a808f1c4e2356a2a380bd5f2aca3b011b0b482cf3b914ba1731426969" +checksum = "69f204773bab09b150320ea1c83db41dc6ee606a4bc36dc1f43005fe7b58ce06" dependencies = [ "async-trait", "base64 0.22.1", @@ -3158,25 +3175,26 @@ dependencies = [ "futures-io", "futures-util", "httpdate", - "idna 0.5.0", + "idna 1.0.2", "mime", "nom", "percent-encoding", "quoted_printable", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pemfile 2.1.3", + "rustls-pki-types", "socket2", "tokio", "tokio-rustls 0.26.0", "url", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", ] [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libloading" @@ -3215,6 +3233,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "local-channel" version = "0.1.5" @@ -3244,12 +3268,11 @@ dependencies = [ [[package]] name = "lodepng" -version = "3.10.4" +version = "3.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f161e6ea2dab22de2c1ccff915686a8014d6e136b35fa9613d18214c1f7ec4f" +checksum = "7b2dea7cda68e381418c985fd8f32a9c279a21ae8c715f2376adb20c27a0fad3" dependencies = [ "crc32fast", - "fallible_collections", "flate2", "libc", "rgb", @@ -3410,7 +3433,7 @@ dependencies = [ "http-body-util", "hyper 1.4.1", "hyper-util", - "indexmap 2.3.0", + "indexmap 2.5.0", "ipnet", "metrics", "metrics-util", @@ -3462,16 +3485,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -3488,6 +3501,15 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" version = "1.0.2" @@ -3530,7 +3552,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -3685,36 +3707,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opentelemetry" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf9b1c4e9a6c4de793c632496fa490bdc0e1eea73f0c91394f7b6990935d22" -dependencies = [ - "async-trait", - "crossbeam-channel", - "futures", - "js-sys", - "lazy_static", - "percent-encoding", - "pin-project", - "rand", - "thiserror", -] - -[[package]] -name = "opentelemetry" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4b8347cc26099d3aeee044065ecc3ae11469796b4d65d065a23a584ed92a6f" -dependencies = [ - "opentelemetry_api", - "opentelemetry_sdk 0.19.0", -] +checksum = "33ea5043e58958ee56f3e15a90aee535795cd7dfd319846288d93c5b57d85cbe" [[package]] name = "opentelemetry" @@ -3730,24 +3725,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "opentelemetry-otlp" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8af72d59a4484654ea8eb183fea5ae4eb6a41d7ac3e3bae5f4d2a282a3a7d3ca" -dependencies = [ - "async-trait", - "futures", - "futures-util", - "http 0.2.12", - "opentelemetry 0.19.0", - "opentelemetry-proto 0.2.0", - "prost 0.11.9", - "thiserror", - "tokio", - "tonic 0.8.3", -] - [[package]] name = "opentelemetry-otlp" version = "0.16.0" @@ -3757,78 +3734,27 @@ dependencies = [ "async-trait", "futures-core", "http 0.2.12", - "opentelemetry 0.23.0", - "opentelemetry-proto 0.6.0", - "opentelemetry_sdk 0.23.0", - "prost 0.12.6", + "opentelemetry", + "opentelemetry-proto", + "opentelemetry_sdk", + "prost", "thiserror", "tokio", "tonic 0.11.0", ] -[[package]] -name = "opentelemetry-proto" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045f8eea8c0fa19f7d48e7bc3128a39c2e5c533d5c61298c548dfefc1064474c" -dependencies = [ - "futures", - "futures-util", - "opentelemetry 0.19.0", - "prost 0.11.9", - "tonic 0.8.3", -] - [[package]] name = "opentelemetry-proto" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "984806e6cf27f2b49282e2a05e288f30594f3dbc74eb7a6e99422bc48ed78162" dependencies = [ - "opentelemetry 0.23.0", - "opentelemetry_sdk 0.23.0", - "prost 0.12.6", + "opentelemetry", + "opentelemetry_sdk", + "prost", "tonic 0.11.0", ] -[[package]] -name = "opentelemetry_api" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed41783a5bf567688eb38372f2b7a8530f5a607a4b49d38dd7573236c23ca7e2" -dependencies = [ - "fnv", - "futures-channel", - "futures-util", - "indexmap 1.9.3", - "once_cell", - "pin-project-lite", - "thiserror", - "urlencoding", -] - -[[package]] -name = "opentelemetry_sdk" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b3a2a91fdbfdd4d212c0dcc2ab540de2c2bcbbd90be17de7a7daf8822d010c1" -dependencies = [ - "async-trait", - "crossbeam-channel", - "dashmap", - "fnv", - "futures-channel", - "futures-executor", - "futures-util", - "once_cell", - "opentelemetry_api", - "percent-encoding", - "rand", - "thiserror", - "tokio", - "tokio-stream", -] - [[package]] name = "opentelemetry_sdk" version = "0.23.0" @@ -3842,7 +3768,7 @@ dependencies = [ "glob", "lazy_static", "once_cell", - "opentelemetry 0.23.0", + "opentelemetry", "ordered-float", "percent-encoding", "rand", @@ -3874,9 +3800,9 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -3921,7 +3847,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.4", "smallvec", "windows-targets 0.52.6", ] @@ -4055,7 +3981,7 @@ dependencies = [ "clap", "color-eyre", "config", - "console-subscriber 0.2.0", + "console-subscriber", "dashmap", "diesel", "diesel-async", @@ -4066,15 +3992,15 @@ dependencies = [ "metrics", "metrics-exporter-prometheus", "mime", - "opentelemetry 0.23.0", - "opentelemetry-otlp 0.16.0", - "opentelemetry_sdk 0.23.0", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry_sdk", "pin-project-lite", "refinery", - "reqwest 0.12.5", - "reqwest-middleware 0.3.3", - "reqwest-tracing 0.5.3", - "rustls 0.23.12", + "reqwest 0.12.7", + "reqwest-middleware", + "reqwest-tracing", + "rustls 0.23.13", "rustls-channel-resolver", "rustls-pemfile 2.1.3", "rusty-s3", @@ -4096,12 +4022,12 @@ dependencies = [ "tracing", "tracing-actix-web", "tracing-error", - "tracing-log 0.2.0", - "tracing-opentelemetry 0.24.0", + "tracing-log", + "tracing-opentelemetry", "tracing-subscriber", "url", "uuid", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", ] [[package]] @@ -4121,7 +4047,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -4170,7 +4096,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ "base64 0.22.1", - "indexmap 2.3.0", + "indexmap 2.5.0", "quick-xml 0.32.0", "serde", "time", @@ -4186,7 +4112,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.7.4", ] [[package]] @@ -4310,12 +4236,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -4367,16 +4293,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive 0.11.9", -] - [[package]] name = "prost" version = "0.12.6" @@ -4384,30 +4300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" -dependencies = [ - "bytes", - "prost-derive 0.13.1", -] - -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", + "prost-derive", ] [[package]] @@ -4420,20 +4313,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.74", -] - -[[package]] -name = "prost-derive" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" -dependencies = [ - "anyhow", - "itertools 0.13.0", - "proc-macro2", - "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -4442,16 +4322,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.12.6", -] - -[[package]] -name = "prost-types" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" -dependencies = [ - "prost 0.13.1", + "prost", ] [[package]] @@ -4462,9 +4333,9 @@ checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "psm" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" dependencies = [ "cc", ] @@ -4494,16 +4365,6 @@ dependencies = [ "serde", ] -[[package]] -name = "quick-xml" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" -dependencies = [ - "encoding_rs", - "memchr", -] - [[package]] name = "quick-xml" version = "0.32.0" @@ -4514,17 +4375,27 @@ dependencies = [ ] [[package]] -name = "quinn" -version = "0.11.3" +name = "quick-xml" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" +checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc" +dependencies = [ + "encoding_rs", + "memchr", +] + +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.12", + "rustls 0.23.13", "socket2", "thiserror", "tokio", @@ -4533,15 +4404,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand", "ring", "rustc-hash 2.0.0", - "rustls 0.23.12", + "rustls 0.23.13", "slab", "thiserror", "tinyvec", @@ -4550,22 +4421,22 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -4623,7 +4494,7 @@ checksum = "a25d631e41bfb5fdcde1d4e2215f62f7f0afa3ff11e26563765bd6ea1d229aeb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -4637,18 +4508,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] @@ -4696,7 +4558,7 @@ dependencies = [ "quote", "refinery-core", "regex", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -4755,7 +4617,6 @@ version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "async-compression", "base64 0.21.7", "bytes", "encoding_rs", @@ -4770,7 +4631,6 @@ dependencies = [ "js-sys", "log", "mime", - "mime_guess", "once_cell", "percent-encoding", "pin-project-lite", @@ -4783,32 +4643,32 @@ dependencies = [ "system-configuration", "tokio", "tokio-rustls 0.24.1", - "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", "web-sys", "webpki-roots 0.25.4", - "winreg 0.50.0", + "winreg", ] [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ + "async-compression", "base64 0.22.1", "bytes", + "futures-channel", "futures-core", "futures-util", "http 1.1.0", "http-body 1.0.1", "http-body-util", "hyper 1.4.1", - "hyper-rustls 0.27.2", + "hyper-rustls 0.27.3", "hyper-util", "ipnet", "js-sys", @@ -4818,7 +4678,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pemfile 2.1.3", "rustls-pki-types", "serde", @@ -4834,23 +4694,8 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.3", - "winreg 0.52.0", -] - -[[package]] -name = "reqwest-middleware" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a735987236a8e238bf0296c7e351b999c188ccc11477f311b82b55c93984216" -dependencies = [ - "anyhow", - "async-trait", - "http 0.2.12", - "reqwest 0.11.27", - "serde", - "task-local-extensions", - "thiserror", + "webpki-roots 0.26.5", + "windows-registry", ] [[package]] @@ -4862,30 +4707,12 @@ dependencies = [ "anyhow", "async-trait", "http 1.1.0", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde", "thiserror", "tower-service", ] -[[package]] -name = "reqwest-tracing" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190838e54153d7a7e2ea98851304b3ce92daeabf14c54d32b01b84a3e636f683" -dependencies = [ - "anyhow", - "async-trait", - "getrandom", - "matchit 0.7.3", - "opentelemetry 0.16.0", - "reqwest 0.11.27", - "reqwest-middleware 0.2.5", - "task-local-extensions", - "tracing", - "tracing-opentelemetry 0.16.0", -] - [[package]] name = "reqwest-tracing" version = "0.5.3" @@ -4897,8 +4724,8 @@ dependencies = [ "getrandom", "http 1.1.0", "matchit 0.8.4", - "reqwest 0.12.5", - "reqwest-middleware 0.3.3", + "reqwest 0.12.7", + "reqwest-middleware", "tracing", ] @@ -4910,9 +4737,9 @@ checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" [[package]] name = "rgb" -version = "0.8.48" +version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f86ae463694029097b846d8f99fd5536740602ae00022c0c50c5600720b2f71" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" dependencies = [ "bytemuck", ] @@ -4986,14 +4813,14 @@ dependencies = [ [[package]] name = "rss" -version = "2.0.8" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f374fd66bb795938b78c021db1662d43a8ffbc42ec1ac25429fc4833b732751" +checksum = "27e92048f840d98c6d6dd870af9101610ea9ff413f11f1bcebf4f4c31d96d957" dependencies = [ "atom_syndication", "derive_builder", "never", - "quick-xml 0.31.0", + "quick-xml 0.36.1", ] [[package]] @@ -5016,18 +4843,18 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -5050,16 +4877,16 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "aws-lc-rs", "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -5071,7 +4898,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fede2a247359da6b4998f7723ec6468c2d6a577a5d8c17e54f21806426ad2290" dependencies = [ "nanorand", - "rustls 0.23.12", + "rustls 0.23.13", ] [[package]] @@ -5111,9 +4938,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "aws-lc-rs", "ring", @@ -5163,9 +4990,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.14" +version = "2.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79da19444d9da7a9a82b80ecf059eceba6d3129d84a8610fd25ff2364f255466" +checksum = "0c947adb109a8afce5fc9c7bf951f87f146e9147b3a6a58413105628fb1d1e66" dependencies = [ "sdd", ] @@ -5198,9 +5025,9 @@ dependencies = [ [[package]] name = "sdd" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0495e4577c672de8254beb68d01a9b62d0e8a13c099edecdbedccce3223cd29f" +checksum = "60a7b59a5d9b0099720b417b6325d91a52cbf5b3dcb5041d864be53eefa58abc" [[package]] name = "select" @@ -5221,9 +5048,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.207" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -5239,22 +5066,22 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.207" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.124" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.5.0", "itoa", "memchr", "ryu", @@ -5301,7 +5128,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.3.0", + "indexmap 2.5.0", "serde", "serde_derive", "serde_json", @@ -5318,7 +5145,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -5343,7 +5170,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -5487,7 +5314,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -5517,16 +5344,22 @@ dependencies = [ ] [[package]] -name = "stacker" -version = "0.1.15" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stacker" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" dependencies = [ "cc", "cfg-if", "libc", "psm", - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -5619,7 +5452,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -5641,9 +5474,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.74" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -5661,6 +5494,20 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] [[package]] name = "syntect" @@ -5711,15 +5558,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" -[[package]] -name = "task-local-extensions" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba323866e5d033818e3240feeb9f7db2c4296674e4d9e16b97b7bf8f490434e8" -dependencies = [ - "pin-utils", -] - [[package]] name = "tendril" version = "0.4.3" @@ -5764,7 +5602,7 @@ checksum = "78ea17a2dc368aeca6f554343ced1b1e31f76d63683fa8016e5844bd7a5144a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -5784,7 +5622,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -5834,6 +5672,16 @@ version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ab95735ea2c8fd51154d01e39cf13912a78071c2d89abc49a7ef102a7dd725a" +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -5867,14 +5715,14 @@ checksum = "8d9ef545650e79f30233c0003bcc2504d7efac6dad25fca40744de773fe2049c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] name = "tokio" -version = "1.39.2" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -5907,7 +5755,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -5943,7 +5791,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8e98c31c29b2666fb28720739e11476166be4ead1610a37dcd7414bb124413a" dependencies = [ "aws-lc-rs", - "rustls 0.23.12", + "rustls 0.23.13", "tokio", "tokio-postgres", "tokio-rustls 0.26.0", @@ -5957,7 +5805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04fb792ccd6bbcd4bba408eb8a292f70fc4a3589e5d793626f45190e6454b6ab" dependencies = [ "ring", - "rustls 0.23.12", + "rustls 0.23.13", "tokio", "tokio-postgres", "tokio-rustls 0.26.0", @@ -5980,16 +5828,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -5998,9 +5846,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -6048,7 +5896,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", @@ -6061,45 +5909,13 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", "winnow 0.6.18", ] -[[package]] -name = "tonic" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" -dependencies = [ - "async-stream", - "async-trait", - "axum 0.6.20", - "base64 0.13.1", - "bytes", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.30", - "hyper-timeout 0.4.1", - "percent-encoding", - "pin-project", - "prost 0.11.9", - "prost-derive 0.11.9", - "tokio", - "tokio-stream", - "tokio-util", - "tower", - "tower-layer", - "tower-service", - "tracing", - "tracing-futures", -] - [[package]] name = "tonic" version = "0.10.2" @@ -6108,17 +5924,17 @@ checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" dependencies = [ "async-stream", "async-trait", - "axum 0.6.20", + "axum", "base64 0.21.7", "bytes", "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.30", - "hyper-timeout 0.4.1", + "hyper-timeout", "percent-encoding", "pin-project", - "prost 0.12.6", + "prost", "tokio", "tokio-stream", "tower", @@ -6135,47 +5951,17 @@ checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" dependencies = [ "async-stream", "async-trait", - "axum 0.6.20", + "axum", "base64 0.21.7", "bytes", "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.30", - "hyper-timeout 0.4.1", + "hyper-timeout", "percent-encoding", "pin-project", - "prost 0.12.6", - "tokio", - "tokio-stream", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tonic" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38659f4a91aba8598d27821589f5db7dddd94601e7a01b1e485a50e5484c7401" -dependencies = [ - "async-stream", - "async-trait", - "axum 0.7.5", - "base64 0.22.1", - "bytes", - "h2 0.4.5", - "http 1.1.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.4.1", - "hyper-timeout 0.5.1", - "hyper-util", - "percent-encoding", - "pin-project", - "prost 0.13.1", - "socket2", + "prost", "tokio", "tokio-stream", "tower", @@ -6246,16 +6032,16 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee9e39a66d9b615644893ffc1704d2a89b5b315b7fd0228ad3182ca9a306b19" +checksum = "284586dc201db407be8c9d721abad1b3a6dacbbce5cccecd4fd15a37db95ab0d" dependencies = [ "actix-web", "mutually_exclusive_features", - "opentelemetry 0.23.0", + "opentelemetry", "pin-project", "tracing", - "tracing-opentelemetry 0.24.0", + "tracing-opentelemetry", "uuid", ] @@ -6267,7 +6053,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -6290,27 +6076,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - -[[package]] -name = "tracing-log" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -6322,33 +6087,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-opentelemetry" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ffbf13a0f8b054a4e59df3a173b818e9c6177c02789871f2073977fd0062076" -dependencies = [ - "opentelemetry 0.16.0", - "tracing", - "tracing-core", - "tracing-log 0.1.4", - "tracing-subscriber", -] - -[[package]] -name = "tracing-opentelemetry" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00a39dcf9bfc1742fa4d6215253b33a6e474be78275884c216fc2a06267b3600" -dependencies = [ - "once_cell", - "opentelemetry 0.19.0", - "tracing", - "tracing-core", - "tracing-log 0.1.4", - "tracing-subscriber", -] - [[package]] name = "tracing-opentelemetry" version = "0.24.0" @@ -6357,12 +6095,12 @@ checksum = "f68803492bf28ab40aeccaecc7021096bd256baf7ca77c3d425d89b35a7be4e4" dependencies = [ "js-sys", "once_cell", - "opentelemetry 0.23.0", - "opentelemetry_sdk 0.23.0", + "opentelemetry", + "opentelemetry_sdk", "smallvec", "tracing", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", "tracing-subscriber", "web-time", ] @@ -6394,7 +6132,7 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", "tracing-serde", ] @@ -6416,7 +6154,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -6451,7 +6189,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", "termcolor", ] @@ -6472,7 +6210,7 @@ checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", ] [[package]] @@ -6481,15 +6219,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -6504,9 +6233,9 @@ checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" @@ -6519,9 +6248,9 @@ dependencies = [ [[package]] name = "unicode-properties" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" +checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" [[package]] name = "unicode-width" @@ -6531,9 +6260,9 @@ checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "untrusted" @@ -6571,12 +6300,24 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + [[package]] name = "utf8-width" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -6664,7 +6405,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -6698,7 +6439,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6778,9 +6519,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] @@ -6799,11 +6540,11 @@ dependencies = [ [[package]] name = "whoami" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "redox_syscall 0.4.1", + "redox_syscall 0.5.4", "wasite", "web-sys", ] @@ -6848,6 +6589,36 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -7025,14 +6796,16 @@ dependencies = [ ] [[package]] -name = "winreg" -version = "0.52.0" +name = "write16" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "x509-cert" @@ -7067,9 +6840,9 @@ dependencies = [ [[package]] name = "xml-builder" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efc4f1a86af7800dfc4056c7833648ea4515ae21502060b5c98114d828f5333b" +checksum = "5ef5f40cd674b9d9814545203f175ac29ffdcb6e006727f4d95797d7badd72e2" [[package]] name = "xml5ever" @@ -7108,6 +6881,30 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -7126,7 +6923,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "synstructure", ] [[package]] @@ -7146,7 +6964,29 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.77", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 228ff69f1..272691bc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "0.19.6-beta.4" +version = "0.19.6-beta.7" edition = "2021" description = "A link aggregator for the fediverse" license = "AGPL-3.0" @@ -37,15 +37,6 @@ debug = 0 [features] embed-pictrs = ["pict-rs"] -# This feature requires building with `tokio_unstable` flag, see documentation: -# https://docs.rs/tokio/latest/tokio/#unstable-features -console = [ - "console-subscriber", - "opentelemetry", - "opentelemetry-otlp", - "tracing-opentelemetry", - "reqwest-tracing/opentelemetry_0_16", -] json-log = ["tracing-subscriber/json"] default = [] @@ -89,18 +80,18 @@ unwrap_used = "deny" unimplemented = "deny" [workspace.dependencies] -lemmy_api = { version = "=0.19.6-beta.4", path = "./crates/api" } -lemmy_api_crud = { version = "=0.19.6-beta.4", path = "./crates/api_crud" } -lemmy_apub = { version = "=0.19.6-beta.4", path = "./crates/apub" } -lemmy_utils = { version = "=0.19.6-beta.4", path = "./crates/utils", default-features = false } -lemmy_db_schema = { version = "=0.19.6-beta.4", path = "./crates/db_schema" } -lemmy_api_common = { version = "=0.19.6-beta.4", path = "./crates/api_common" } -lemmy_routes = { version = "=0.19.6-beta.4", path = "./crates/routes" } -lemmy_db_views = { version = "=0.19.6-beta.4", path = "./crates/db_views" } -lemmy_db_views_actor = { version = "=0.19.6-beta.4", path = "./crates/db_views_actor" } -lemmy_db_views_moderator = { version = "=0.19.6-beta.4", path = "./crates/db_views_moderator" } -lemmy_federate = { version = "=0.19.6-beta.4", path = "./crates/federate" } -activitypub_federation = { version = "0.5.8", default-features = false, features = [ +lemmy_api = { version = "=0.19.6-beta.7", path = "./crates/api" } +lemmy_api_crud = { version = "=0.19.6-beta.7", path = "./crates/api_crud" } +lemmy_apub = { version = "=0.19.6-beta.7", path = "./crates/apub" } +lemmy_utils = { version = "=0.19.6-beta.7", path = "./crates/utils", default-features = false } +lemmy_db_schema = { version = "=0.19.6-beta.7", path = "./crates/db_schema" } +lemmy_api_common = { version = "=0.19.6-beta.7", path = "./crates/api_common" } +lemmy_routes = { version = "=0.19.6-beta.7", path = "./crates/routes" } +lemmy_db_views = { version = "=0.19.6-beta.7", path = "./crates/db_views" } +lemmy_db_views_actor = { version = "=0.19.6-beta.7", path = "./crates/db_views_actor" } +lemmy_db_views_moderator = { version = "=0.19.6-beta.7", path = "./crates/db_views_moderator" } +lemmy_federate = { version = "=0.19.6-beta.7", path = "./crates/federate" } +activitypub_federation = { version = "0.6.0-alpha1", default-features = false, features = [ "actix-web", ] } diesel = "2.1.6" @@ -108,7 +99,7 @@ diesel_migrations = "2.1.0" diesel-async = "0.4.1" serde = { version = "1.0.204", features = ["derive"] } serde_with = "3.9.0" -actix-web = { version = "4.8.0", default-features = false, features = [ +actix-web = { version = "4.9.0", default-features = false, features = [ "macros", "rustls-0_23", "compress-brotli", @@ -117,19 +108,17 @@ actix-web = { version = "4.8.0", default-features = false, features = [ "cookies", ] } tracing = "0.1.40" -tracing-actix-web = { version = "0.7.11", default-features = false } -tracing-error = "0.2.0" -tracing-log = "0.2.0" +tracing-actix-web = { version = "0.7.10", default-features = false } tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } url = { version = "2.5.2", features = ["serde"] } -reqwest = { version = "0.11.27", default-features = false, features = [ +reqwest = { version = "0.12.7", default-features = false, features = [ "json", "blocking", "gzip", "rustls-tls", ] } -reqwest-middleware = "0.2.5" -reqwest-tracing = "0.4.8" +reqwest-middleware = "0.3.3" +reqwest-tracing = "0.5.3" clokwerk = "0.4.0" doku = { version = "0.21.1", features = ["url-2"] } bcrypt = "0.15.1" @@ -152,10 +141,8 @@ diesel-derive-enum = { version = "2.1.0", features = ["postgres"] } strum = { version = "0.26.3", features = ["derive"] } itertools = "0.13.0" futures = "0.3.30" -http = "0.2.12" +http = "1.1" rosetta-i18n = "0.1.3" -opentelemetry = { version = "0.19.0", features = ["rt-tokio"] } -tracing-opentelemetry = { version = "0.19.0" } ts-rs = { version = "7.1.1", features = [ "serde-compat", "chrono-impl", @@ -171,7 +158,7 @@ moka = { version = "0.12.8", features = ["future"] } i-love-jesus = { version = "0.1.0" } clap = { version = "4.5.13", features = ["derive", "env"] } pretty_assertions = "1.4.0" -derive-new = "0.6.0" +derive-new = "0.7.0" [dependencies] lemmy_api = { workspace = true } @@ -188,8 +175,6 @@ diesel-async = { workspace = true } actix-web = { workspace = true } tracing = { workspace = true } tracing-actix-web = { workspace = true } -tracing-error = { workspace = true } -tracing-log = { workspace = true } tracing-subscriber = { workspace = true } url = { workspace = true } reqwest = { workspace = true } @@ -197,10 +182,6 @@ reqwest-middleware = { workspace = true } reqwest-tracing = { workspace = true } clokwerk = { workspace = true } serde_json = { workspace = true } -tracing-opentelemetry = { workspace = true, optional = true } -opentelemetry = { workspace = true, optional = true } -console-subscriber = { version = "0.4.0", optional = true } -opentelemetry-otlp = { version = "0.12.0", optional = true } pict-rs = { version = "0.5.16", optional = true } rustls = { workspace = true } tokio.workspace = true diff --git a/api_tests/package.json b/api_tests/package.json index 4fe5a40bd..bc2d3ec2d 100644 --- a/api_tests/package.json +++ b/api_tests/package.json @@ -6,7 +6,7 @@ "repository": "https://github.com/LemmyNet/lemmy", "author": "Dessalines", "license": "AGPL-3.0", - "packageManager": "pnpm@9.6.0", + "packageManager": "pnpm@9.9.0", "scripts": { "lint": "tsc --noEmit && eslint --report-unused-disable-directives && prettier --check 'src/**/*.ts'", "fix": "prettier --write src && eslint --fix src", diff --git a/api_tests/pnpm-lock.yaml b/api_tests/pnpm-lock.yaml index 3da842f5d..3b1970681 100644 --- a/api_tests/pnpm-lock.yaml +++ b/api_tests/pnpm-lock.yaml @@ -13,22 +13,22 @@ importers: version: 29.5.12 '@types/node': specifier: ^22.0.2 - version: 22.0.2 + version: 22.5.1 '@typescript-eslint/eslint-plugin': specifier: ^8.0.0 - version: 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4) + version: 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.9.1)(typescript@5.5.4))(eslint@9.9.1)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.0.0 - version: 8.0.0(eslint@9.8.0)(typescript@5.5.4) + version: 8.0.0(eslint@9.9.1)(typescript@5.5.4) eslint: specifier: ^9.8.0 - version: 9.8.0 + version: 9.9.1 eslint-plugin-prettier: specifier: ^5.1.3 - version: 5.2.1(eslint@9.8.0)(prettier@3.3.3) + version: 5.2.1(eslint@9.9.1)(prettier@3.3.3) jest: specifier: ^29.5.0 - version: 29.7.0(@types/node@22.0.2) + version: 29.7.0(@types/node@22.5.1) lemmy-js-client: specifier: 0.19.5-alpha.1 version: 0.19.5-alpha.1 @@ -37,20 +37,16 @@ importers: version: 3.3.3 ts-jest: specifier: ^29.1.0 - version: 29.2.4(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.0.2))(typescript@5.5.4) + version: 29.2.5(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.5.1))(typescript@5.5.4) typescript: specifier: ^5.5.4 version: 5.5.4 typescript-eslint: specifier: ^8.0.0 - version: 8.0.0(eslint@9.8.0)(typescript@5.5.4) + version: 8.0.0(eslint@9.9.1)(typescript@5.5.4) packages: - '@aashutoshrathi/word-wrap@1.2.6': - resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} - engines: {node: '>=0.10.0'} - '@ampproject/remapping@2.2.1': resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} @@ -232,16 +228,16 @@ packages: resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.17.1': - resolution: {integrity: sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA==} + '@eslint/config-array@0.18.0': + resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/eslintrc@3.1.0': resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.8.0': - resolution: {integrity: sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA==} + '@eslint/js@9.9.1': + resolution: {integrity: sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.4': @@ -400,8 +396,8 @@ packages: '@types/jest@29.5.12': resolution: {integrity: sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==} - '@types/node@22.0.2': - resolution: {integrity: sha512-yPL6DyFwY5PiMVEwymNeqUTKsDczQBJ/5T7W/46RwLU/VH+AA8aT5TZkvBviLKLbbm0hlfftEkGrNzfRk/fofQ==} + '@types/node@22.5.1': + resolution: {integrity: sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw==} '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} @@ -516,8 +512,8 @@ packages: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} - async@3.2.5: - resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} + async@3.2.6: + resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} babel-jest@29.7.0: resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} @@ -649,15 +645,6 @@ packages: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - debug@4.3.6: resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} engines: {node: '>=6.0'} @@ -754,10 +741,15 @@ packages: resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.8.0: - resolution: {integrity: sha512-K8qnZ/QJzT2dLKdZJVX6W4XOwBzutMYmt0lqUS+JdXgd+HTYFlonFgkJ8s44d/zMPPCnOOk0kMWCApCPhiOy9A==} + eslint@9.9.1: + resolution: {integrity: sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true espree@10.1.0: resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} @@ -768,8 +760,8 @@ packages: engines: {node: '>=4'} hasBin: true - esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} esrecurse@4.3.0: @@ -928,6 +920,10 @@ packages: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} @@ -1281,8 +1277,8 @@ packages: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} - optionator@0.9.3: - resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} p-limit@2.3.0: @@ -1416,11 +1412,6 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - semver@7.6.3: resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} @@ -1526,8 +1517,8 @@ packages: peerDependencies: typescript: '>=4.2.0' - ts-jest@29.2.4: - resolution: {integrity: sha512-3d6tgDyhCI29HlpwIq87sNuI+3Q6GLTTCeYRHCs7vDz+/3GCMwEtV9jezLyl4ZtnBgx00I7hm8PCP8cTksMGrw==} + ts-jest@29.2.5: + resolution: {integrity: sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -1579,8 +1570,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - undici-types@6.11.1: - resolution: {integrity: sha512-mIDEX2ek50x0OlRgxryxsenE5XaQD4on5U2inY7RApK3SOJpofyw7uW2AyfMKkhAxXIceo2DeWGVGwyvng1GNQ==} + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} update-browserslist-db@1.0.13: resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} @@ -1603,6 +1594,10 @@ packages: engines: {node: '>= 8'} hasBin: true + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -1635,8 +1630,6 @@ packages: snapshots: - '@aashutoshrathi/word-wrap@1.2.6': {} - '@ampproject/remapping@2.2.1': dependencies: '@jridgewell/gen-mapping': 0.3.3 @@ -1841,17 +1834,17 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@eslint-community/eslint-utils@4.4.0(eslint@9.8.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.9.1)': dependencies: - eslint: 9.8.0 + eslint: 9.9.1 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.0': {} - '@eslint/config-array@0.17.1': + '@eslint/config-array@0.18.0': dependencies: '@eslint/object-schema': 2.1.4 - debug: 4.3.4 + debug: 4.3.6 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -1859,10 +1852,10 @@ snapshots: '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 - debug: 4.3.4 + debug: 4.3.6 espree: 10.1.0 globals: 14.0.0 - ignore: 5.3.1 + ignore: 5.3.2 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -1870,7 +1863,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.8.0': {} + '@eslint/js@9.9.1': {} '@eslint/object-schema@2.1.4': {} @@ -1891,7 +1884,7 @@ snapshots: '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 - '@types/node': 22.0.2 + '@types/node': 22.5.1 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 @@ -1904,14 +1897,14 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.0.2 + '@types/node': 22.5.1 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@22.0.2) + jest-config: 29.7.0(@types/node@22.5.1) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -1936,7 +1929,7 @@ snapshots: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.0.2 + '@types/node': 22.5.1 jest-mock: 29.7.0 '@jest/expect-utils@29.7.0': @@ -1954,7 +1947,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 22.0.2 + '@types/node': 22.5.1 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -1976,7 +1969,7 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.22 - '@types/node': 22.0.2 + '@types/node': 22.5.1 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -2046,7 +2039,7 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.0.2 + '@types/node': 22.5.1 '@types/yargs': 17.0.32 chalk: 4.1.2 @@ -2114,7 +2107,7 @@ snapshots: '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 22.0.2 + '@types/node': 22.5.1 '@types/istanbul-lib-coverage@2.0.6': {} @@ -2131,9 +2124,9 @@ snapshots: expect: 29.7.0 pretty-format: 29.7.0 - '@types/node@22.0.2': + '@types/node@22.5.1': dependencies: - undici-types: 6.11.1 + undici-types: 6.19.8 '@types/stack-utils@2.0.3': {} @@ -2143,15 +2136,15 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.9.1)(typescript@5.5.4))(eslint@9.9.1)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 8.0.0(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.0(eslint@9.9.1)(typescript@5.5.4) '@typescript-eslint/scope-manager': 8.0.0 - '@typescript-eslint/type-utils': 8.0.0(eslint@9.8.0)(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/type-utils': 8.0.0(eslint@9.9.1)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.0(eslint@9.9.1)(typescript@5.5.4) '@typescript-eslint/visitor-keys': 8.0.0 - eslint: 9.8.0 + eslint: 9.9.1 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -2161,14 +2154,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.0.0(eslint@9.8.0)(typescript@5.5.4)': + '@typescript-eslint/parser@8.0.0(eslint@9.9.1)(typescript@5.5.4)': dependencies: '@typescript-eslint/scope-manager': 8.0.0 '@typescript-eslint/types': 8.0.0 '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) '@typescript-eslint/visitor-keys': 8.0.0 debug: 4.3.6 - eslint: 9.8.0 + eslint: 9.9.1 optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -2179,10 +2172,10 @@ snapshots: '@typescript-eslint/types': 8.0.0 '@typescript-eslint/visitor-keys': 8.0.0 - '@typescript-eslint/type-utils@8.0.0(eslint@9.8.0)(typescript@5.5.4)': + '@typescript-eslint/type-utils@8.0.0(eslint@9.9.1)(typescript@5.5.4)': dependencies: '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.0(eslint@9.9.1)(typescript@5.5.4) debug: 4.3.6 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: @@ -2208,13 +2201,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.0.0(eslint@9.8.0)(typescript@5.5.4)': + '@typescript-eslint/utils@8.0.0(eslint@9.9.1)(typescript@5.5.4)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1) '@typescript-eslint/scope-manager': 8.0.0 '@typescript-eslint/types': 8.0.0 '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) - eslint: 9.8.0 + eslint: 9.9.1 transitivePeerDependencies: - supports-color - typescript @@ -2266,7 +2259,7 @@ snapshots: array-union@2.1.0: {} - async@3.2.5: {} + async@3.2.6: {} babel-jest@29.7.0(@babel/core@7.23.9): dependencies: @@ -2407,13 +2400,13 @@ snapshots: convert-source-map@2.0.0: {} - create-jest@29.7.0(@types/node@22.0.2): + create-jest@29.7.0(@types/node@22.5.1): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@22.0.2) + jest-config: 29.7.0(@types/node@22.5.1) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -2428,10 +2421,6 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 - debug@4.3.4: - dependencies: - ms: 2.1.2 - debug@4.3.6: dependencies: ms: 2.1.2 @@ -2472,9 +2461,9 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-plugin-prettier@5.2.1(eslint@9.8.0)(prettier@3.3.3): + eslint-plugin-prettier@5.2.1(eslint@9.9.1)(prettier@3.3.3): dependencies: - eslint: 9.8.0 + eslint: 9.9.1 prettier: 3.3.3 prettier-linter-helpers: 1.0.0 synckit: 0.9.1 @@ -2488,31 +2477,31 @@ snapshots: eslint-visitor-keys@4.0.0: {} - eslint@9.8.0: + eslint@9.9.1: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1) '@eslint-community/regexpp': 4.11.0 - '@eslint/config-array': 0.17.1 + '@eslint/config-array': 0.18.0 '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.8.0 + '@eslint/js': 9.9.1 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4 + debug: 4.3.6 escape-string-regexp: 4.0.0 eslint-scope: 8.0.2 eslint-visitor-keys: 4.0.0 espree: 10.1.0 - esquery: 1.5.0 + esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - ignore: 5.3.1 + ignore: 5.3.2 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 @@ -2521,7 +2510,7 @@ snapshots: lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 - optionator: 0.9.3 + optionator: 0.9.4 strip-ansi: 6.0.1 text-table: 0.2.0 transitivePeerDependencies: @@ -2535,7 +2524,7 @@ snapshots: esprima@4.0.1: {} - esquery@1.5.0: + esquery@1.6.0: dependencies: estraverse: 5.3.0 @@ -2667,7 +2656,7 @@ snapshots: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.3.2 - ignore: 5.3.1 + ignore: 5.3.2 merge2: 1.4.1 slash: 3.0.0 @@ -2689,6 +2678,8 @@ snapshots: ignore@5.3.1: {} + ignore@5.3.2: {} + import-fresh@3.3.0: dependencies: parent-module: 1.0.1 @@ -2775,7 +2766,7 @@ snapshots: jake@10.9.2: dependencies: - async: 3.2.5 + async: 3.2.6 chalk: 4.1.2 filelist: 1.0.4 minimatch: 3.1.2 @@ -2792,7 +2783,7 @@ snapshots: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.0.2 + '@types/node': 22.5.1 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.1 @@ -2812,16 +2803,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@22.0.2): + jest-cli@29.7.0(@types/node@22.5.1): dependencies: '@jest/core': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.0.2) + create-jest: 29.7.0(@types/node@22.5.1) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@22.0.2) + jest-config: 29.7.0(@types/node@22.5.1) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -2831,7 +2822,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@22.0.2): + jest-config@29.7.0(@types/node@22.5.1): dependencies: '@babel/core': 7.23.9 '@jest/test-sequencer': 29.7.0 @@ -2856,7 +2847,7 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - '@types/node': 22.0.2 + '@types/node': 22.5.1 transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -2885,7 +2876,7 @@ snapshots: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.0.2 + '@types/node': 22.5.1 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -2895,7 +2886,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 22.0.2 + '@types/node': 22.5.1 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -2934,7 +2925,7 @@ snapshots: jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 22.0.2 + '@types/node': 22.5.1 jest-util: 29.7.0 jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): @@ -2969,7 +2960,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.0.2 + '@types/node': 22.5.1 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -2997,7 +2988,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.0.2 + '@types/node': 22.5.1 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.2 @@ -3036,14 +3027,14 @@ snapshots: jest-util: 29.7.0 natural-compare: 1.4.0 pretty-format: 29.7.0 - semver: 7.6.2 + semver: 7.6.3 transitivePeerDependencies: - supports-color jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 22.0.2 + '@types/node': 22.5.1 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -3062,7 +3053,7 @@ snapshots: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.0.2 + '@types/node': 22.5.1 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -3071,17 +3062,17 @@ snapshots: jest-worker@29.7.0: dependencies: - '@types/node': 22.0.2 + '@types/node': 22.5.1 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@22.0.2): + jest@29.7.0(@types/node@22.5.1): dependencies: '@jest/core': 29.7.0 '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@22.0.2) + jest-cli: 29.7.0(@types/node@22.5.1) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -3204,14 +3195,14 @@ snapshots: dependencies: mimic-fn: 2.1.0 - optionator@0.9.3: + optionator@0.9.4: dependencies: - '@aashutoshrathi/word-wrap': 1.2.6 deep-is: 0.1.4 fast-levenshtein: 2.0.6 levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 + word-wrap: 1.2.5 p-limit@2.3.0: dependencies: @@ -3315,8 +3306,6 @@ snapshots: semver@6.3.1: {} - semver@7.6.2: {} - semver@7.6.3: {} shebang-command@2.0.0: @@ -3404,12 +3393,12 @@ snapshots: dependencies: typescript: 5.5.4 - ts-jest@29.2.4(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.0.2))(typescript@5.5.4): + ts-jest@29.2.5(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.5.1))(typescript@5.5.4): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.0.2) + jest: 29.7.0(@types/node@22.5.1) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -3433,11 +3422,11 @@ snapshots: type-fest@0.21.3: {} - typescript-eslint@8.0.0(eslint@9.8.0)(typescript@5.5.4): + typescript-eslint@8.0.0(eslint@9.9.1)(typescript@5.5.4): dependencies: - '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.8.0)(typescript@5.5.4))(eslint@9.8.0)(typescript@5.5.4) - '@typescript-eslint/parser': 8.0.0(eslint@9.8.0)(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.0(eslint@9.8.0)(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.0.0(@typescript-eslint/parser@8.0.0(eslint@9.9.1)(typescript@5.5.4))(eslint@9.9.1)(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.0(eslint@9.9.1)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.0(eslint@9.9.1)(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -3446,7 +3435,7 @@ snapshots: typescript@5.5.4: {} - undici-types@6.11.1: {} + undici-types@6.19.8: {} update-browserslist-db@1.0.13(browserslist@4.22.3): dependencies: @@ -3472,6 +3461,8 @@ snapshots: dependencies: isexe: 2.0.0 + word-wrap@1.2.5: {} + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 diff --git a/api_tests/src/community.spec.ts b/api_tests/src/community.spec.ts index d172f7045..d8aa6cad6 100644 --- a/api_tests/src/community.spec.ts +++ b/api_tests/src/community.spec.ts @@ -1,5 +1,6 @@ jest.setTimeout(120000); +import { AddModToCommunity } from "lemmy-js-client/dist/types/AddModToCommunity"; import { CommunityView } from "lemmy-js-client/dist/types/CommunityView"; import { alpha, @@ -9,6 +10,7 @@ import { resolveCommunity, createCommunity, deleteCommunity, + delay, removeCommunity, getCommunity, followCommunity, @@ -533,3 +535,41 @@ test("Content in local-only community doesn't federate", async () => { Error("couldnt_find_object"), ); }); + +test("Remote mods can edit communities", async () => { + let communityRes = await createCommunity(alpha); + + let betaCommunity = await resolveCommunity( + beta, + communityRes.community_view.community.actor_id, + ); + if (!betaCommunity.community) { + throw "Missing beta community"; + } + let betaOnAlpha = await resolvePerson(alpha, "lemmy_beta@lemmy-beta:8551"); + + let form: AddModToCommunity = { + community_id: communityRes.community_view.community.id, + person_id: betaOnAlpha.person?.person.id as number, + added: true, + }; + alpha.addModToCommunity(form); + + let form2: EditCommunity = { + community_id: betaCommunity.community?.community.id as number, + description: "Example description", + }; + + await editCommunity(beta, form2); + // give alpha time to get and process the edit + await delay(1000); + + let alphaCommunity = await getCommunity( + alpha, + communityRes.community_view.community.id, + ); + + await expect(alphaCommunity.community_view.community.description).toBe( + "Example description", + ); +}); diff --git a/crates/api/Cargo.toml b/crates/api/Cargo.toml index 9506049ee..87879f6cd 100644 --- a/crates/api/Cargo.toml +++ b/crates/api/Cargo.toml @@ -43,3 +43,4 @@ serial_test = { workspace = true } tokio = { workspace = true } elementtree = "1.2.3" pretty_assertions = { workspace = true } +lemmy_api_crud = { workspace = true } diff --git a/crates/api/src/local_user/list_logins.rs b/crates/api/src/local_user/list_logins.rs index 013236dcd..b5aaf8972 100644 --- a/crates/api/src/local_user/list_logins.rs +++ b/crates/api/src/local_user/list_logins.rs @@ -1,5 +1,5 @@ use actix_web::web::{Data, Json}; -use lemmy_api_common::context::LemmyContext; +use lemmy_api_common::{context::LemmyContext, person::ListLoginsResponse}; use lemmy_db_schema::source::login_token::LoginToken; use lemmy_db_views::structs::LocalUserView; use lemmy_utils::error::LemmyResult; @@ -7,8 +7,8 @@ use lemmy_utils::error::LemmyResult; pub async fn list_logins( context: Data, local_user_view: LocalUserView, -) -> LemmyResult>> { +) -> LemmyResult> { let logins = LoginToken::list(&mut context.pool(), local_user_view.local_user.id).await?; - Ok(Json(logins)) + Ok(Json(ListLoginsResponse { logins })) } diff --git a/crates/api/src/local_user/save_settings.rs b/crates/api/src/local_user/save_settings.rs index 193f9d269..13bdd3646 100644 --- a/crates/api/src/local_user/save_settings.rs +++ b/crates/api/src/local_user/save_settings.rs @@ -135,7 +135,6 @@ pub async fn save_user_settings( blur_nsfw: data.blur_nsfw, auto_expand: data.auto_expand, show_bot_accounts: data.show_bot_accounts, - show_scores: data.show_scores, default_sort_type, default_listing_type, theme: data.theme.clone(), diff --git a/crates/api/src/post/get_link_metadata.rs b/crates/api/src/post/get_link_metadata.rs index 0669408aa..e469b51c7 100644 --- a/crates/api/src/post/get_link_metadata.rs +++ b/crates/api/src/post/get_link_metadata.rs @@ -4,6 +4,7 @@ use lemmy_api_common::{ post::{GetSiteMetadata, GetSiteMetadataResponse}, request::fetch_link_metadata, }; +use lemmy_db_views::structs::LocalUserView; use lemmy_utils::{ error::{LemmyErrorExt, LemmyResult}, LemmyErrorType, @@ -14,6 +15,8 @@ use url::Url; pub async fn get_link_metadata( data: Query, context: Data, + // Require an account for this API + _local_user_view: LocalUserView, ) -> LemmyResult> { let url = Url::parse(&data.url).with_lemmy_type(LemmyErrorType::InvalidUrl)?; let metadata = fetch_link_metadata(&url, &context).await?; diff --git a/crates/api/src/site/registration_applications/approve.rs b/crates/api/src/site/registration_applications/approve.rs index 823af54c4..dcde78117 100644 --- a/crates/api/src/site/registration_applications/approve.rs +++ b/crates/api/src/site/registration_applications/approve.rs @@ -1,4 +1,5 @@ -use actix_web::web::{Data, Json}; +use activitypub_federation::config::Data; +use actix_web::web::Json; use lemmy_api_common::{ context::LemmyContext, site::{ApproveRegistrationApplication, RegistrationApplicationResponse}, @@ -10,10 +11,13 @@ use lemmy_db_schema::{ registration_application::{RegistrationApplication, RegistrationApplicationUpdateForm}, }, traits::Crud, - utils::diesel_string_update, + utils::{diesel_string_update, get_conn}, }; use lemmy_db_views::structs::{LocalUserView, RegistrationApplicationView}; -use lemmy_utils::{error::LemmyResult, LemmyErrorType}; +use lemmy_utils::{ + error::{LemmyError, LemmyResult}, + LemmyErrorType, +}; pub async fn approve_registration_application( data: Json, @@ -25,34 +29,46 @@ pub async fn approve_registration_application( // Only let admins do this is_admin(&local_user_view)?; - // Update the registration with reason, admin_id - let deny_reason = diesel_string_update(data.deny_reason.as_deref()); - let app_form = RegistrationApplicationUpdateForm { - admin_id: Some(Some(local_user_view.person.id)), - deny_reason, - }; + let pool = &mut context.pool(); + let conn = &mut get_conn(pool).await?; + let tx_data = data.clone(); + let approved_user_id = conn + .build_transaction() + .run(|conn| { + Box::pin(async move { + // Update the registration with reason, admin_id + let deny_reason = diesel_string_update(tx_data.deny_reason.as_deref()); + let app_form = RegistrationApplicationUpdateForm { + admin_id: Some(Some(local_user_view.person.id)), + deny_reason, + }; - let registration_application = - RegistrationApplication::update(&mut context.pool(), app_id, &app_form).await?; + let registration_application = + RegistrationApplication::update(&mut conn.into(), app_id, &app_form).await?; - // Update the local_user row - let local_user_form = LocalUserUpdateForm { - accepted_application: Some(data.approve), - ..Default::default() - }; + // Update the local_user row + let local_user_form = LocalUserUpdateForm { + accepted_application: Some(tx_data.approve), + ..Default::default() + }; - let approved_user_id = registration_application.local_user_id; - LocalUser::update(&mut context.pool(), approved_user_id, &local_user_form).await?; + let approved_user_id = registration_application.local_user_id; + LocalUser::update(&mut conn.into(), approved_user_id, &local_user_form).await?; + + Ok::<_, LemmyError>(approved_user_id) + }) as _ + }) + .await?; if data.approve { let approved_local_user_view = LocalUserView::read(&mut context.pool(), approved_user_id) .await? .ok_or(LemmyErrorType::CouldntFindLocalUser)?; - if approved_local_user_view.local_user.email.is_some() { + // Email sending may fail, but this won't revert the application approval send_application_approved_email(&approved_local_user_view, context.settings()).await?; } - } + }; // Read the view let registration_application = RegistrationApplicationView::read(&mut context.pool(), app_id) diff --git a/crates/api/src/site/registration_applications/list.rs b/crates/api/src/site/registration_applications/list.rs index df86b11d5..877e83796 100644 --- a/crates/api/src/site/registration_applications/list.rs +++ b/crates/api/src/site/registration_applications/list.rs @@ -1,4 +1,5 @@ -use actix_web::web::{Data, Json, Query}; +use activitypub_federation::config::Data; +use actix_web::web::{Json, Query}; use lemmy_api_common::{ context::LemmyContext, site::{ListRegistrationApplications, ListRegistrationApplicationsResponse}, diff --git a/crates/api/src/site/registration_applications/mod.rs b/crates/api/src/site/registration_applications/mod.rs index e904f597d..c9a63cdef 100644 --- a/crates/api/src/site/registration_applications/mod.rs +++ b/crates/api/src/site/registration_applications/mod.rs @@ -1,4 +1,6 @@ pub mod approve; pub mod get; pub mod list; +#[cfg(test)] +mod tests; pub mod unread_count; diff --git a/crates/api/src/site/registration_applications/tests.rs b/crates/api/src/site/registration_applications/tests.rs new file mode 100644 index 000000000..062fa550f --- /dev/null +++ b/crates/api/src/site/registration_applications/tests.rs @@ -0,0 +1,428 @@ +use crate::site::registration_applications::{ + approve::approve_registration_application, + list::list_registration_applications, + unread_count::get_unread_registration_application_count, +}; +use activitypub_federation::config::Data; +use actix_web::web::{Json, Query}; +use lemmy_api_common::{ + context::LemmyContext, + site::{ + ApproveRegistrationApplication, + EditSite, + GetUnreadRegistrationApplicationCountResponse, + ListRegistrationApplicationsResponse, + }, +}; +use lemmy_api_crud::site::update::update_site; +use lemmy_db_schema::{ + newtypes::InstanceId, + source::{ + instance::Instance, + local_site::{LocalSite, LocalSiteInsertForm}, + local_site_rate_limit::{LocalSiteRateLimit, LocalSiteRateLimitInsertForm}, + local_user::{LocalUser, LocalUserInsertForm, LocalUserUpdateForm}, + person::{Person, PersonInsertForm}, + registration_application::{RegistrationApplication, RegistrationApplicationInsertForm}, + site::{Site, SiteInsertForm}, + }, + traits::Crud, + utils::DbPool, + RegistrationMode, +}; +use lemmy_db_views::structs::LocalUserView; +use lemmy_utils::{error::LemmyResult, LemmyErrorType, CACHE_DURATION_API}; +use serial_test::serial; + +#[allow(clippy::unwrap_used)] +async fn create_test_site(context: &Data) -> LemmyResult<(Instance, LocalUserView)> { + let pool = &mut context.pool(); + + let inserted_instance = Instance::read_or_create(pool, "my_domain.tld".to_string()) + .await + .expect("Create test instance"); + + let admin_person = Person::create( + pool, + &PersonInsertForm::test_form(inserted_instance.id, "admin"), + ) + .await?; + LocalUser::create( + pool, + &LocalUserInsertForm::test_form_admin(admin_person.id), + vec![], + ) + .await?; + + let admin_local_user_view = LocalUserView::read_person(pool, admin_person.id) + .await? + .unwrap(); + + let site_form = SiteInsertForm::builder() + .name("test site".to_string()) + .instance_id(inserted_instance.id) + .build(); + let site = Site::create(pool, &site_form).await.unwrap(); + + // Create a local site, since this is necessary for determining if email verification is + // required + let local_site_form = LocalSiteInsertForm::builder() + .site_id(site.id) + .require_email_verification(Some(true)) + .application_question(Some(".".to_string())) + .registration_mode(Some(RegistrationMode::RequireApplication)) + .site_setup(Some(true)) + .build(); + let local_site = LocalSite::create(pool, &local_site_form).await.unwrap(); + + // Required to have a working local SiteView when updating the site to change email verification + // requirement or registration mode + let rate_limit_form = LocalSiteRateLimitInsertForm::builder() + .local_site_id(local_site.id) + .build(); + LocalSiteRateLimit::create(pool, &rate_limit_form) + .await + .unwrap(); + + Ok((inserted_instance, admin_local_user_view)) +} + +async fn signup( + pool: &mut DbPool<'_>, + instance_id: InstanceId, + name: &str, + email: Option<&str>, +) -> LemmyResult<(LocalUser, RegistrationApplication)> { + let person_insert_form = PersonInsertForm::test_form(instance_id, name); + let person = Person::create(pool, &person_insert_form).await?; + + let local_user_insert_form = match email { + Some(email) => LocalUserInsertForm { + email: Some(email.to_string()), + email_verified: Some(false), + ..LocalUserInsertForm::test_form(person.id) + }, + None => LocalUserInsertForm::test_form(person.id), + }; + + let local_user = LocalUser::create(pool, &local_user_insert_form, vec![]).await?; + + let application_insert_form = RegistrationApplicationInsertForm { + local_user_id: local_user.id, + answer: "x".to_string(), + }; + let application = RegistrationApplication::create(pool, &application_insert_form).await?; + + Ok((local_user, application)) +} + +#[allow(clippy::unwrap_used)] +async fn get_application_statuses( + context: &Data, + admin: LocalUserView, +) -> LemmyResult<( + Json, + Json, + Json, +)> { + let application_count = + get_unread_registration_application_count(context.reset_request_count(), admin.clone()).await?; + + let unread_applications = list_registration_applications( + Query::from_query("unread_only=true").unwrap(), + context.reset_request_count(), + admin.clone(), + ) + .await?; + + let all_applications = list_registration_applications( + Query::from_query("unread_only=false").unwrap(), + context.reset_request_count(), + admin, + ) + .await?; + + Ok((application_count, unread_applications, all_applications)) +} + +#[allow(clippy::indexing_slicing)] +#[allow(clippy::unwrap_used)] +#[tokio::test] +#[serial] +async fn test_application_approval() -> LemmyResult<()> { + let context = LemmyContext::init_test_context().await; + let pool = &mut context.pool(); + + let (instance, admin_local_user_view) = create_test_site(&context).await?; + + // Non-unread counts unfortunately are duplicated due to different types (i64 vs usize) + let mut expected_total_applications = 0; + let mut expected_unread_applications = 0u8; + + let (local_user_with_email, app_with_email) = + signup(pool, instance.id, "user_w_email", Some("lemmy@localhost")).await?; + + let (application_count, unread_applications, all_applications) = + get_application_statuses(&context, admin_local_user_view.clone()).await?; + + // When email verification is required and the email is not verified the application should not + // be visible to admins + assert_eq!( + application_count.registration_applications, + i64::from(expected_unread_applications), + ); + assert_eq!( + unread_applications.registration_applications.len(), + usize::from(expected_unread_applications), + ); + assert_eq!( + all_applications.registration_applications.len(), + expected_total_applications, + ); + + LocalUser::update( + pool, + local_user_with_email.id, + &LocalUserUpdateForm { + email_verified: Some(true), + ..Default::default() + }, + ) + .await?; + + expected_total_applications += 1; + expected_unread_applications += 1; + + let (application_count, unread_applications, all_applications) = + get_application_statuses(&context, admin_local_user_view.clone()).await?; + + // When email verification is required and the email is verified the application should be + // visible to admins + assert_eq!( + application_count.registration_applications, + i64::from(expected_unread_applications), + ); + assert_eq!( + unread_applications.registration_applications.len(), + usize::from(expected_unread_applications), + ); + assert!( + !unread_applications.registration_applications[0] + .creator_local_user + .accepted_application + ); + assert_eq!( + all_applications.registration_applications.len(), + expected_total_applications, + ); + + let approval = approve_registration_application( + Json(ApproveRegistrationApplication { + id: app_with_email.id, + approve: true, + deny_reason: None, + }), + context.reset_request_count(), + admin_local_user_view.clone(), + ) + .await; + // Approval should be processed up until email sending is attempted + assert!(approval.is_err_and(|e| e.error_type == LemmyErrorType::NoEmailSetup)); + + expected_unread_applications -= 1; + + let (application_count, unread_applications, all_applications) = + get_application_statuses(&context, admin_local_user_view.clone()).await?; + + // When the application is approved it should only be returned for unread queries + assert_eq!( + application_count.registration_applications, + i64::from(expected_unread_applications), + ); + assert_eq!( + unread_applications.registration_applications.len(), + usize::from(expected_unread_applications), + ); + assert_eq!( + all_applications.registration_applications.len(), + expected_total_applications, + ); + assert!( + all_applications.registration_applications[0] + .creator_local_user + .accepted_application + ); + + let (_local_user, app_with_email_2) = signup( + pool, + instance.id, + "user_w_email_2", + Some("lemmy2@localhost"), + ) + .await?; + let (application_count, unread_applications, all_applications) = + get_application_statuses(&context, admin_local_user_view.clone()).await?; + + // Email not verified, so application still not visible + assert_eq!( + application_count.registration_applications, + i64::from(expected_unread_applications), + ); + assert_eq!( + unread_applications.registration_applications.len(), + usize::from(expected_unread_applications), + ); + assert_eq!( + all_applications.registration_applications.len(), + expected_total_applications, + ); + + update_site( + Json(EditSite { + require_email_verification: Some(false), + ..Default::default() + }), + context.reset_request_count(), + admin_local_user_view.clone(), + ) + .await?; + + // TODO: There is probably a better way to ensure cache invalidation + tokio::time::sleep(CACHE_DURATION_API).await; + + expected_total_applications += 1; + expected_unread_applications += 1; + + let (application_count, unread_applications, all_applications) = + get_application_statuses(&context, admin_local_user_view.clone()).await?; + + // After disabling email verification the application should now be visible + assert_eq!( + application_count.registration_applications, + i64::from(expected_unread_applications), + ); + assert_eq!( + unread_applications.registration_applications.len(), + usize::from(expected_unread_applications), + ); + assert_eq!( + all_applications.registration_applications.len(), + expected_total_applications, + ); + + approve_registration_application( + Json(ApproveRegistrationApplication { + id: app_with_email_2.id, + approve: false, + deny_reason: None, + }), + context.reset_request_count(), + admin_local_user_view.clone(), + ) + .await?; + + expected_unread_applications -= 1; + + let (application_count, unread_applications, all_applications) = + get_application_statuses(&context, admin_local_user_view.clone()).await?; + + // Denied applications should not be marked as unread + assert_eq!( + application_count.registration_applications, + i64::from(expected_unread_applications), + ); + assert_eq!( + unread_applications.registration_applications.len(), + usize::from(expected_unread_applications), + ); + assert_eq!( + all_applications.registration_applications.len(), + expected_total_applications, + ); + + signup(pool, instance.id, "user_wo_email", None).await?; + + expected_total_applications += 1; + expected_unread_applications += 1; + + let (application_count, unread_applications, all_applications) = + get_application_statuses(&context, admin_local_user_view.clone()).await?; + + // New user without email should immediately be visible + assert_eq!( + application_count.registration_applications, + i64::from(expected_unread_applications), + ); + assert_eq!( + unread_applications.registration_applications.len(), + usize::from(expected_unread_applications), + ); + assert_eq!( + all_applications.registration_applications.len(), + expected_total_applications, + ); + + signup(pool, instance.id, "user_w_email_3", None).await?; + + expected_total_applications += 1; + expected_unread_applications += 1; + + let (application_count, unread_applications, all_applications) = + get_application_statuses(&context, admin_local_user_view.clone()).await?; + + // New user with email should immediately be visible + assert_eq!( + application_count.registration_applications, + i64::from(expected_unread_applications), + ); + assert_eq!( + unread_applications.registration_applications.len(), + usize::from(expected_unread_applications), + ); + assert_eq!( + all_applications.registration_applications.len(), + expected_total_applications, + ); + + update_site( + Json(EditSite { + registration_mode: Some(RegistrationMode::Open), + ..Default::default() + }), + context.reset_request_count(), + admin_local_user_view.clone(), + ) + .await?; + + // TODO: There is probably a better way to ensure cache invalidation + tokio::time::sleep(CACHE_DURATION_API).await; + + let (application_count, unread_applications, all_applications) = + get_application_statuses(&context, admin_local_user_view.clone()).await?; + + // TODO: At this time applications do not get approved when switching to open registration, so the + // numbers will not change. See https://github.com/LemmyNet/lemmy/issues/4969 + // expected_application_count = 0; + // expected_unread_applications_len = 0; + + // When applications are not required all previous applications should become approved but still + // visible + assert_eq!( + application_count.registration_applications, + i64::from(expected_unread_applications), + ); + assert_eq!( + unread_applications.registration_applications.len(), + usize::from(expected_unread_applications), + ); + assert_eq!( + all_applications.registration_applications.len(), + expected_total_applications, + ); + + LocalSite::delete(pool).await?; + // Instance deletion cascades cleanup of all created persons + Instance::delete(pool, instance.id).await?; + + Ok(()) +} diff --git a/crates/api/src/site/registration_applications/unread_count.rs b/crates/api/src/site/registration_applications/unread_count.rs index a12ecb1d3..5cc391ed0 100644 --- a/crates/api/src/site/registration_applications/unread_count.rs +++ b/crates/api/src/site/registration_applications/unread_count.rs @@ -1,4 +1,5 @@ -use actix_web::web::{Data, Json}; +use activitypub_federation::config::Data; +use actix_web::web::Json; use lemmy_api_common::{ context::LemmyContext, site::GetUnreadRegistrationApplicationCountResponse, diff --git a/crates/api_common/src/person.rs b/crates/api_common/src/person.rs index f61f784c2..29e9ef084 100644 --- a/crates/api_common/src/person.rs +++ b/crates/api_common/src/person.rs @@ -1,7 +1,7 @@ use lemmy_db_schema::{ newtypes::{CommentReplyId, CommunityId, LanguageId, PersonId, PersonMentionId}, sensitive::SensitiveString, - source::site::Site, + source::{login_token::LoginToken, site::Site}, CommentSortType, ListingType, PostListingMode, @@ -441,3 +441,10 @@ pub struct ListMedia { pub struct ListMediaResponse { pub images: Vec, } + +#[derive(Debug, Serialize, Deserialize, Clone)] +#[cfg_attr(feature = "full", derive(TS))] +#[cfg_attr(feature = "full", ts(export))] +pub struct ListLoginsResponse { + pub logins: Vec, +} diff --git a/crates/api_common/src/site.rs b/crates/api_common/src/site.rs index 3850de1c6..5311eca9c 100644 --- a/crates/api_common/src/site.rs +++ b/crates/api_common/src/site.rs @@ -11,10 +11,12 @@ use lemmy_db_schema::{ RegistrationApplicationId, }, source::{ + community::Community, federation_queue_state::FederationQueueState, instance::Instance, language::Language, local_site_url_blocklist::LocalSiteUrlBlocklist, + person::Person, tagline::Tagline, }, ListingType, @@ -33,12 +35,9 @@ use lemmy_db_views::structs::{ SiteView, }; use lemmy_db_views_actor::structs::{ - CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, - InstanceBlockView, - PersonBlockView, PersonView, }; use lemmy_db_views_moderator::structs::{ @@ -337,9 +336,9 @@ pub struct MyUserInfo { pub local_user_view: LocalUserView, pub follows: Vec, pub moderates: Vec, - pub community_blocks: Vec, - pub instance_blocks: Vec, - pub person_blocks: Vec, + pub community_blocks: Vec, + pub instance_blocks: Vec, + pub person_blocks: Vec, pub discussion_languages: Vec, } diff --git a/crates/api_crud/src/site/create.rs b/crates/api_crud/src/site/create.rs index 6b1909966..9dcd1595a 100644 --- a/crates/api_crud/src/site/create.rs +++ b/crates/api_crud/src/site/create.rs @@ -1,6 +1,6 @@ use crate::site::{application_question_check, site_default_post_listing_type_check}; -use activitypub_federation::http_signatures::generate_actor_keypair; -use actix_web::web::{Data, Json}; +use activitypub_federation::{config::Data, http_signatures::generate_actor_keypair}; +use actix_web::web::Json; use lemmy_api_common::{ context::LemmyContext, site::{CreateSite, SiteResponse}, diff --git a/crates/api_crud/src/site/read.rs b/crates/api_crud/src/site/read.rs index c633bebde..d2a13ac5e 100644 --- a/crates/api_crud/src/site/read.rs +++ b/crates/api_crud/src/site/read.rs @@ -5,19 +5,15 @@ use lemmy_api_common::{ }; use lemmy_db_schema::source::{ actor_language::{LocalUserLanguage, SiteLanguage}, + community_block::CommunityBlock, + instance_block::InstanceBlock, language::Language, local_site_url_blocklist::LocalSiteUrlBlocklist, + person_block::PersonBlock, tagline::Tagline, }; use lemmy_db_views::structs::{CustomEmojiView, LocalUserView, SiteView}; -use lemmy_db_views_actor::structs::{ - CommunityBlockView, - CommunityFollowerView, - CommunityModeratorView, - InstanceBlockView, - PersonBlockView, - PersonView, -}; +use lemmy_db_views_actor::structs::{CommunityFollowerView, CommunityModeratorView, PersonView}; use lemmy_utils::{ error::{LemmyError, LemmyErrorExt, LemmyErrorType, LemmyResult}, CACHE_DURATION_API, @@ -81,9 +77,9 @@ pub async fn get_site( discussion_languages, ) = lemmy_db_schema::try_join_with_pool!(pool => ( |pool| CommunityFollowerView::for_person(pool, person_id), - |pool| CommunityBlockView::for_person(pool, person_id), - |pool| InstanceBlockView::for_person(pool, person_id), - |pool| PersonBlockView::for_person(pool, person_id), + |pool| CommunityBlock::for_person(pool, person_id), + |pool| InstanceBlock::for_person(pool, person_id), + |pool| PersonBlock::for_person(pool, person_id), |pool| CommunityModeratorView::for_person(pool, person_id, Some(&local_user_view.local_user)), |pool| LocalUserLanguage::read(pool, local_user_id) )) diff --git a/crates/apub/assets/lemmy/activities/block/block_user.json b/crates/apub/assets/lemmy/activities/block/block_user.json index a07d3786c..f6d6170c3 100644 --- a/crates/apub/assets/lemmy/activities/block/block_user.json +++ b/crates/apub/assets/lemmy/activities/block/block_user.json @@ -8,6 +8,6 @@ "type": "Block", "removeData": true, "summary": "spam post", - "expires": "2021-11-01T12:23:50.151874Z", + "endTime": "2021-11-01T12:23:50.151874Z", "id": "http://enterprise.lemmy.ml/activities/block/5d42fffb-0903-4625-86d4-0b39bb344fc2" } diff --git a/crates/apub/assets/lemmy/activities/block/undo_block_user.json b/crates/apub/assets/lemmy/activities/block/undo_block_user.json index 5dadc0781..922b5e777 100644 --- a/crates/apub/assets/lemmy/activities/block/undo_block_user.json +++ b/crates/apub/assets/lemmy/activities/block/undo_block_user.json @@ -11,7 +11,7 @@ "type": "Block", "removeData": true, "summary": "spam post", - "expires": "2021-11-01T12:23:50.151874Z", + "endTime": "2021-11-01T12:23:50.151874Z", "id": "http://enterprise.lemmy.ml/activities/block/726f43ab-bd0e-4ab3-89c8-627e976f553c" }, "cc": ["http://enterprise.lemmy.ml/c/main"], diff --git a/crates/apub/src/activities/block/block_user.rs b/crates/apub/src/activities/block/block_user.rs index 48408c4fb..e6c97c424 100644 --- a/crates/apub/src/activities/block/block_user.rs +++ b/crates/apub/src/activities/block/block_user.rs @@ -74,7 +74,6 @@ impl BlockUser { &context.settings().get_protocol_and_hostname(), )?, audience, - expires, end_time: expires, }) } @@ -157,7 +156,7 @@ impl ActivityHandler for BlockUser { #[tracing::instrument(skip_all)] async fn receive(self, context: &Data) -> LemmyResult<()> { insert_received_activity(&self.id, context).await?; - let expires = self.expires.or(self.end_time).map(Into::into); + let expires = self.end_time.map(Into::into); let mod_person = self.actor.dereference(context).await?; let blocked_person = self.object.dereference(context).await?; let target = self.target.dereference(context).await?; diff --git a/crates/apub/src/activities/block/undo_block_user.rs b/crates/apub/src/activities/block/undo_block_user.rs index b92320b2d..69f3eeebf 100644 --- a/crates/apub/src/activities/block/undo_block_user.rs +++ b/crates/apub/src/activities/block/undo_block_user.rs @@ -98,7 +98,7 @@ impl ActivityHandler for UndoBlockUser { #[tracing::instrument(skip_all)] async fn receive(self, context: &Data) -> LemmyResult<()> { insert_received_activity(&self.id, context).await?; - let expires = self.object.expires.or(self.object.end_time).map(Into::into); + let expires = self.object.end_time.map(Into::into); let mod_person = self.actor.dereference(context).await?; let blocked_person = self.object.object.dereference(context).await?; match self.object.target.dereference(context).await? { diff --git a/crates/apub/src/api/resolve_object.rs b/crates/apub/src/api/resolve_object.rs index 3f2591241..4c592aeeb 100644 --- a/crates/apub/src/api/resolve_object.rs +++ b/crates/apub/src/api/resolve_object.rs @@ -27,7 +27,7 @@ pub async fn resolve_object( // if there's no personId then the JWT was missing or invalid. let is_authenticated = local_user_view.is_some(); - let res = if is_authenticated { + let res = if is_authenticated || cfg!(debug_assertions) { // user is fully authenticated; allow remote lookups as well. search_query_to_object_id(data.q.clone(), &context).await } else { diff --git a/crates/apub/src/api/user_settings_backup.rs b/crates/apub/src/api/user_settings_backup.rs index a0879b3c9..fdf8dc2ad 100644 --- a/crates/apub/src/api/user_settings_backup.rs +++ b/crates/apub/src/api/user_settings_backup.rs @@ -122,7 +122,6 @@ pub async fn import_settings( .settings .as_ref() .map(|s| s.send_notifications_to_email), - show_scores: data.settings.as_ref().map(|s| s.show_scores), show_bot_accounts: data.settings.as_ref().map(|s| s.show_bot_accounts), show_read_posts: data.settings.as_ref().map(|s| s.show_read_posts), open_links_in_new_tab: data.settings.as_ref().map(|s| s.open_links_in_new_tab), diff --git a/crates/apub/src/http/mod.rs b/crates/apub/src/http/mod.rs index 6303dd1b0..a01afe676 100644 --- a/crates/apub/src/http/mod.rs +++ b/crates/apub/src/http/mod.rs @@ -11,7 +11,6 @@ use activitypub_federation::{ FEDERATION_CONTENT_TYPE, }; use actix_web::{web, web::Bytes, HttpRequest, HttpResponse}; -use http::{header::LOCATION, StatusCode}; use lemmy_api_common::context::LemmyContext; use lemmy_db_schema::{ newtypes::DbUrl, @@ -76,14 +75,14 @@ fn create_apub_tombstone_response>(id: T) -> LemmyResult HttpResponse { let mut res = HttpResponse::PermanentRedirect(); - res.insert_header((LOCATION, url.as_str())); + res.insert_header((actix_web::http::header::LOCATION, url.as_str())); res.finish() } diff --git a/crates/apub/src/objects/post.rs b/crates/apub/src/objects/post.rs index 0364039bb..44e842413 100644 --- a/crates/apub/src/objects/post.rs +++ b/crates/apub/src/objects/post.rs @@ -41,7 +41,11 @@ use lemmy_db_views_actor::structs::CommunityModeratorView; use lemmy_utils::{ error::{LemmyError, LemmyErrorType, LemmyResult}, spawn_try_task, - utils::{markdown::markdown_to_html, slurs::check_slurs_opt, validation::is_valid_url}, + utils::{ + markdown::markdown_to_html, + slurs::check_slurs_opt, + validation::{is_url_blocked, is_valid_url}, + }, }; use std::ops::Deref; use stringreader::StringReader; @@ -180,8 +184,15 @@ impl Object for ApubPost { let creator = page.creator()?.dereference(context).await?; let community = page.community(context).await?; if community.posting_restricted_to_mods { - CommunityModeratorView::is_community_moderator(&mut context.pool(), community.id, creator.id) - .await?; + let is_mod = CommunityModeratorView::is_community_moderator( + &mut context.pool(), + community.id, + creator.id, + ) + .await?; + if !is_mod { + Err(LemmyErrorType::OnlyModsCanPostInCommunity)? + } } let mut name = page .name @@ -220,14 +231,16 @@ impl Object for ApubPost { None }; + let url_blocklist = get_url_blocklist(context).await?; + if let Some(url) = &url { + is_url_blocked(url, &url_blocklist)?; is_valid_url(url)?; } let alt_text = first_attachment.cloned().and_then(Attachment::alt_text); let slur_regex = &local_site_opt_to_slur_regex(&local_site); - let url_blocklist = get_url_blocklist(context).await?; let body = read_from_string_or_source_opt(&page.content, &page.media_type, &page.source); let body = process_markdown_opt(&body, slur_regex, &url_blocklist, context).await?; diff --git a/crates/apub/src/protocol/activities/block/block_user.rs b/crates/apub/src/protocol/activities/block/block_user.rs index c1a4c64c7..96135d645 100644 --- a/crates/apub/src/protocol/activities/block/block_user.rs +++ b/crates/apub/src/protocol/activities/block/block_user.rs @@ -38,8 +38,6 @@ pub struct BlockUser { pub(crate) remove_data: Option, /// block reason, written to mod log pub(crate) summary: Option, - /// TODO: deprecated - pub(crate) expires: Option>, pub(crate) end_time: Option>, } diff --git a/crates/apub/src/protocol/objects/group.rs b/crates/apub/src/protocol/objects/group.rs index a95fff262..8f138e001 100644 --- a/crates/apub/src/protocol/objects/group.rs +++ b/crates/apub/src/protocol/objects/group.rs @@ -7,7 +7,7 @@ use crate::{ community_outbox::ApubCommunityOutbox, }, local_site_data_cached, - objects::{community::ApubCommunity, read_from_string_or_source_opt, verify_is_remote_object}, + objects::{community::ApubCommunity, read_from_string_or_source_opt}, protocol::{ objects::{Endpoints, LanguageTag}, ImageObject, @@ -80,7 +80,6 @@ impl Group { ) -> LemmyResult<()> { check_apub_id_valid_with_strictness(self.id.inner(), true, context).await?; verify_domains_match(expected_domain, self.id.inner())?; - verify_is_remote_object(&self.id, context)?; let local_site_data = local_site_data_cached(&mut context.pool()).await?; let slur_regex = &local_site_opt_to_slur_regex(&local_site_data.local_site); diff --git a/crates/db_schema/src/impls/community_block.rs b/crates/db_schema/src/impls/community_block.rs index 1393f49d3..944a53ae3 100644 --- a/crates/db_schema/src/impls/community_block.rs +++ b/crates/db_schema/src/impls/community_block.rs @@ -1,7 +1,10 @@ use crate::{ newtypes::{CommunityId, PersonId}, - schema::community_block::dsl::{community_block, community_id, person_id}, - source::community_block::{CommunityBlock, CommunityBlockForm}, + schema::{community, community_block}, + source::{ + community::Community, + community_block::{CommunityBlock, CommunityBlockForm}, + }, traits::Blockable, utils::{get_conn, DbPool}, }; @@ -9,6 +12,7 @@ use diesel::{ dsl::{exists, insert_into}, result::Error, select, + ExpressionMethods, QueryDsl, }; use diesel_async::RunQueryDsl; @@ -21,11 +25,27 @@ impl CommunityBlock { ) -> Result { let conn = &mut get_conn(pool).await?; select(exists( - community_block.find((for_person_id, for_community_id)), + community_block::table.find((for_person_id, for_community_id)), )) .get_result(conn) .await } + + pub async fn for_person( + pool: &mut DbPool<'_>, + person_id: PersonId, + ) -> Result, Error> { + let conn = &mut get_conn(pool).await?; + community_block::table + .inner_join(community::table) + .select(community::all_columns) + .filter(community_block::person_id.eq(person_id)) + .filter(community::deleted.eq(false)) + .filter(community::removed.eq(false)) + .order_by(community_block::published) + .load::(conn) + .await + } } #[async_trait] @@ -33,9 +53,9 @@ impl Blockable for CommunityBlock { type Form = CommunityBlockForm; async fn block(pool: &mut DbPool<'_>, community_block_form: &Self::Form) -> Result { let conn = &mut get_conn(pool).await?; - insert_into(community_block) + insert_into(community_block::table) .values(community_block_form) - .on_conflict((person_id, community_id)) + .on_conflict((community_block::person_id, community_block::community_id)) .do_update() .set(community_block_form) .get_result::(conn) @@ -46,7 +66,7 @@ impl Blockable for CommunityBlock { community_block_form: &Self::Form, ) -> Result { let conn = &mut get_conn(pool).await?; - diesel::delete(community_block.find(( + diesel::delete(community_block::table.find(( community_block_form.person_id, community_block_form.community_id, ))) diff --git a/crates/db_schema/src/impls/instance_block.rs b/crates/db_schema/src/impls/instance_block.rs index e32688411..15fcd1443 100644 --- a/crates/db_schema/src/impls/instance_block.rs +++ b/crates/db_schema/src/impls/instance_block.rs @@ -1,7 +1,10 @@ use crate::{ newtypes::{InstanceId, PersonId}, - schema::instance_block::dsl::{instance_block, instance_id, person_id}, - source::instance_block::{InstanceBlock, InstanceBlockForm}, + schema::{instance, instance_block}, + source::{ + instance::Instance, + instance_block::{InstanceBlock, InstanceBlockForm}, + }, traits::Blockable, utils::{get_conn, DbPool}, }; @@ -9,6 +12,7 @@ use diesel::{ dsl::{exists, insert_into}, result::Error, select, + ExpressionMethods, QueryDsl, }; use diesel_async::RunQueryDsl; @@ -21,11 +25,25 @@ impl InstanceBlock { ) -> Result { let conn = &mut get_conn(pool).await?; select(exists( - instance_block.find((for_person_id, for_instance_id)), + instance_block::table.find((for_person_id, for_instance_id)), )) .get_result(conn) .await } + + pub async fn for_person( + pool: &mut DbPool<'_>, + person_id: PersonId, + ) -> Result, Error> { + let conn = &mut get_conn(pool).await?; + instance_block::table + .inner_join(instance::table) + .select(instance::all_columns) + .filter(instance_block::person_id.eq(person_id)) + .order_by(instance_block::published) + .load::(conn) + .await + } } #[async_trait] @@ -33,9 +51,9 @@ impl Blockable for InstanceBlock { type Form = InstanceBlockForm; async fn block(pool: &mut DbPool<'_>, instance_block_form: &Self::Form) -> Result { let conn = &mut get_conn(pool).await?; - insert_into(instance_block) + insert_into(instance_block::table) .values(instance_block_form) - .on_conflict((person_id, instance_id)) + .on_conflict((instance_block::person_id, instance_block::instance_id)) .do_update() .set(instance_block_form) .get_result::(conn) @@ -46,7 +64,7 @@ impl Blockable for InstanceBlock { instance_block_form: &Self::Form, ) -> Result { let conn = &mut get_conn(pool).await?; - diesel::delete(instance_block.find(( + diesel::delete(instance_block::table.find(( instance_block_form.person_id, instance_block_form.instance_id, ))) diff --git a/crates/db_schema/src/impls/local_user.rs b/crates/db_schema/src/impls/local_user.rs index 32e8d50b7..acff6af2a 100644 --- a/crates/db_schema/src/impls/local_user.rs +++ b/crates/db_schema/src/impls/local_user.rs @@ -115,11 +115,11 @@ impl LocalUser { let conn = &mut get_conn(pool).await?; // Make sure: - // - The deny reason exists + // - An admin has interacted with the application // - The app is older than a week // - The accepted_application is false let old_denied_registrations = registration_application::table - .filter(registration_application::deny_reason.is_not_null()) + .filter(registration_application::admin_id.is_not_null()) .filter(registration_application::published.lt(now() - 1.week())) .select(registration_application::local_user_id); diff --git a/crates/db_schema/src/impls/person_block.rs b/crates/db_schema/src/impls/person_block.rs index 0dbf003d8..cfd41f6d6 100644 --- a/crates/db_schema/src/impls/person_block.rs +++ b/crates/db_schema/src/impls/person_block.rs @@ -1,7 +1,10 @@ use crate::{ newtypes::PersonId, - schema::person_block::dsl::{person_block, person_id, target_id}, - source::person_block::{PersonBlock, PersonBlockForm}, + schema::{person, person_block}, + source::{ + person::Person, + person_block::{PersonBlock, PersonBlockForm}, + }, traits::Blockable, utils::{get_conn, DbPool}, }; @@ -9,6 +12,8 @@ use diesel::{ dsl::{exists, insert_into}, result::Error, select, + ExpressionMethods, + JoinOnDsl, QueryDsl, }; use diesel_async::RunQueryDsl; @@ -20,8 +25,30 @@ impl PersonBlock { for_recipient_id: PersonId, ) -> Result { let conn = &mut get_conn(pool).await?; - select(exists(person_block.find((for_person_id, for_recipient_id)))) - .get_result(conn) + select(exists( + person_block::table.find((for_person_id, for_recipient_id)), + )) + .get_result(conn) + .await + } + + pub async fn for_person( + pool: &mut DbPool<'_>, + person_id: PersonId, + ) -> Result, Error> { + let conn = &mut get_conn(pool).await?; + let target_person_alias = diesel::alias!(person as person1); + + person_block::table + .inner_join(person::table.on(person_block::person_id.eq(person::id))) + .inner_join( + target_person_alias.on(person_block::target_id.eq(target_person_alias.field(person::id))), + ) + .select(target_person_alias.fields(person::all_columns)) + .filter(person_block::person_id.eq(person_id)) + .filter(target_person_alias.field(person::deleted).eq(false)) + .order_by(person_block::published) + .load::(conn) .await } } @@ -34,9 +61,9 @@ impl Blockable for PersonBlock { person_block_form: &PersonBlockForm, ) -> Result { let conn = &mut get_conn(pool).await?; - insert_into(person_block) + insert_into(person_block::table) .values(person_block_form) - .on_conflict((person_id, target_id)) + .on_conflict((person_block::person_id, person_block::target_id)) .do_update() .set(person_block_form) .get_result::(conn) @@ -44,8 +71,10 @@ impl Blockable for PersonBlock { } async fn unblock(pool: &mut DbPool<'_>, person_block_form: &Self::Form) -> Result { let conn = &mut get_conn(pool).await?; - diesel::delete(person_block.find((person_block_form.person_id, person_block_form.target_id))) - .execute(conn) - .await + diesel::delete( + person_block::table.find((person_block_form.person_id, person_block_form.target_id)), + ) + .execute(conn) + .await } } diff --git a/crates/db_schema/src/schema.rs b/crates/db_schema/src/schema.rs index fc418ec28..c78acfe37 100644 --- a/crates/db_schema/src/schema.rs +++ b/crates/db_schema/src/schema.rs @@ -446,7 +446,6 @@ diesel::table! { interface_language -> Varchar, show_avatars -> Bool, send_notifications_to_email -> Bool, - show_scores -> Bool, show_bot_accounts -> Bool, show_read_posts -> Bool, email_verified -> Bool, diff --git a/crates/db_schema/src/schema_setup.rs b/crates/db_schema/src/schema_setup.rs index 3def94060..fb4affa91 100644 --- a/crates/db_schema/src/schema_setup.rs +++ b/crates/db_schema/src/schema_setup.rs @@ -2,7 +2,6 @@ use anyhow::Context; use diesel::{connection::SimpleConnection, Connection, PgConnection}; use diesel_migrations::{EmbeddedMigrations, MigrationHarness}; use lemmy_utils::error::LemmyError; -use tracing::info; const MIGRATIONS: EmbeddedMigrations = embed_migrations!(); @@ -34,7 +33,7 @@ pub fn run(db_url: &str) -> Result<(), LemmyError> { // transaction as `REPLACEABLE_SCHEMA`. This code will be becone less hacky when the conditional // setup of things in `REPLACEABLE_SCHEMA` is done without using the number of pending // migrations. - info!("Running Database migrations (This may take a long time)..."); + println!("Running Database migrations (This may take a long time)..."); let migrations = conn .pending_migrations(MIGRATIONS) .map_err(|e| anyhow::anyhow!("Couldn't determine pending migrations: {e}"))?; @@ -60,7 +59,7 @@ pub fn run(db_url: &str) -> Result<(), LemmyError> { Ok(()) })?; - info!("Database migrations complete."); + println!("Database migrations complete."); Ok(()) } diff --git a/crates/db_schema/src/source/local_user.rs b/crates/db_schema/src/source/local_user.rs index c7a5b5224..89bdb1b55 100644 --- a/crates/db_schema/src/source/local_user.rs +++ b/crates/db_schema/src/source/local_user.rs @@ -35,9 +35,6 @@ pub struct LocalUser { /// Whether to show avatars. pub show_avatars: bool, pub send_notifications_to_email: bool, - /// Whether to show comment / post scores. - // TODO now that there is a vote_display_mode, this can be gotten rid of in future releases. - pub show_scores: bool, /// Whether to show bot accounts. pub show_bot_accounts: bool, /// Whether to show read posts. @@ -93,8 +90,6 @@ pub struct LocalUserInsertForm { #[new(default)] pub show_bot_accounts: Option, #[new(default)] - pub show_scores: Option, - #[new(default)] pub show_read_posts: Option, #[new(default)] pub email_verified: Option, @@ -138,7 +133,6 @@ pub struct LocalUserUpdateForm { pub show_avatars: Option, pub send_notifications_to_email: Option, pub show_bot_accounts: Option, - pub show_scores: Option, pub show_read_posts: Option, pub email_verified: Option, pub accepted_application: Option, diff --git a/crates/db_schema/src/source/local_user_vote_display_mode.rs b/crates/db_schema/src/source/local_user_vote_display_mode.rs index 314d99e4a..8c6ad95eb 100644 --- a/crates/db_schema/src/source/local_user_vote_display_mode.rs +++ b/crates/db_schema/src/source/local_user_vote_display_mode.rs @@ -20,6 +20,7 @@ use typed_builder::TypedBuilder; #[cfg_attr(feature = "full", ts(export))] /// The vote display settings for your user. pub struct LocalUserVoteDisplayMode { + #[serde(skip)] pub local_user_id: LocalUserId, pub score: bool, pub upvotes: bool, diff --git a/crates/db_views/src/comment_report_view.rs b/crates/db_views/src/comment_report_view.rs index d7b26a1ed..1866aaee9 100644 --- a/crates/db_views/src/comment_report_view.rs +++ b/crates/db_views/src/comment_report_view.rs @@ -196,7 +196,7 @@ impl CommentReportView { queries().read(pool, (report_id, my_person_id)).await } - /// Returns the current unresolved post report count for the communities you mod + /// Returns the current unresolved comment report count for the communities you mod pub async fn get_report_count( pool: &mut DbPool<'_>, my_person_id: PersonId, diff --git a/crates/db_views/src/registration_application_view.rs b/crates/db_views/src/registration_application_view.rs index 54c7f7598..6f806be13 100644 --- a/crates/db_views/src/registration_application_view.rs +++ b/crates/db_views/src/registration_application_view.rs @@ -252,7 +252,6 @@ mod tests { show_avatars: inserted_sara_local_user.show_avatars, send_notifications_to_email: inserted_sara_local_user.send_notifications_to_email, show_bot_accounts: inserted_sara_local_user.show_bot_accounts, - show_scores: inserted_sara_local_user.show_scores, show_read_posts: inserted_sara_local_user.show_read_posts, email_verified: inserted_sara_local_user.email_verified, accepted_application: inserted_sara_local_user.accepted_application, diff --git a/crates/db_views_actor/src/community_block_view.rs b/crates/db_views_actor/src/community_block_view.rs deleted file mode 100644 index c7d3d1836..000000000 --- a/crates/db_views_actor/src/community_block_view.rs +++ /dev/null @@ -1,24 +0,0 @@ -use crate::structs::CommunityBlockView; -use diesel::{result::Error, ExpressionMethods, QueryDsl}; -use diesel_async::RunQueryDsl; -use lemmy_db_schema::{ - newtypes::PersonId, - schema::{community, community_block, person}, - utils::{get_conn, DbPool}, -}; - -impl CommunityBlockView { - pub async fn for_person(pool: &mut DbPool<'_>, person_id: PersonId) -> Result, Error> { - let conn = &mut get_conn(pool).await?; - community_block::table - .inner_join(person::table) - .inner_join(community::table) - .select((person::all_columns, community::all_columns)) - .filter(community_block::person_id.eq(person_id)) - .filter(community::deleted.eq(false)) - .filter(community::removed.eq(false)) - .order_by(community_block::published) - .load::(conn) - .await - } -} diff --git a/crates/db_views_actor/src/instance_block_view.rs b/crates/db_views_actor/src/instance_block_view.rs deleted file mode 100644 index 05820862a..000000000 --- a/crates/db_views_actor/src/instance_block_view.rs +++ /dev/null @@ -1,27 +0,0 @@ -use crate::structs::InstanceBlockView; -use diesel::{result::Error, ExpressionMethods, JoinOnDsl, NullableExpressionMethods, QueryDsl}; -use diesel_async::RunQueryDsl; -use lemmy_db_schema::{ - newtypes::PersonId, - schema::{instance, instance_block, person, site}, - utils::{get_conn, DbPool}, -}; - -impl InstanceBlockView { - pub async fn for_person(pool: &mut DbPool<'_>, person_id: PersonId) -> Result, Error> { - let conn = &mut get_conn(pool).await?; - instance_block::table - .inner_join(person::table) - .inner_join(instance::table) - .left_join(site::table.on(site::instance_id.eq(instance::id))) - .select(( - person::all_columns, - instance::all_columns, - site::all_columns.nullable(), - )) - .filter(instance_block::person_id.eq(person_id)) - .order_by(instance_block::published) - .load::(conn) - .await - } -} diff --git a/crates/db_views_actor/src/lib.rs b/crates/db_views_actor/src/lib.rs index e9f8e4189..2ec9652e3 100644 --- a/crates/db_views_actor/src/lib.rs +++ b/crates/db_views_actor/src/lib.rs @@ -1,8 +1,6 @@ #[cfg(feature = "full")] pub mod comment_reply_view; #[cfg(feature = "full")] -pub mod community_block_view; -#[cfg(feature = "full")] pub mod community_follower_view; #[cfg(feature = "full")] pub mod community_moderator_view; @@ -11,10 +9,6 @@ pub mod community_person_ban_view; #[cfg(feature = "full")] pub mod community_view; #[cfg(feature = "full")] -pub mod instance_block_view; -#[cfg(feature = "full")] -pub mod person_block_view; -#[cfg(feature = "full")] pub mod person_mention_view; #[cfg(feature = "full")] pub mod person_view; diff --git a/crates/db_views_actor/src/person_block_view.rs b/crates/db_views_actor/src/person_block_view.rs deleted file mode 100644 index 5f028acd8..000000000 --- a/crates/db_views_actor/src/person_block_view.rs +++ /dev/null @@ -1,30 +0,0 @@ -use crate::structs::PersonBlockView; -use diesel::{result::Error, ExpressionMethods, JoinOnDsl, QueryDsl}; -use diesel_async::RunQueryDsl; -use lemmy_db_schema::{ - newtypes::PersonId, - schema::{person, person_block}, - utils::{get_conn, DbPool}, -}; - -impl PersonBlockView { - pub async fn for_person(pool: &mut DbPool<'_>, person_id: PersonId) -> Result, Error> { - let conn = &mut get_conn(pool).await?; - let target_person_alias = diesel::alias!(person as person1); - - person_block::table - .inner_join(person::table.on(person_block::person_id.eq(person::id))) - .inner_join( - target_person_alias.on(person_block::target_id.eq(target_person_alias.field(person::id))), - ) - .select(( - person::all_columns, - target_person_alias.fields(person::all_columns), - )) - .filter(person_block::person_id.eq(person_id)) - .filter(target_person_alias.field(person::deleted).eq(false)) - .order_by(person_block::published) - .load::(conn) - .await - } -} diff --git a/crates/db_views_actor/src/structs.rs b/crates/db_views_actor/src/structs.rs index 2356d2be4..2992d575d 100644 --- a/crates/db_views_actor/src/structs.rs +++ b/crates/db_views_actor/src/structs.rs @@ -6,11 +6,9 @@ use lemmy_db_schema::{ comment::Comment, comment_reply::CommentReply, community::Community, - instance::Instance, person::Person, person_mention::PersonMention, post::Post, - site::Site, }, SubscribedType, }; @@ -19,28 +17,6 @@ use serde_with::skip_serializing_none; #[cfg(feature = "full")] use ts_rs::TS; -#[derive(Debug, Serialize, Deserialize, Clone)] -#[cfg_attr(feature = "full", derive(TS, Queryable))] -#[cfg_attr(feature = "full", diesel(check_for_backend(diesel::pg::Pg)))] -#[cfg_attr(feature = "full", ts(export))] -/// A community block. -pub struct CommunityBlockView { - pub person: Person, - pub community: Community, -} - -#[skip_serializing_none] -#[derive(Debug, Serialize, Deserialize, Clone)] -#[cfg_attr(feature = "full", derive(TS, Queryable))] -#[cfg_attr(feature = "full", diesel(check_for_backend(diesel::pg::Pg)))] -#[cfg_attr(feature = "full", ts(export))] -/// An instance block by a user. -pub struct InstanceBlockView { - pub person: Person, - pub instance: Instance, - pub site: Option, -} - #[derive(Debug, Serialize, Deserialize, Clone)] #[cfg_attr(feature = "full", derive(TS, Queryable))] #[cfg_attr(feature = "full", diesel(check_for_backend(diesel::pg::Pg)))] @@ -83,16 +59,6 @@ pub struct CommunityView { pub banned_from_community: bool, } -#[derive(Debug, Serialize, Deserialize, Clone)] -#[cfg_attr(feature = "full", derive(TS, Queryable))] -#[cfg_attr(feature = "full", diesel(check_for_backend(diesel::pg::Pg)))] -#[cfg_attr(feature = "full", ts(export))] -/// A person block. -pub struct PersonBlockView { - pub person: Person, - pub target: Person, -} - #[skip_serializing_none] #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] #[cfg_attr(feature = "full", derive(TS, Queryable))] diff --git a/crates/federate/Cargo.toml b/crates/federate/Cargo.toml index 6b76dbf97..5d7454276 100644 --- a/crates/federate/Cargo.toml +++ b/crates/federate/Cargo.toml @@ -32,7 +32,7 @@ serde_json.workspace = true tokio = { workspace = true, features = ["full"] } tracing.workspace = true moka.workspace = true -tokio-util = "0.7.11" +tokio-util = "0.7.12" async-trait.workspace = true [dev-dependencies] diff --git a/crates/federate/src/worker.rs b/crates/federate/src/worker.rs index f6e70d846..6c83aaa21 100644 --- a/crates/federate/src/worker.rs +++ b/crates/federate/src/worker.rs @@ -459,7 +459,6 @@ mod test { traits::Crud, }; use lemmy_utils::error::LemmyResult; - use reqwest::StatusCode; use serde_json::{json, Value}; use serial_test::serial; use test_context::{test_context, AsyncTestContext}; @@ -688,7 +687,7 @@ mod test { |inbox_sender: actix_web::web::Data>, body: String| async move { tracing::debug!("received activity: {:?}", body); inbox_sender.send(body.clone()).unwrap(); - HttpResponse::new(StatusCode::OK) + HttpResponse::new(actix_web::http::StatusCode::OK) }, ), ) diff --git a/crates/routes/Cargo.toml b/crates/routes/Cargo.toml index a614ba42d..4a8c53dea 100644 --- a/crates/routes/Cargo.toml +++ b/crates/routes/Cargo.toml @@ -32,5 +32,5 @@ serde = { workspace = true } url = { workspace = true } tracing = { workspace = true } tokio = { workspace = true } -urlencoding = { workspace = true } -rss = "2.0.8" +http.workspace = true +rss = "2.0.9" diff --git a/crates/routes/src/images.rs b/crates/routes/src/images.rs index 10ffb57de..768a607c2 100644 --- a/crates/routes/src/images.rs +++ b/crates/routes/src/images.rs @@ -2,6 +2,7 @@ use actix_web::{ body::BodyStream, http::{ header::{HeaderName, ACCEPT_ENCODING, HOST}, + Method, StatusCode, }, web, @@ -10,6 +11,7 @@ use actix_web::{ HttpResponse, }; use futures::stream::{Stream, StreamExt}; +use http::HeaderValue; use lemmy_api_common::{context::LemmyContext, request::PictrsResponse}; use lemmy_db_schema::source::{ images::{LocalImage, LocalImageForm, RemoteImage}, @@ -22,7 +24,6 @@ use reqwest_middleware::{ClientWithMiddleware, RequestBuilder}; use serde::Deserialize; use std::time::Duration; use url::Url; -use urlencoding::decode; pub fn config( cfg: &mut web::ServiceConfig, @@ -110,7 +111,7 @@ fn adapt_request( const INVALID_HEADERS: &[HeaderName] = &[ACCEPT_ENCODING, HOST]; let client_request = client - .request(request.method().clone(), url) + .request(convert_method(request.method()), url) .timeout(REQWEST_TIMEOUT); request @@ -120,7 +121,8 @@ fn adapt_request( if INVALID_HEADERS.contains(key) { client_req } else { - client_req.header(key, value) + // TODO: remove as_str and as_bytes conversions after actix-web upgrades to http 1.0 + client_req.header(key.as_str(), value.as_bytes()) } }) } @@ -167,7 +169,7 @@ async fn upload( } } - Ok(HttpResponse::build(status).json(images)) + Ok(HttpResponse::build(convert_status(status)).json(images)) } async fn full_res( @@ -210,14 +212,14 @@ async fn image( let res = client_req.send().await?; - if res.status() == StatusCode::NOT_FOUND { + if res.status() == http::StatusCode::NOT_FOUND { return Ok(HttpResponse::NotFound().finish()); } - let mut client_res = HttpResponse::build(res.status()); + let mut client_res = HttpResponse::build(StatusCode::from_u16(res.status().as_u16())?); for (name, value) in res.headers().iter().filter(|(h, _)| *h != "connection") { - client_res.insert_header((name.clone(), value.clone())); + client_res.insert_header(convert_header(name, value)); } Ok(client_res.body(BodyStream::new(res.bytes_stream()))) @@ -246,7 +248,7 @@ async fn delete( LocalImage::delete_by_alias(&mut context.pool(), &file).await?; - Ok(HttpResponse::build(res.status()).body(BodyStream::new(res.bytes_stream()))) + Ok(HttpResponse::build(convert_status(res.status())).body(BodyStream::new(res.bytes_stream()))) } pub async fn image_proxy( @@ -255,7 +257,7 @@ pub async fn image_proxy( client: web::Data, context: web::Data, ) -> LemmyResult { - let url = Url::parse(&decode(¶ms.url)?)?; + let url = Url::parse(¶ms.url)?; // Check that url corresponds to a federated image so that this can't be abused as a proxy // for arbitrary purposes. @@ -309,3 +311,14 @@ where std::pin::Pin::new(&mut self.rx).poll_recv(cx) } } + +// TODO: remove these conversions after actix-web upgrades to http 1.0 +fn convert_status(status: http::StatusCode) -> StatusCode { + StatusCode::from_u16(status.as_u16()).expect("status can be converted") +} +fn convert_method(method: &Method) -> http::Method { + http::Method::from_bytes(method.as_str().as_bytes()).expect("method can be converted") +} +fn convert_header<'a>(name: &'a http::HeaderName, value: &'a HeaderValue) -> (&'a str, &'a [u8]) { + (name.as_str(), value.as_bytes()) +} diff --git a/crates/routes/src/webfinger.rs b/crates/routes/src/webfinger.rs index f2a67c0fc..c5b7024cd 100644 --- a/crates/routes/src/webfinger.rs +++ b/crates/routes/src/webfinger.rs @@ -84,7 +84,7 @@ async fn get_webfinger_response( Ok( HttpResponse::Ok() - .content_type(&WEBFINGER_CONTENT_TYPE) + .content_type(WEBFINGER_CONTENT_TYPE.as_bytes()) .json(json), ) } diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml index e94fce9d6..a556ef49c 100644 --- a/crates/utils/Cargo.toml +++ b/crates/utils/Cargo.toml @@ -32,7 +32,6 @@ full = [ "dep:actix-web", "dep:serde_json", "dep:anyhow", - "dep:tracing-error", "dep:http", "dep:deser-hjson", "dep:regex", @@ -53,7 +52,6 @@ full = [ [dependencies] regex = { workspace = true, optional = true } tracing = { workspace = true, optional = true } -tracing-error = { workspace = true, optional = true } itertools = { workspace = true, optional = true } serde = { workspace = true } serde_json = { workspace = true, optional = true } @@ -73,7 +71,7 @@ urlencoding = { workspace = true, optional = true } html2text = { version = "0.12.5", optional = true } deser-hjson = { version = "2.2.4", optional = true } smart-default = { version = "0.7.1", optional = true } -lettre = { version = "0.11.7", default-features = false, features = [ +lettre = { version = "0.11.8", default-features = false, features = [ "builder", "tokio1", "tokio1-rustls-tls", diff --git a/crates/utils/src/error.rs b/crates/utils/src/error.rs index 860dad6fd..4e634bde3 100644 --- a/crates/utils/src/error.rs +++ b/crates/utils/src/error.rs @@ -1,6 +1,6 @@ use cfg_if::cfg_if; use serde::{Deserialize, Serialize}; -use std::fmt::Debug; +use std::{backtrace::Backtrace, fmt::Debug}; use strum::{Display, EnumIter}; #[derive(Display, Debug, Serialize, Deserialize, Clone, PartialEq, Eq, EnumIter, Hash)] @@ -186,14 +186,13 @@ pub enum LemmyErrorType { cfg_if! { if #[cfg(feature = "full")] { - use tracing_error::SpanTrace; use std::fmt; pub type LemmyResult = Result; pub struct LemmyError { pub error_type: LemmyErrorType, pub inner: anyhow::Error, - pub context: SpanTrace, + pub context: Backtrace, } /// Maximum number of items in an array passed as API parameter. See [[LemmyErrorType::TooManyItems]] @@ -208,7 +207,7 @@ cfg_if! { LemmyError { error_type: LemmyErrorType::Unknown(format!("{}", &cause)), inner: cause, - context: SpanTrace::capture(), + context: Backtrace::capture(), } } } @@ -232,13 +231,13 @@ cfg_if! { } impl actix_web::error::ResponseError for LemmyError { - fn status_code(&self) -> http::StatusCode { + fn status_code(&self) -> actix_web::http::StatusCode { if self.error_type == LemmyErrorType::IncorrectLogin { - return http::StatusCode::UNAUTHORIZED; + return actix_web::http::StatusCode::UNAUTHORIZED; } match self.inner.downcast_ref::() { - Some(diesel::result::Error::NotFound) => http::StatusCode::NOT_FOUND, - _ => http::StatusCode::BAD_REQUEST, + Some(diesel::result::Error::NotFound) => actix_web::http::StatusCode::NOT_FOUND, + _ => actix_web::http::StatusCode::BAD_REQUEST, } } @@ -253,7 +252,7 @@ cfg_if! { LemmyError { error_type, inner, - context: SpanTrace::capture(), + context: Backtrace::capture(), } } } @@ -267,7 +266,7 @@ cfg_if! { self.map_err(|error| LemmyError { error_type, inner: error.into(), - context: SpanTrace::capture(), + context: Backtrace::capture(), }) } } diff --git a/crates/utils/src/response.rs b/crates/utils/src/response.rs index 82b1e70ed..f37c15dd7 100644 --- a/crates/utils/src/response.rs +++ b/crates/utils/src/response.rs @@ -37,6 +37,7 @@ mod tests { use crate::error::{LemmyError, LemmyErrorType}; use actix_web::{ error::ErrorInternalServerError, + http::StatusCode, middleware::ErrorHandlers, test, web, @@ -45,7 +46,6 @@ mod tests { Handler, Responder, }; - use http::StatusCode; use pretty_assertions::assert_eq; #[actix_web::test] diff --git a/crates/utils/src/utils/validation.rs b/crates/utils/src/utils/validation.rs index 0a59e2fea..c35eac7bf 100644 --- a/crates/utils/src/utils/validation.rs +++ b/crates/utils/src/utils/validation.rs @@ -20,7 +20,7 @@ const ALLOWED_POST_URL_SCHEMES: [&str; 3] = ["http", "https", "magnet"]; const BODY_MAX_LENGTH: usize = 10000; const POST_BODY_MAX_LENGTH: usize = 50000; -const BIO_MAX_LENGTH: usize = 300; +const BIO_MAX_LENGTH: usize = 1000; const URL_MAX_LENGTH: usize = 2000; const ALT_TEXT_MAX_LENGTH: usize = 1500; const SITE_NAME_MAX_LENGTH: usize = 20; diff --git a/crates/utils/translations b/crates/utils/translations index 179f68843..7adddded5 160000 --- a/crates/utils/translations +++ b/crates/utils/translations @@ -1 +1 @@ -Subproject commit 179f6884398d3536d16382df5dc40da4e47835aa +Subproject commit 7adddded581fcd965ab33b91c5fe10e0d7247208 diff --git a/migrations/2024-03-04-143245_remove_show_scores_column/down.sql b/migrations/2024-03-04-143245_remove_show_scores_column/down.sql new file mode 100644 index 000000000..5669e96bd --- /dev/null +++ b/migrations/2024-03-04-143245_remove_show_scores_column/down.sql @@ -0,0 +1,3 @@ +ALTER TABLE local_user + ADD COLUMN show_scores boolean NOT NULL DEFAULT TRUE; + diff --git a/migrations/2024-03-04-143245_remove_show_scores_column/up.sql b/migrations/2024-03-04-143245_remove_show_scores_column/up.sql new file mode 100644 index 000000000..20fc01c4e --- /dev/null +++ b/migrations/2024-03-04-143245_remove_show_scores_column/up.sql @@ -0,0 +1,3 @@ +ALTER TABLE local_user + DROP COLUMN show_scores; + diff --git a/scripts/db_perf.sh b/scripts/db_perf.sh index ef4b2751a..1d53e0d37 100755 --- a/scripts/db_perf.sh +++ b/scripts/db_perf.sh @@ -6,7 +6,7 @@ set -e CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" -cd $CWD/../ +cd "$CWD/../" source scripts/start_dev_db.sh diff --git a/scripts/dump_schema.sh b/scripts/dump_schema.sh index f783be26b..c32cf20e5 100755 --- a/scripts/dump_schema.sh +++ b/scripts/dump_schema.sh @@ -5,7 +5,7 @@ set -e CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" -cd $CWD/../ +cd "$CWD/../" source scripts/start_dev_db.sh diff --git a/scripts/lint.sh b/scripts/lint.sh index 20d89acb4..c9f0f5dd7 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -3,7 +3,7 @@ set -e CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" -cd $CWD/../ +cd "$CWD/../" # Format rust files cargo +nightly fmt diff --git a/scripts/release.sh b/scripts/release.sh index 1cf7b168a..79209f3b4 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -8,7 +8,7 @@ third_semver=$(echo $new_tag | cut -d "." -f 3) # Goto the upper route CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" -cd $CWD/../ +cd "$CWD/../" # The docker installs should only update for non release-candidates # IE, when the third semver is a number, not '2-rc' diff --git a/scripts/sql_format_check.sh b/scripts/sql_format_check.sh index fabc3b3ed..3a2710b84 100755 --- a/scripts/sql_format_check.sh +++ b/scripts/sql_format_check.sh @@ -5,7 +5,7 @@ set -e CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" -cd $CWD/../ +cd "$CWD/../" # Copy the files to a temp dir TMP_DIR=$(mktemp -d) diff --git a/scripts/test-with-coverage.sh b/scripts/test-with-coverage.sh index e4dfcddf8..7a4905b8e 100755 --- a/scripts/test-with-coverage.sh +++ b/scripts/test-with-coverage.sh @@ -3,7 +3,7 @@ set -e CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" -cd $CWD/../ +cd "$CWD/../" PACKAGE="$1" echo "$PACKAGE" diff --git a/scripts/test.sh b/scripts/test.sh index 04cc94f9d..e08148db0 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -3,7 +3,7 @@ set -e CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" -cd $CWD/../ +cd "$CWD/../" PACKAGE="$1" TEST="$2" diff --git a/src/lib.rs b/src/lib.rs index 3c3633b75..da14e5cd8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,17 +1,10 @@ pub mod api_routes_http; pub mod code_migrations; pub mod prometheus_metrics; -pub mod root_span_builder; pub mod scheduled_tasks; pub mod session_middleware; -#[cfg(feature = "console")] -pub mod telemetry; -use crate::{ - code_migrations::run_advanced_migrations, - root_span_builder::QuieterRootSpanBuilder, - session_middleware::SessionMiddleware, -}; +use crate::{code_migrations::run_advanced_migrations, session_middleware::SessionMiddleware}; use activitypub_federation::config::{FederationConfig, FederationMiddleware}; use actix_cors::Cors; use actix_web::{ @@ -55,14 +48,9 @@ use prometheus_metrics::serve_prometheus; use reqwest_middleware::ClientBuilder; use reqwest_tracing::TracingMiddleware; use serde_json::json; -use std::{env, ops::Deref, time::Duration}; +use std::{ops::Deref, time::Duration}; use tokio::signal::unix::SignalKind; -use tracing::subscriber::set_global_default; -use tracing_actix_web::TracingLogger; -use tracing_error::ErrorLayer; -use tracing_log::LogTracer; -use tracing_subscriber::{filter::Targets, layer::SubscriberExt, Layer, Registry}; -use url::Url; +use tracing_actix_web::{DefaultRootSpanBuilder, TracingLogger}; /// Timeout for HTTP requests while sending activities. A longer timeout provides better /// compatibility with other ActivityPub software that might allocate more time for synchronous @@ -119,7 +107,7 @@ pub struct CmdArgs { /// Placing the main function in lib.rs allows other crates to import it and embed Lemmy pub async fn start_lemmy_server(args: CmdArgs) -> LemmyResult<()> { // Print version number to log - println!("Lemmy v{VERSION}"); + println!("Starting Lemmy v{VERSION}"); // return error 503 while running db migrations and startup tasks let mut startup_server_handle = None; @@ -318,7 +306,7 @@ fn create_http_server( )) .wrap(middleware::Compress::default()) .wrap(cors_config) - .wrap(TracingLogger::::new()) + .wrap(TracingLogger::::new()) .wrap(ErrorHandlers::new().default_handler(jsonify_plain_text_errors)) .app_data(Data::new(context.clone())) .app_data(Data::new(rate_limit_cell.clone())) @@ -373,38 +361,3 @@ fn cors_config(settings: &Settings) -> Cors { .max_age(3600), } } - -pub fn init_logging(opentelemetry_url: &Option) -> LemmyResult<()> { - LogTracer::init()?; - - let log_description = env::var("RUST_LOG").unwrap_or_else(|_| "info".into()); - - let targets = log_description - .trim() - .trim_matches('"') - .parse::()?; - - let format_layer = { - #[cfg(feature = "json-log")] - let layer = tracing_subscriber::fmt::layer().with_ansi(false).json(); - #[cfg(not(feature = "json-log"))] - let layer = tracing_subscriber::fmt::layer().with_ansi(false); - - layer.with_filter(targets.clone()) - }; - - let subscriber = Registry::default() - .with(format_layer) - .with(ErrorLayer::default()); - - if let Some(_url) = opentelemetry_url { - #[cfg(feature = "console")] - telemetry::init_tracing(_url.as_ref(), subscriber, targets)?; - #[cfg(not(feature = "console"))] - tracing::error!("Feature `console` must be enabled for opentelemetry tracing"); - } else { - set_global_default(subscriber)?; - } - - Ok(()) -} diff --git a/src/main.rs b/src/main.rs index d7244d2d6..79504f509 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,18 @@ use clap::Parser; -use lemmy_server::{init_logging, start_lemmy_server, CmdArgs}; -use lemmy_utils::{error::LemmyResult, settings::SETTINGS}; +use lemmy_server::{start_lemmy_server, CmdArgs}; +use lemmy_utils::error::LemmyResult; +use tracing::level_filters::LevelFilter; +use tracing_subscriber::EnvFilter; pub extern crate rustls; #[tokio::main] pub async fn main() -> LemmyResult<()> { - init_logging(&SETTINGS.opentelemetry_url)?; + let filter = EnvFilter::builder() + .with_default_directive(LevelFilter::INFO.into()) + .from_env_lossy(); + tracing_subscriber::fmt().with_env_filter(filter).init(); + let args = CmdArgs::parse(); rustls::crypto::ring::default_provider() diff --git a/src/root_span_builder.rs b/src/root_span_builder.rs deleted file mode 100644 index 09ce2544e..000000000 --- a/src/root_span_builder.rs +++ /dev/null @@ -1,83 +0,0 @@ -use actix_web::{http::StatusCode, ResponseError}; -use tracing::Span; -use tracing_actix_web::RootSpanBuilder; - -// Code in this module adapted from DefaultRootSpanBuilder -// https://github.com/LukeMathWalker/tracing-actix-web/blob/main/src/root_span_builder.rs -// and root_span! -// https://github.com/LukeMathWalker/tracing-actix-web/blob/main/src/root_span_macro.rs - -pub struct QuieterRootSpanBuilder; - -impl RootSpanBuilder for QuieterRootSpanBuilder { - fn on_request_start(request: &actix_web::dev::ServiceRequest) -> Span { - let request_id = tracing_actix_web::root_span_macro::private::get_request_id(request); - - tracing::info_span!( - "HTTP request", - http.method = %request.method(), - http.scheme = request.connection_info().scheme(), - http.host = %request.connection_info().host(), - http.target = %request.uri().path(), - http.status_code = tracing::field::Empty, - otel.kind = "server", - otel.status_code = tracing::field::Empty, - trace_id = tracing::field::Empty, - request_id = %request_id, - exception.message = tracing::field::Empty, - // Not proper OpenTelemetry, but their terminology is fairly exception-centric - exception.details = tracing::field::Empty, - ) - } - - fn on_request_end( - span: tracing::Span, - outcome: &Result, actix_web::Error>, - ) { - match &outcome { - Ok(response) => { - if let Some(error) = response.response().error() { - // use the status code already constructed for the outgoing HTTP response - handle_error(span, response.status(), error.as_response_error()); - } else { - let code: i32 = response.response().status().as_u16().into(); - span.record("http.status_code", code); - span.record("otel.status_code", "OK"); - } - } - Err(error) => { - let response_error = error.as_response_error(); - handle_error(span, response_error.status_code(), response_error); - } - }; - } -} - -fn handle_error(span: Span, status_code: StatusCode, response_error: &dyn ResponseError) { - let code: i32 = status_code.as_u16().into(); - - span.record("http.status_code", code); - - if status_code.is_client_error() { - span.record("otel.status_code", "OK"); - } else { - span.record("otel.status_code", "ERROR"); - } - - // pre-formatting errors is a workaround for https://github.com/tokio-rs/tracing/issues/1565 - let display_error = format!("{response_error}"); - - tracing::info_span!( - parent: None, - "Error encountered while processing the incoming HTTP request" - ) - .in_scope(|| { - if status_code.is_client_error() { - tracing::warn!("{}", display_error); - } else { - tracing::error!("{}", display_error); - } - }); - - span.record("exception.message", tracing::field::display(display_error)); -} diff --git a/src/session_middleware.rs b/src/session_middleware.rs index a72d84920..b23f8644e 100644 --- a/src/session_middleware.rs +++ b/src/session_middleware.rs @@ -1,7 +1,7 @@ use actix_web::{ body::MessageBody, dev::{forward_ready, Service, ServiceRequest, ServiceResponse, Transform}, - http::header::CACHE_CONTROL, + http::header::{HeaderValue, CACHE_CONTROL}, Error, HttpMessage, }; @@ -9,7 +9,6 @@ use core::future::Ready; use futures_util::future::LocalBoxFuture; use lemmy_api::{local_user_view_from_jwt, read_auth_token}; use lemmy_api_common::context::LemmyContext; -use reqwest::header::HeaderValue; use std::{future::ready, rc::Rc}; #[derive(Clone)] diff --git a/src/telemetry.rs b/src/telemetry.rs deleted file mode 100644 index a7a1ac809..000000000 --- a/src/telemetry.rs +++ /dev/null @@ -1,47 +0,0 @@ -use console_subscriber::ConsoleLayer; -use lemmy_utils::error::LemmyResult; -use opentelemetry::{ - sdk::{propagation::TraceContextPropagator, Resource}, - KeyValue, -}; -use opentelemetry_otlp::WithExportConfig; -use tracing::{subscriber::set_global_default, Subscriber}; -use tracing_subscriber::{filter::Targets, layer::SubscriberExt, registry::LookupSpan, Layer}; - -pub fn init_tracing(opentelemetry_url: &str, subscriber: S, targets: Targets) -> LemmyResult<()> -where - S: Subscriber + for<'a> LookupSpan<'a> + Send + Sync + 'static, -{ - opentelemetry::global::set_text_map_propagator(TraceContextPropagator::new()); - - let console_layer = ConsoleLayer::builder() - .with_default_env() - .server_addr(([0, 0, 0, 0], 6669)) - .event_buffer_capacity(1024 * 1024) - .spawn(); - - let subscriber = subscriber.with(console_layer); - - let tracer = opentelemetry_otlp::new_pipeline() - .tracing() - .with_trace_config( - opentelemetry::sdk::trace::config() - .with_resource(Resource::new(vec![KeyValue::new("service.name", "lemmy")])), - ) - .with_exporter( - opentelemetry_otlp::new_exporter() - .tonic() - .with_endpoint(opentelemetry_url), - ) - .install_batch(opentelemetry::runtime::Tokio)?; - - let otel_layer = tracing_opentelemetry::layer() - .with_tracer(tracer) - .with_filter(targets); - - let subscriber = subscriber.with(otel_layer); - - set_global_default(subscriber)?; - - Ok(()) -}