diff --git a/Cargo.lock b/Cargo.lock index 915f9f51e..2de97c227 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,8 +10,8 @@ checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" [[package]] name = "activitypub_federation" -version = "0.4.6" -source = "git+https://github.com/phiresky/activitypub-federation-rust/?branch=raw-sending#76519bd094603b410ac939ffe64c19d34fd6121f" +version = "0.5.0-beta.1" +source = "git+https://github.com/phiresky/activitypub-federation-rust/?branch=raw-sending#da191f48bb2c1fcc3a8cc3d3f566182035ae25b1" dependencies = [ "activitystreams-kinds", "actix-web", @@ -58,19 +58,19 @@ dependencies = [ [[package]] name = "actix-codec" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe" +checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8" dependencies = [ "bitflags 1.3.2", "bytes", "futures-core", "futures-sink", - "log", "memchr", "pin-project-lite", "tokio", "tokio-util", + "tracing", ] [[package]] @@ -90,14 +90,14 @@ dependencies = [ [[package]] name = "actix-form-data" -version = "0.7.0-beta.2" +version = "0.7.0-beta.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2c32091d556a5064062087511db68526848dfa3de83c5262156431d27df7a4" +checksum = "a2163627f82eef55c4551f3e58ba0da92d733fa3afe8d0c13986a9ba00d1f9f7" dependencies = [ "actix-multipart", "actix-rt", "actix-web", - "futures-util", + "futures-core", "mime", "thiserror", "tokio", @@ -146,12 +146,12 @@ dependencies = [ [[package]] name = "actix-macros" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 1.0.103", + "syn 2.0.29", ] [[package]] @@ -203,9 +203,9 @@ dependencies = [ [[package]] name = "actix-server" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da34f8e659ea1b077bb4637948b815cd3768ad5a188fdcd74ff4d84240cd824" +checksum = "3e8613a75dd50cc45f473cee3c34d59ed677c0f7b44480ce3b8247d7dc519327" dependencies = [ "actix-rt", "actix-service", @@ -241,12 +241,11 @@ dependencies = [ "actix-service", "actix-utils", "futures-core", - "http", "log", "pin-project-lite", "tokio-rustls 0.23.4", "tokio-util", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] @@ -297,7 +296,7 @@ dependencies = [ "serde_urlencoded", "smallvec", "socket2 0.4.9", - "time 0.3.15", + "time 0.3.27", "url", ] @@ -310,7 +309,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] @@ -327,9 +326,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -365,9 +364,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" dependencies = [ "memchr", ] @@ -432,9 +431,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" [[package]] name = "anstyle-parse" @@ -456,9 +455,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -466,9 +465,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" dependencies = [ "backtrace", ] @@ -516,7 +515,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.22", + "rustix 0.37.23", "slab", "socket2 0.4.9", "waker-fn", @@ -524,56 +523,57 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener", ] [[package]] name = "async-stream" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", + "pin-project-lite", ] [[package]] name = "async-stream-impl" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.29", ] [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] name = "atom_syndication" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca96cb38e3d8236f1573a84bbc55e130bd1ae07df770e36d0cf221ea7a50e36c" +checksum = "571832dcff775e26562e8e6930cd483de5587301d40d3a3b85d532b6383e15a7" dependencies = [ "chrono", "derive_builder", "diligent-date-parser", "never", - "quick-xml 0.28.2", + "quick-xml 0.30.0", ] [[package]] @@ -582,77 +582,14 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "awc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80ca7ff88063086d2e2c70b9f3b29b2fcd999bac68ac21731e66781970d68519" -dependencies = [ - "actix-codec", - "actix-http", - "actix-rt", - "actix-service", - "actix-tls", - "actix-utils", - "ahash 0.7.6", - "base64 0.13.1", - "bytes", - "cfg-if", - "derive_more", - "futures-core", - "futures-util", - "h2", - "http", - "itoa", - "log", - "mime", - "percent-encoding", - "pin-project-lite", - "rand", - "rustls 0.20.7", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", -] - -[[package]] -name = "axum" -version = "0.5.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" -dependencies = [ - "async-trait", - "axum-core 0.2.9", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http", - "http-body", - "hyper", - "itoa", - "matchit 0.5.0", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "serde", - "sync_wrapper", - "tokio", - "tower", - "tower-http", - "tower-layer", - "tower-service", -] - [[package]] name = "axum" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8175979259124331c1d7bf6586ee7e0da434155e4b2d48ec2c8386281d8df39" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core 0.3.4", + "axum-core", "bitflags 1.3.2", "bytes", "futures-util", @@ -660,7 +597,7 @@ dependencies = [ "http-body", "hyper", "itoa", - "matchit 0.7.0", + "matchit", "memchr", "mime", "percent-encoding", @@ -673,22 +610,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "axum-core" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e5939e02c56fecd5c017c37df4238c0a839fa76b7f97acdd7efb804fd181cc" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "mime", - "tower-layer", - "tower-service", -] - [[package]] name = "axum-core" version = "0.3.4" @@ -708,15 +629,15 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide 0.6.2", + "miniz_oxide", "object", "rustc-demangle", ] @@ -784,15 +705,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] @@ -830,9 +751,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "bytecount" @@ -842,9 +763,9 @@ checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" [[package]] name = "bytemuck" -version = "1.12.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" [[package]] name = "byteorder" @@ -860,18 +781,18 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "bytestring" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b6a75fd3048808ef06af5cd79712be8111960adaf89d90250974b38fc3928a" +checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" dependencies = [ "bytes", ] [[package]] name = "camino" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] @@ -892,9 +813,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ "serde", ] @@ -914,11 +835,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.73" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -944,16 +866,16 @@ dependencies = [ "js-sys", "num-traits", "serde", - "time 0.1.44", + "time 0.1.45", "wasm-bindgen", "winapi", ] [[package]] name = "cipher" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", @@ -961,9 +883,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.19" +version = "4.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" +checksum = "fb690e81c7840c0d7aade59f242ea3b41b9bc27bcd5997890e7702ae4b32e487" dependencies = [ "clap_builder", "clap_derive", @@ -972,9 +894,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.19" +version = "4.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" +checksum = "5ed2e96bc16d8d740f6f48d663eddf4b8a0983e79210fd55479b7bcd0a69860e" dependencies = [ "anstream", "anstyle", @@ -991,7 +913,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -1009,16 +931,6 @@ dependencies = [ "chrono", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "color-eyre" version = "0.6.2" @@ -1092,7 +1004,7 @@ dependencies = [ "rust-ini", "serde", "serde_json", - "toml 0.5.9", + "toml 0.5.11", "yaml-rust", ] @@ -1154,9 +1066,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" [[package]] name = "convert_case" @@ -1171,7 +1083,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" dependencies = [ "percent-encoding", - "time 0.3.15", + "time 0.3.27", "version_check", ] @@ -1187,15 +1099,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -1221,9 +1133,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", @@ -1234,9 +1146,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.12" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -1251,50 +1163,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "cxx" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 1.0.103", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.103", -] - [[package]] name = "darling" version = "0.13.4" @@ -1307,22 +1175,22 @@ dependencies = [ [[package]] name = "darling" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4529658bdda7fd6769b8614be250cdcfc3aeb0ee72fe66f9e41e5e5eb73eac02" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ - "darling_core 0.14.1", - "darling_macro 0.14.1", + "darling_core 0.14.4", + "darling_macro 0.14.4", ] [[package]] name = "darling" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.1", - "darling_macro 0.20.1", + "darling_core 0.20.3", + "darling_macro 0.20.3", ] [[package]] @@ -1336,35 +1204,35 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] name = "darling_core" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "649c91bc01e8b1eac09fb91e8dbc7d517684ca6be8ebc75bb9cafc894f9fdb6f" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] name = "darling_core" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -1375,36 +1243,36 @@ checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core 0.13.4", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] name = "darling_macro" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc69c5bfcbd2fc09a0f38451d2daf0e372e367986a83906d1b0dbc88134fb5" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ - "darling_core 0.14.1", + "darling_core 0.14.4", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] name = "darling_macro" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.1", + "darling_core 0.20.3", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] name = "dashmap" -version = "5.5.0" +version = "5.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6943ae99c34386c84a470c499d3414f66502a41340aa895406e0d2e4a207b91d" +checksum = "edd72493923899c6f10c641bdbdeddc7183d6396641d99c1a0d1597f37f92e28" dependencies = [ "cfg-if", "hashbrown 0.14.0", @@ -1435,6 +1303,15 @@ dependencies = [ "tokio", ] +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +dependencies = [ + "serde", +] + [[package]] name = "derivative" version = "2.2.0" @@ -1443,7 +1320,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] @@ -1461,10 +1338,10 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" dependencies = [ - "darling 0.14.1", + "darling 0.14.4", "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] @@ -1474,7 +1351,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ "derive_builder_core", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] @@ -1487,7 +1364,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] @@ -1505,7 +1382,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7a532c1f99a0f596f6960a60d1e119e91582b24b39e2d83a190e61262c3ef0c" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "byteorder", "chrono", "diesel_derives", @@ -1517,9 +1394,9 @@ dependencies = [ [[package]] name = "diesel-async" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40df24b390b2437af8b934b39acd277c246a08004afb91b8ccbe3137ffd4edc" +checksum = "c7e7974099f0d9bde0e010dd3a673555276a474f3362a7a52ab535a57b7c5056" dependencies = [ "async-trait", "deadpool", @@ -1539,7 +1416,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -1550,7 +1427,7 @@ checksum = "c7267437d5b12df60ae29bd97f8d120f1c3a6272d6f213551afa56bbb2ecfbb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -1562,7 +1439,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -1592,7 +1469,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -1608,9 +1485,9 @@ dependencies = [ [[package]] name = "diligent-date-parser" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d0fd95c7c02e2d6c588c6c5628466fff9bdde4b8c6196465e087b08e792720" +checksum = "f6cf7fe294274a222363f84bcb63cdea762979a0443b4cf1f4f8fd17c86b1182" dependencies = [ "chrono", ] @@ -1642,7 +1519,7 @@ dependencies = [ "darling 0.13.4", "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] @@ -1653,15 +1530,15 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "either" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elementtree" @@ -1684,9 +1561,9 @@ dependencies = [ [[package]] name = "email_address" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1b32a7a2580c4473f10f66b512c34bdd7d33c5e3473227ca833abdb5afe4809" +checksum = "e2153bd83ebc09db15bcbdc3e2194d901804952e3dc96967e1cd3b0c5c32d112" [[package]] name = "encoding" @@ -1754,9 +1631,9 @@ checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1769,22 +1646,22 @@ checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" [[package]] name = "enum-map" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "017b207acb4cc917f4c31758ed95c0bc63ddb0f358b22eb38f80a2b2a43f6b1f" +checksum = "9705d8de4776df900a4a0b2384f8b0ab42f775e93b083b42f8ce71bdc32a47e3" dependencies = [ "enum-map-derive", ] [[package]] name = "enum-map-derive" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8560b409800a72d2d7860f8e5f4e0b0bd22bea6a352ea2a9ce30ccdef7f16d2f" +checksum = "ccb14d927583dd5c2eac0f2cf264fc4762aefe1ae14c47a8a20fc1939d3a5fc0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -1796,7 +1673,7 @@ dependencies = [ "enum_delegate_lib", "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] @@ -1808,31 +1685,20 @@ dependencies = [ "proc-macro2", "quote", "rand", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] name = "equivalent" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" - -[[package]] -name = "errno" -version = "0.2.8" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", @@ -1882,18 +1748,18 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fallible_collections" -version = "0.4.5" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c195cf4b2285d3c993eb887b4dc56b0d5728bbe1d0f9a99c0ac6bec2da3e4d85" +checksum = "a88c69768c0a15262df21899142bc6df9b9b823546d4b4b9a7bc2d6c448ec6fd" dependencies = [ - "hashbrown 0.12.3", + "hashbrown 0.13.2", ] [[package]] name = "fancy-regex" -version = "0.7.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6b8560a05112eb52f04b00e5d3790c0dd75d9d980eb8a122fb23b92a623ccf" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" dependencies = [ "bit-set", "regex", @@ -1901,21 +1767,36 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "fdeflate" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +dependencies = [ + "simd-adler32", +] + [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", - "miniz_oxide 0.5.4", + "miniz_oxide", ] [[package]] @@ -2022,7 +1903,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -2039,7 +1920,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -2083,9 +1964,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -2106,9 +1987,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glob" @@ -2118,9 +1999,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.14" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -2128,7 +2009,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.1", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -2150,6 +2031,15 @@ dependencies = [ "ahash 0.7.6", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] + [[package]] name = "hashbrown" version = "0.14.0" @@ -2175,15 +2065,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.2" @@ -2269,7 +2150,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] @@ -2294,12 +2175,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" - [[package]] name = "http-signature-normalization" version = "0.7.0" @@ -2333,9 +2208,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -2345,9 +2220,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -2367,6 +2242,20 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls 0.21.6", + "tokio", + "tokio-rustls 0.24.1", +] + [[package]] name = "hyper-timeout" version = "0.4.1" @@ -2394,26 +2283,25 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.51" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -2444,9 +2332,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.4" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd8e4fb07cf672b1642304e731ef8a6a4c7891d67bb4fd4f5ce58cd6ed86803c" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" dependencies = [ "bytemuck", "byteorder", @@ -2464,9 +2352,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "1.9.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -2481,6 +2369,7 @@ checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", "hashbrown 0.14.0", + "serde", ] [[package]] @@ -2507,16 +2396,16 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi", "libc", "windows-sys 0.48.0", ] [[package]] name = "ipnet" -version = "2.5.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" @@ -2524,8 +2413,8 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.3", + "hermit-abi", + "rustix 0.38.8", "windows-sys 0.48.0", ] @@ -2549,9 +2438,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jni" @@ -2584,9 +2473,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -2767,7 +2656,7 @@ dependencies = [ "lemmy_utils", "once_cell", "regex", - "rustls 0.21.3", + "rustls 0.21.6", "serde", "serde_json", "serde_with", @@ -2913,7 +2802,7 @@ dependencies = [ "reqwest", "reqwest-middleware", "reqwest-tracing", - "rustls 0.21.3", + "rustls 0.21.6", "serde", "serde_json", "tokio", @@ -2979,7 +2868,7 @@ dependencies = [ "base64 0.21.2", "email-encoding", "email_address", - "fastrand", + "fastrand 1.9.0", "futures-io", "futures-util", "hostname", @@ -2997,9 +2886,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.146" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "line-wrap" @@ -3010,15 +2899,6 @@ dependencies = [ "safemem", ] -[[package]] -name = "link-cplusplus" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" -dependencies = [ - "cc", -] - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -3027,9 +2907,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linkify" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96dd5884008358112bc66093362197c7248ece00d46624e2cf71e50029f8cff5" +checksum = "f1dfa36d52c581e9ec783a7ce2a5e0143da6237be5811a0b3153fedfdbe9f780" dependencies = [ "memchr", ] @@ -3048,9 +2928,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "local-channel" @@ -3095,12 +2975,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "mac" @@ -3189,15 +3066,9 @@ dependencies = [ [[package]] name = "matchit" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" - -[[package]] -name = "matchit" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" +checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" [[package]] name = "md-5" @@ -3227,9 +3098,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -3241,7 +3112,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" dependencies = [ "serde", - "toml 0.7.4", + "toml 0.7.6", ] [[package]] @@ -3257,9 +3128,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" @@ -3279,20 +3150,12 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.4" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", + "simd-adler32", ] [[package]] @@ -3309,9 +3172,9 @@ dependencies = [ [[package]] name = "moka" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206bf83f415b0579fd885fe0804eb828e727636657dc1bf73d80d2f1218e14a1" +checksum = "fa6e72583bf6830c956235bff0d5afec8cf2952f579ebad18ae7821a917d950f" dependencies = [ "async-io", "async-lock", @@ -3334,9 +3197,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", @@ -3364,9 +3227,9 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] name = "nom" -version = "7.1.1" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -3384,9 +3247,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -3416,37 +3279,28 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi 0.1.19", - "libc", -] - -[[package]] -name = "num_threads" -version = "0.1.6" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ + "hermit-abi", "libc", ] [[package]] name = "object" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb" +checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" dependencies = [ "memchr", ] @@ -3459,9 +3313,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -3474,13 +3328,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.29", ] [[package]] @@ -3491,9 +3345,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" dependencies = [ "cc", "libc", @@ -3543,7 +3397,7 @@ dependencies = [ "prost", "thiserror", "tokio", - "tonic 0.8.2", + "tonic 0.8.3", ] [[package]] @@ -3556,7 +3410,7 @@ dependencies = [ "futures-util", "opentelemetry 0.19.0", "prost", - "tonic 0.8.2", + "tonic 0.8.3", ] [[package]] @@ -3568,7 +3422,7 @@ dependencies = [ "fnv", "futures-channel", "futures-util", - "indexmap 1.9.1", + "indexmap 1.9.3", "once_cell", "pin-project-lite", "thiserror", @@ -3670,14 +3524,14 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] name = "paste" -version = "1.0.9" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pathdiff" @@ -3687,9 +3541,9 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pem" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" dependencies = [ "base64 0.13.1", ] @@ -3702,9 +3556,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.4.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" +checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" dependencies = [ "thiserror", "ucd-trie", @@ -3712,9 +3566,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.4.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b75706b9642ebcb34dab3bc7750f811609a0eb1dd8b88c2d15bf628c1c65b2" +checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" dependencies = [ "pest", "pest_generator", @@ -3722,26 +3576,26 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.4.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f9272122f5979a6511a749af9db9bfc810393f63119970d7085fed1c4ea0db" +checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.29", ] [[package]] name = "pest_meta" -version = "2.4.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8717927f9b79515e565a64fe46c38b8cd0427e64c40680b14a7365ab09ac8d" +checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" dependencies = [ "once_cell", "pest", - "sha1", + "sha2", ] [[package]] @@ -3755,11 +3609,11 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_shared 0.11.1", + "phf_shared 0.11.2", ] [[package]] @@ -3793,18 +3647,18 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", ] [[package]] name = "pict-rs" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01bddf6e5b03b80b35dfcbd0d52905a7f3c60723f2f079f3a4d4442ac8ef09a8" +checksum = "6a312ff2efa60201fae0921e3436b03c549d4bf7a5ed53b45c4f0839a62c2bc8" dependencies = [ "actix-form-data", "actix-rt", @@ -3812,7 +3666,6 @@ dependencies = [ "actix-web", "anyhow", "async-trait", - "awc", "base64 0.21.2", "clap", "color-eyre", @@ -3828,7 +3681,10 @@ dependencies = [ "opentelemetry 0.19.0", "opentelemetry-otlp", "pin-project-lite", - "quick-xml 0.29.0", + "quick-xml 0.30.0", + "reqwest", + "reqwest-middleware", + "reqwest-tracing", "rusty-s3", "serde", "serde_cbor", @@ -3838,13 +3694,12 @@ dependencies = [ "sled", "storage-path-generator", "thiserror", - "time 0.3.15", + "time 0.3.27", "tokio", "tokio-util", - "toml 0.7.4", + "toml 0.7.6", "tracing", "tracing-actix-web", - "tracing-awc", "tracing-error", "tracing-futures", "tracing-log", @@ -3856,29 +3711,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.29", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -3888,34 +3743,35 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plist" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590" +checksum = "bdc0001cfea3db57a2e24bc0d818e9e20e554b5f97fabb9bc231dc240269ae06" dependencies = [ "base64 0.21.2", - "indexmap 1.9.1", + "indexmap 1.9.3", "line-wrap", - "quick-xml 0.28.2", + "quick-xml 0.29.0", "serde", - "time 0.3.15", + "time 0.3.27", ] [[package]] name = "png" -version = "0.17.6" +version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0e7f4c94ec26ff209cee506314212639d6c91b80afb82984819fafce9df01c" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" dependencies = [ "bitflags 1.3.2", "crc32fast", + "fdeflate", "flate2", - "miniz_oxide 0.5.4", + "miniz_oxide", ] [[package]] @@ -3936,9 +3792,9 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7fa9f396f51dffd61546fd8573ee20592287996568e6175ceb0f8699ad75d" +checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ "base64 0.21.2", "byteorder", @@ -3954,9 +3810,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73d946ec7d256b04dfadc4e6a3292324e6f417124750fc5c0950f981b703a0f1" +checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" dependencies = [ "bytes", "fallible-iterator", @@ -3965,15 +3821,15 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "pq-sys" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b845d6d8ec554f972a2c5298aad68953fd64e7441e846075450b44656a016d1" +checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" dependencies = [ "vcpkg", ] @@ -3986,9 +3842,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -4003,7 +3859,7 @@ dependencies = [ "byteorder", "hex", "lazy_static", - "rustix 0.36.5", + "rustix 0.36.15", ] [[package]] @@ -4025,9 +3881,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.0" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", "prost-derive", @@ -4035,24 +3891,23 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.0" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools 0.10.5", "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] name = "prost-types" -version = "0.11.1" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "bytes", "prost", ] @@ -4110,29 +3965,29 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.28.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51" dependencies = [ - "encoding_rs", "memchr", ] [[package]] name = "quick-xml" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" dependencies = [ + "encoding_rs", "memchr", "serde", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -4184,13 +4039,13 @@ dependencies = [ [[package]] name = "readonly" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb656d27c22b5c47154452686cae5e096f12e124daacb36a0bfcb32dbebb39e3" +checksum = "b8f439da1766942fe069954da6058b2e6c1760eb878bae76f5be9fc29f56f574" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -4213,14 +4068,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.2", - "regex-syntax 0.7.3", + "regex-automata 0.3.6", + "regex-syntax 0.7.4", ] [[package]] @@ -4229,46 +4084,37 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax 0.6.27", + "regex-syntax 0.6.29", ] [[package]] name = "regex-automata" -version = "0.3.2" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83d3daa6976cffb758ec878f108ba0e062a45b2d6ca3a2cca965338855476caf" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.3", + "regex-syntax 0.7.4", ] [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ "async-compression", "base64 0.21.2", @@ -4280,6 +4126,7 @@ dependencies = [ "http", "http-body", "hyper", + "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -4290,11 +4137,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls 0.21.6", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", + "tokio-rustls 0.24.1", "tokio-util", "tower-service", "url", @@ -4302,14 +4152,15 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", + "webpki-roots 0.25.2", "winreg", ] [[package]] name = "reqwest-middleware" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4531c89d50effe1fac90d095c8b133c20c5c714204feee0bfc3fd158e784209d" +checksum = "ff44108c7925d082f2861e683a88618b68235ad9cdc60d64d9d1188efc951cdb" dependencies = [ "anyhow", "async-trait", @@ -4322,20 +4173,22 @@ dependencies = [ [[package]] name = "reqwest-tracing" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b97ad83c2fc18113346b7158d79732242002427c30f620fa817c1f32901e0a8" +checksum = "14b1e66540e0cac90acadaf7109bf99c90d95abcc94b4c096bfa16a2d7aa7a71" dependencies = [ "anyhow", "async-trait", "getrandom", - "matchit 0.7.0", + "matchit", "opentelemetry 0.16.0", + "opentelemetry 0.19.0", "reqwest", "reqwest-middleware", "task-local-extensions", "tracing", "tracing-opentelemetry 0.16.0", + "tracing-opentelemetry 0.19.0", ] [[package]] @@ -4346,9 +4199,9 @@ checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" [[package]] name = "rgb" -version = "0.8.34" +version = "0.8.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3603b7d71ca82644f79b5a06d1220e9a58ede60bd32255f698cb1af8838b8db3" +checksum = "20ec2d3e3fc7a92ced357df9cebd5a10b6fb2aa1ee797bf7e9ce2f17dffc8f59" dependencies = [ "bytemuck", ] @@ -4407,14 +4260,14 @@ checksum = "2f8c01b9158de3aa5a7ac041a41c0e854d7adc3e473e7d7e2143eb5432bc5ba2" [[package]] name = "rss" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9acf62e0f3f4b52f61d3a12d6279e3f0b90d4811b0ae888eabdf61a2e7c03a95" +checksum = "7e6c0ea0e621c2a3aa34850ebd711526f0ac7385921f57d2430a47cecc7b9cbc" dependencies = [ "atom_syndication", "derive_builder", "never", - "quick-xml 0.28.2", + "quick-xml 0.30.0", ] [[package]] @@ -4429,9 +4282,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc_version" @@ -4444,26 +4297,26 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.5" +version = "0.36.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" +checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" dependencies = [ "bitflags 1.3.2", - "errno 0.2.8", + "errno", "io-lifetimes", "libc", "linux-raw-sys 0.1.4", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "rustix" -version = "0.37.22" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8818fa822adcc98b18fedbb3632a6a33213c070556b5aa7c4c8cc21cff565c4c" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ "bitflags 1.3.2", - "errno 0.3.1", + "errno", "io-lifetimes", "libc", "linux-raw-sys 0.3.8", @@ -4472,22 +4325,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.3" +version = "0.38.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" dependencies = [ - "bitflags 2.3.3", - "errno 0.3.1", + "bitflags 2.4.0", + "errno", "libc", - "linux-raw-sys 0.4.3", + "linux-raw-sys 0.4.5", "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -4497,9 +4350,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.3" +version = "0.21.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19faa85ecb5197342b54f987b142fb3e30d0c90da40f80ef4fa9a726e6676ed" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" dependencies = [ "log", "ring", @@ -4507,11 +4360,20 @@ dependencies = [ "sct", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.2", +] + [[package]] name = "rustls-webpki" -version = "0.101.1" +version = "0.101.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" dependencies = [ "ring", "untrusted", @@ -4519,9 +4381,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rusty-s3" @@ -4537,16 +4399,16 @@ dependencies = [ "serde", "serde_json", "sha2", - "time 0.3.15", + "time 0.3.27", "url", "zeroize", ] [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "safemem" @@ -4565,12 +4427,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.20" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "lazy_static", - "windows-sys 0.36.1", + "windows-sys 0.48.0", ] [[package]] @@ -4594,15 +4455,9 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "scratch" -version = "1.0.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" @@ -4616,9 +4471,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.7.0" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -4629,9 +4484,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -4650,18 +4505,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.171" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "9f5db24220c009de9bd45e69fb2938f4b6d2df856aa9304ce377b3180f83b7c1" dependencies = [ "serde_derive", ] @@ -4678,20 +4533,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "5ad697f7e0b65af4983a4ce8f56ed5b357e8d3c36651bf6a7e13639c17b8e670" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" dependencies = [ "indexmap 2.0.0", "itoa", @@ -4710,9 +4565,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" dependencies = [ "serde", ] @@ -4731,30 +4586,31 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02d8aa6e3c385bf084924f660ce2a3a6bd333ba55b35e8590b321f35d88513" +checksum = "1ca3b16a3d82c4088f343b7480a93550b3eabe1a358569c2dfe38bbcead07237" dependencies = [ "base64 0.21.2", "chrono", "hex", - "indexmap 1.9.1", + "indexmap 1.9.3", + "indexmap 2.0.0", "serde", "serde_json", "serde_with_macros", - "time 0.3.15", + "time 0.3.27", ] [[package]] name = "serde_with_macros" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc7d5d3932fb12ce722ee5e64dd38c504efba37567f0c402f6ca728c3b8b070" +checksum = "2e6be15c453eb305019bfa438b1593c731f36a289a7853f7707ee29e870b3b3c" dependencies = [ - "darling 0.20.1", + "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -4779,7 +4635,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -4815,13 +4671,19 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simple_asn1" version = "0.6.2" @@ -4831,14 +4693,14 @@ dependencies = [ "num-bigint", "num-traits", "thiserror", - "time 0.3.15", + "time 0.3.27", ] [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "sitemap-rs" @@ -4867,9 +4729,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -4892,9 +4754,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "smart-default" @@ -4904,7 +4766,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] @@ -4954,9 +4816,9 @@ checksum = "7f11d35dae9818c4313649da4a97c8329e29357a7fe584526c1d78f5b63ef836" [[package]] name = "string_cache" -version = "0.8.4" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", @@ -4980,9 +4842,9 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -5002,28 +4864,28 @@ checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" [[package]] name = "strum_macros" -version = "0.25.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6069ca09d878a33f883cc06aaa9718ede171841d3832450354410b718b097232" +checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "1.0.103" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -5032,9 +4894,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" dependencies = [ "proc-macro2", "quote", @@ -5043,27 +4905,25 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "syntect" -version = "5.0.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c454c27d9d7d9a84c7803aaa3c50cd088d2906fe3c6e42da3209aa623576a8" +checksum = "e02b4b303bf8d08bfeb0445cba5068a3d306b6baece1d5582171a9bf49188f91" dependencies = [ "bincode", "bitflags 1.3.2", "fancy-regex", "flate2", "fnv", - "lazy_static", "once_cell", "plist", - "regex-syntax 0.6.27", + "regex-syntax 0.7.4", "serde", - "serde_derive", "serde_json", "thiserror", "walkdir", @@ -5087,16 +4947,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.3.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", - "fastrand", - "libc", - "redox_syscall 0.2.16", - "remove_dir_all", - "winapi", + "fastrand 2.0.0", + "redox_syscall 0.3.5", + "rustix 0.38.8", + "windows-sys 0.48.0", ] [[package]] @@ -5112,47 +4971,48 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if", "once_cell", ] [[package]] name = "time" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -5161,28 +5021,37 @@ dependencies = [ [[package]] name = "time" -version = "0.3.15" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" +checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" dependencies = [ + "deranged", "itoa", - "libc", - "num_threads", "serde", + "time-core", "time-macros", ] +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + [[package]] name = "time-macros" -version = "0.2.4" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" +dependencies = [ + "time-core", +] [[package]] name = "tinyjson" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b2f023483085707f4f0c1238a8a7baf8b502a1d427b9ed2a243884d3d687bb" +checksum = "9ab95735ea2c8fd51154d01e39cf13912a78071c2d89abc49a7ef102a7dd725a" [[package]] name = "tinyvec" @@ -5195,17 +5064,16 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", @@ -5214,7 +5082,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2 0.4.9", + "socket2 0.5.3", "tokio-macros", "tracing", "windows-sys 0.48.0", @@ -5238,14 +5106,14 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -5253,9 +5121,9 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" +checksum = "000387915083ea6406ee44b50ca74813aba799fe682a7689e382bf9e13b74ce9" dependencies = [ "async-trait", "byteorder", @@ -5266,13 +5134,15 @@ dependencies = [ "log", "parking_lot 0.12.1", "percent-encoding", - "phf 0.11.1", + "phf 0.11.2", "pin-project-lite", "postgres-protocol", "postgres-types", + "rand", "socket2 0.5.3", "tokio", "tokio-util", + "whoami", ] [[package]] @@ -5283,7 +5153,7 @@ checksum = "dd5831152cb0d3f79ef5523b357319ba154795d64c7078b2daa95a803b54057f" dependencies = [ "futures", "ring", - "rustls 0.21.3", + "rustls 0.21.6", "tokio", "tokio-postgres", "tokio-rustls 0.24.1", @@ -5295,7 +5165,7 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.20.7", + "rustls 0.20.8", "tokio", "webpki", ] @@ -5306,15 +5176,15 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.3", + "rustls 0.21.6", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -5337,18 +5207,18 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] [[package]] name = "toml" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" dependencies = [ "serde", "serde_spanned", @@ -5358,20 +5228,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "indexmap 1.9.1", + "indexmap 2.0.0", "serde", "serde_spanned", "toml_datetime", @@ -5380,13 +5250,13 @@ dependencies = [ [[package]] name = "tonic" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b9af819e54b8f33d453655bef9b9acc171568fb49523078d0cc4e7484200ec" +checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" dependencies = [ "async-stream", "async-trait", - "axum 0.5.17", + "axum", "base64 0.13.1", "bytes", "futures-core", @@ -5417,7 +5287,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-trait", - "axum 0.6.18", + "axum", "base64 0.21.2", "bytes", "futures-core", @@ -5440,9 +5310,9 @@ dependencies = [ [[package]] name = "totp-rs" -version = "5.0.2" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad5e73765ff14ae797c1a61ee0c7beaf21b4e4a0047844300e332c6c24df1fc" +checksum = "de057280e901b0cc5cd5f94636c54e89958757b8cd573cdf29703496d0d95df9" dependencies = [ "base32", "constant_time_eq", @@ -5462,7 +5332,7 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap 1.9.1", + "indexmap 1.9.3", "pin-project", "pin-project-lite", "rand", @@ -5474,25 +5344,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" -dependencies = [ - "bitflags 1.3.2", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - [[package]] name = "tower-layer" version = "0.3.2" @@ -5520,9 +5371,9 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce52ffaf2d544e317d3bef63f49a6a22022866505fa4840a4339b1756834a2a9" +checksum = "5c0b08ce08cbde6a96fc1e4ebb8132053e53ec7a5cd27eef93ede6b73ebbda06" dependencies = [ "actix-web", "opentelemetry 0.19.0", @@ -5534,37 +5385,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", -] - -[[package]] -name = "tracing-awc" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaa1a68fce4d1a7fad459f81ddcafbdd7c6f6bcda5c7e07d5f42db637931fac7" -dependencies = [ - "actix-http", - "actix-service", - "awc", - "bytes", - "futures-core", - "opentelemetry 0.19.0", - "pin-project-lite", - "tracing", - "tracing-opentelemetry 0.19.0", + "syn 2.0.29", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", @@ -5661,15 +5495,15 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db" +checksum = "0eee8098afad3fb0c54a9007aab6804558410503ad676d4633f9c2559a00ac0f" [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "ts-rs" @@ -5691,47 +5525,47 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", "termcolor", ] [[package]] name = "typed-builder" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d2135600ca28125d27c63643ed7789b9f467a316e3a8ad98a9abeeb3eec4a83" +checksum = "7fe83c85a85875e8c4cb9ce4a890f05b23d38cd0d47647db7895d3d2a79566d2" dependencies = [ "typed-builder-macro", ] [[package]] name = "typed-builder-macro" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "952108e5d54c3c3f6552e8c5cdb3600adf49c22a4ea82066dea90d2f5c71c526" +checksum = "29a3151c41d0b13e3d011f98adc24434560ef06673a155a6c7f66b9879eecce2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.29", ] [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -5750,9 +5584,9 @@ checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -5795,9 +5629,9 @@ dependencies = [ [[package]] name = "urlencoding" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "utf-8" @@ -5819,9 +5653,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom", "serde", @@ -5853,22 +5687,20 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi", "winapi-util", ] [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -5886,9 +5718,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5896,24 +5728,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.29", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -5923,9 +5755,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5933,28 +5765,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-streams" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" dependencies = [ "futures-util", "js-sys", @@ -5974,9 +5806,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -6021,13 +5853,29 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + +[[package]] +name = "whoami" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "winapi" version = "0.3.9" @@ -6060,31 +5908,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.36.1" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-targets 0.48.5", ] [[package]] name = "windows-sys" -version = "0.42.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.42.2", ] [[package]] @@ -6093,41 +5931,50 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" +name = "windows_aarch64_gnullvm" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -6137,15 +5984,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -6155,15 +5996,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -6173,15 +6008,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -6191,9 +6020,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -6203,15 +6032,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -6221,26 +6044,27 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.4.6" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -6271,24 +6095,24 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" [[package]] name = "zstd" -version = "0.12.3+zstd.1.5.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "6.0.5+zstd.1.5.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" dependencies = [ "libc", "zstd-sys", diff --git a/Cargo.toml b/Cargo.toml index 751e6b30a..f48a75b4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,7 +68,7 @@ lemmy_routes = { version = "=0.18.1", path = "./crates/routes" } lemmy_db_views = { version = "=0.18.1", path = "./crates/db_views" } lemmy_db_views_actor = { version = "=0.18.1", path = "./crates/db_views_actor" } lemmy_db_views_moderator = { version = "=0.18.1", path = "./crates/db_views_moderator" } -activitypub_federation = { version = "0.4.6", default-features = false, features = [ +activitypub_federation = { version = "0.5.0-beta.1", default-features = false, features = [ "actix-web", ], git = "https://github.com/phiresky/activitypub-federation-rust/", branch = "raw-sending" } diesel = "2.1.0" diff --git a/crates/api/src/comment_report/list.rs b/crates/api/src/comment_report/list.rs index 3f6f160c8..839288521 100644 --- a/crates/api/src/comment_report/list.rs +++ b/crates/api/src/comment_report/list.rs @@ -27,7 +27,7 @@ pub async fn list_comment_reports( page, limit, } - .list(&mut context.pool(), &local_user_view.person) + .list(&mut context.pool(), &local_user_view) .await?; Ok(Json(ListCommentReportsResponse { comment_reports })) diff --git a/crates/api/src/community/add_mod.rs b/crates/api/src/community/add_mod.rs index 2d7b88750..937af22df 100644 --- a/crates/api/src/community/add_mod.rs +++ b/crates/api/src/community/add_mod.rs @@ -28,7 +28,7 @@ pub async fn add_mod_to_community( // Verify that only mods or admins can add mod is_mod_or_admin(&mut context.pool(), local_user_view.person.id, community_id).await?; let community = Community::read(&mut context.pool(), community_id).await?; - if local_user_view.person.admin && !community.local { + if local_user_view.local_user.admin && !community.local { return Err(LemmyErrorType::NotAModerator)?; } diff --git a/crates/api/src/local_user/add_admin.rs b/crates/api/src/local_user/add_admin.rs index 81ec588f0..6800b75a5 100644 --- a/crates/api/src/local_user/add_admin.rs +++ b/crates/api/src/local_user/add_admin.rs @@ -7,8 +7,8 @@ use lemmy_api_common::{ }; use lemmy_db_schema::{ source::{ + local_user::{LocalUser, LocalUserUpdateForm}, moderator::{ModAdd, ModAddForm}, - person::{Person, PersonUpdateForm}, }, traits::Crud, }; @@ -27,13 +27,11 @@ impl Perform for AddAdmin { // Make sure user is an admin is_admin(&local_user_view)?; - let added = data.added; - let added_person_id = data.person_id; - let added_admin = Person::update( + let added_admin = LocalUser::update( &mut context.pool(), - added_person_id, - &PersonUpdateForm { - admin: Some(added), + data.local_user_id, + &LocalUserUpdateForm { + admin: Some(data.added), ..Default::default() }, ) @@ -43,7 +41,7 @@ impl Perform for AddAdmin { // Mod tables let form = ModAddForm { mod_person_id: local_user_view.person.id, - other_person_id: added_admin.id, + other_person_id: added_admin.person_id, removed: Some(!data.added), }; diff --git a/crates/api/src/local_user/block.rs b/crates/api/src/local_user/block.rs index 604219d4e..395ab0a15 100644 --- a/crates/api/src/local_user/block.rs +++ b/crates/api/src/local_user/block.rs @@ -9,6 +9,7 @@ use lemmy_db_schema::{ source::person_block::{PersonBlock, PersonBlockForm}, traits::Blockable, }; +use lemmy_db_views::structs::LocalUserView; use lemmy_db_views_actor::structs::PersonView; use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType}; @@ -34,9 +35,8 @@ impl Perform for BlockPerson { target_id, }; - let target_person_view = PersonView::read(&mut context.pool(), target_id).await?; - - if target_person_view.person.admin { + let target_user = LocalUserView::read_person(&mut context.pool(), target_id).await; + if target_user.map(|t| t.local_user.admin) == Ok(true) { return Err(LemmyErrorType::CantBlockAdmin)?; } @@ -50,8 +50,9 @@ impl Perform for BlockPerson { .with_lemmy_type(LemmyErrorType::PersonBlockAlreadyExists)?; } + let person_view = PersonView::read(&mut context.pool(), target_id).await?; Ok(BlockPersonResponse { - person_view: target_person_view, + person_view, blocked: data.block, }) } diff --git a/crates/api/src/local_user/login.rs b/crates/api/src/local_user/login.rs index 4b5ea0faf..62449c424 100644 --- a/crates/api/src/local_user/login.rs +++ b/crates/api/src/local_user/login.rs @@ -47,7 +47,7 @@ impl Perform for Login { // Check if the user's email is verified if email verification is turned on // However, skip checking verification if the user is an admin - if !local_user_view.person.admin + if !local_user_view.local_user.admin && site_view.local_site.require_email_verification && !local_user_view.local_user.email_verified { diff --git a/crates/api/src/local_user/report_count.rs b/crates/api/src/local_user/report_count.rs index 89bedc262..061372960 100644 --- a/crates/api/src/local_user/report_count.rs +++ b/crates/api/src/local_user/report_count.rs @@ -21,7 +21,7 @@ impl Perform for GetReportCount { let local_user_view = local_user_view_from_jwt(&data.auth, context).await?; let person_id = local_user_view.person.id; - let admin = local_user_view.person.admin; + let admin = local_user_view.local_user.admin; let community_id = data.community_id; let comment_reports = diff --git a/crates/api/src/post_report/list.rs b/crates/api/src/post_report/list.rs index f5edab703..01a59aa84 100644 --- a/crates/api/src/post_report/list.rs +++ b/crates/api/src/post_report/list.rs @@ -33,7 +33,7 @@ impl Perform for ListPostReports { page, limit, } - .list(&mut context.pool(), &local_user_view.person) + .list(&mut context.pool(), &local_user_view) .await?; Ok(ListPostReportsResponse { post_reports }) diff --git a/crates/api/src/site/leave_admin.rs b/crates/api/src/site/leave_admin.rs index 570f9d52c..13e1c05dd 100644 --- a/crates/api/src/site/leave_admin.rs +++ b/crates/api/src/site/leave_admin.rs @@ -9,8 +9,8 @@ use lemmy_db_schema::{ source::{ actor_language::SiteLanguage, language::Language, + local_user::{LocalUser, LocalUserUpdateForm}, moderator::{ModAdd, ModAddForm}, - person::{Person, PersonUpdateForm}, tagline::Tagline, }, traits::Crud, @@ -39,11 +39,10 @@ impl Perform for LeaveAdmin { return Err(LemmyErrorType::CannotLeaveAdmin)?; } - let person_id = local_user_view.person.id; - Person::update( + LocalUser::update( &mut context.pool(), - person_id, - &PersonUpdateForm { + local_user_view.local_user.id, + &LocalUserUpdateForm { admin: Some(false), ..Default::default() }, @@ -51,6 +50,7 @@ impl Perform for LeaveAdmin { .await?; // Mod tables + let person_id = local_user_view.person.id; let form = ModAddForm { mod_person_id: person_id, other_person_id: person_id, diff --git a/crates/api_common/src/person.rs b/crates/api_common/src/person.rs index 79a0aa377..ef970f1bc 100644 --- a/crates/api_common/src/person.rs +++ b/crates/api_common/src/person.rs @@ -1,6 +1,6 @@ use crate::sensitive::Sensitive; use lemmy_db_schema::{ - newtypes::{CommentReplyId, CommunityId, LanguageId, PersonId, PersonMentionId}, + newtypes::{CommentReplyId, CommunityId, LanguageId, LocalUserId, PersonId, PersonMentionId}, CommentSortType, ListingType, SortType, @@ -207,7 +207,7 @@ pub struct MarkAllAsRead { #[cfg_attr(feature = "full", ts(export))] /// Adds an admin to a site. pub struct AddAdmin { - pub person_id: PersonId, + pub local_user_id: LocalUserId, pub added: bool, pub auth: Sensitive, } diff --git a/crates/api_common/src/utils.rs b/crates/api_common/src/utils.rs index 4d434afcd..a79e3bd52 100644 --- a/crates/api_common/src/utils.rs +++ b/crates/api_common/src/utils.rs @@ -5,7 +5,7 @@ use crate::{ site::FederatedInstances, }; use anyhow::Context; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_db_schema::{ impls::person::is_banned, newtypes::{CommunityId, DbUrl, LocalUserId, PersonId, PostId}, @@ -78,8 +78,8 @@ pub async fn is_mod_or_admin_opt( } pub fn is_admin(local_user_view: &LocalUserView) -> Result<(), LemmyError> { - if !local_user_view.person.admin { - Err(LemmyErrorType::NotAnAdmin)?; + if !local_user_view.local_user.admin { + return Err(LemmyErrorType::NotAnAdmin)?; } Ok(()) } @@ -163,7 +163,7 @@ pub async fn local_user_view_from_jwt_opt( /// Checks if user's token was issued before user's password reset. pub fn check_validator_time( - validator_time: &NaiveDateTime, + validator_time: &DateTime, claims: &Claims, ) -> Result<(), LemmyError> { let user_validation_time = validator_time.timestamp(); @@ -176,7 +176,7 @@ pub fn check_validator_time( pub fn check_user_valid( banned: bool, - ban_expires: Option, + ban_expires: Option>, deleted: bool, ) -> Result<(), LemmyError> { // Check for a site ban @@ -500,7 +500,7 @@ pub async fn check_registration_application( if (local_site.registration_mode == RegistrationMode::RequireApplication || local_site.registration_mode == RegistrationMode::Closed) && !local_user_view.local_user.accepted_application - && !local_user_view.person.admin + && !local_user_view.local_user.admin { // Fetch the registration, see if its denied let local_user_id = local_user_view.local_user.id; diff --git a/crates/api_crud/src/user/create.rs b/crates/api_crud/src/user/create.rs index 1665ba191..8475dfa9d 100644 --- a/crates/api_crud/src/user/create.rs +++ b/crates/api_crud/src/user/create.rs @@ -115,8 +115,6 @@ pub async fn register( .public_key(actor_keypair.public_key) .inbox_url(Some(generate_inbox_url(&actor_id)?)) .shared_inbox_url(Some(generate_shared_inbox_url(&actor_id)?)) - // If its the initial site setup, they are an admin - .admin(Some(!local_site.site_setup)) .instance_id(site_view.site.instance_id) .build(); @@ -137,6 +135,8 @@ pub async fn register( .show_nsfw(Some(data.show_nsfw)) .accepted_application(accepted_application) .default_listing_type(Some(local_site.default_post_listing_type)) + // If its the initial site setup, they are an admin + .admin(Some(!local_site.site_setup)) .build(); let inserted_local_user = LocalUser::create(&mut context.pool(), &local_user_form).await?; diff --git a/crates/apub/assets/lemmy/activities/block/block_user.json b/crates/apub/assets/lemmy/activities/block/block_user.json index a94471830..a07d3786c 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.151874+00:00", + "expires": "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 49083448a..5dadc0781 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.151874+00:00", + "expires": "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/assets/lemmy/activities/community/announce_create_page.json b/crates/apub/assets/lemmy/activities/community/announce_create_page.json index cb4db8289..71b4a7e54 100644 --- a/crates/apub/assets/lemmy/activities/community/announce_create_page.json +++ b/crates/apub/assets/lemmy/activities/community/announce_create_page.json @@ -17,7 +17,7 @@ "commentsEnabled": true, "sensitive": false, "stickied": false, - "published": "2021-11-01T12:11:22.871846+00:00" + "published": "2021-11-01T12:11:22.871846Z" }, "cc": ["http://enterprise.lemmy.ml/c/main"], "type": "Create", diff --git a/crates/apub/assets/lemmy/activities/community/update_community.json b/crates/apub/assets/lemmy/activities/community/update_community.json index 873b03b76..604e04d45 100644 --- a/crates/apub/assets/lemmy/activities/community/update_community.json +++ b/crates/apub/assets/lemmy/activities/community/update_community.json @@ -35,8 +35,8 @@ "name": "Deutsch" } ], - "published": "2021-10-29T15:05:51.476984+00:00", - "updated": "2021-11-01T12:23:50.151874+00:00" + "published": "2021-10-29T15:05:51.476984Z", + "updated": "2021-11-01T12:23:50.151874Z" }, "cc": ["http://enterprise.lemmy.ml/c/main"], "audience": "http://enterprise.lemmy.ml/u/main", diff --git a/crates/apub/assets/lemmy/activities/create_or_update/create_note.json b/crates/apub/assets/lemmy/activities/create_or_update/create_note.json index eed673fc9..a12eeb51c 100644 --- a/crates/apub/assets/lemmy/activities/create_or_update/create_note.json +++ b/crates/apub/assets/lemmy/activities/create_or_update/create_note.json @@ -18,7 +18,7 @@ "mediaType": "text/markdown" }, "inReplyTo": "http://ds9.lemmy.ml/post/1", - "published": "2021-11-01T11:45:49.794920+00:00" + "published": "2021-11-01T11:45:49.794920Z" }, "cc": [ "http://enterprise.lemmy.ml/c/main", diff --git a/crates/apub/assets/lemmy/activities/create_or_update/create_page.json b/crates/apub/assets/lemmy/activities/create_or_update/create_page.json index 1729a8bdd..50d2536fe 100644 --- a/crates/apub/assets/lemmy/activities/create_or_update/create_page.json +++ b/crates/apub/assets/lemmy/activities/create_or_update/create_page.json @@ -29,7 +29,7 @@ "identifier": "ko", "name": "한국어" }, - "published": "2021-10-29T15:10:51.557399+00:00" + "published": "2021-10-29T15:10:51.557399Z" }, "cc": ["http://enterprise.lemmy.ml/c/main"], "audience": "https://enterprise.lemmy.ml/c/main", diff --git a/crates/apub/assets/lemmy/activities/create_or_update/create_private_message.json b/crates/apub/assets/lemmy/activities/create_or_update/create_private_message.json index 738515400..54ee39350 100644 --- a/crates/apub/assets/lemmy/activities/create_or_update/create_private_message.json +++ b/crates/apub/assets/lemmy/activities/create_or_update/create_private_message.json @@ -13,7 +13,7 @@ "content": "hello", "mediaType": "text/markdown" }, - "published": "2021-10-29T15:31:56.058289+00:00" + "published": "2021-10-29T15:31:56.058289Z" }, "type": "Create" } diff --git a/crates/apub/assets/lemmy/activities/create_or_update/update_page.json b/crates/apub/assets/lemmy/activities/create_or_update/update_page.json index 2e1007638..888b866b8 100644 --- a/crates/apub/assets/lemmy/activities/create_or_update/update_page.json +++ b/crates/apub/assets/lemmy/activities/create_or_update/update_page.json @@ -25,8 +25,8 @@ ], "commentsEnabled": true, "sensitive": false, - "published": "2021-10-29T15:10:51.557399+00:00", - "updated": "2021-10-29T15:11:35.976374+00:00" + "published": "2021-10-29T15:10:51.557399Z", + "updated": "2021-10-29T15:11:35.976374Z" }, "cc": ["http://enterprise.lemmy.ml/c/main"], "audience": "https://enterprise.lemmy.ml/c/main", diff --git a/crates/apub/assets/lemmy/collections/group_featured_posts.json b/crates/apub/assets/lemmy/collections/group_featured_posts.json index 227c6f877..59f1afb9c 100644 --- a/crates/apub/assets/lemmy/collections/group_featured_posts.json +++ b/crates/apub/assets/lemmy/collections/group_featured_posts.json @@ -17,7 +17,7 @@ "attachment": [], "commentsEnabled": true, "sensitive": false, - "published": "2023-02-06T06:42:41.939437+00:00", + "published": "2023-02-06T06:42:41.939437Z", "language": { "identifier": "de", "name": "Deutsch" @@ -38,7 +38,7 @@ "attachment": [], "commentsEnabled": true, "sensitive": false, - "published": "2023-02-06T06:42:37.119567+00:00", + "published": "2023-02-06T06:42:37.119567Z", "language": { "identifier": "de", "name": "Deutsch" diff --git a/crates/apub/assets/lemmy/collections/group_outbox.json b/crates/apub/assets/lemmy/collections/group_outbox.json index 1bdb816b0..c7279a799 100644 --- a/crates/apub/assets/lemmy/collections/group_outbox.json +++ b/crates/apub/assets/lemmy/collections/group_outbox.json @@ -25,7 +25,7 @@ "commentsEnabled": true, "sensitive": false, "stickied": false, - "published": "2021-11-18T17:19:45.895163+00:00" + "published": "2021-11-18T17:19:45.895163Z" } }, "cc": ["https://ds9.lemmy.ml/c/testcom/followers"], @@ -54,7 +54,7 @@ "commentsEnabled": true, "sensitive": false, "stickied": false, - "published": "2021-11-18T17:19:05.763109+00:00" + "published": "2021-11-18T17:19:05.763109Z" } }, "cc": ["https://ds9.lemmy.ml/c/testcom/followers"], diff --git a/crates/apub/assets/lemmy/objects/chat_message.json b/crates/apub/assets/lemmy/objects/chat_message.json index c39db8dea..95b37322e 100644 --- a/crates/apub/assets/lemmy/objects/chat_message.json +++ b/crates/apub/assets/lemmy/objects/chat_message.json @@ -9,5 +9,5 @@ "content": "Hello hello, testing", "mediaType": "text/markdown" }, - "published": "2021-10-21T10:13:14.597721+00:00" + "published": "2021-10-21T10:13:14.597721Z" } diff --git a/crates/apub/assets/lemmy/objects/group.json b/crates/apub/assets/lemmy/objects/group.json index 66dfe144b..3870daf75 100644 --- a/crates/apub/assets/lemmy/objects/group.json +++ b/crates/apub/assets/lemmy/objects/group.json @@ -41,6 +41,6 @@ "name": "Deutsch" } ], - "published": "2019-06-02T16:43:50.799554+00:00", - "updated": "2021-03-10T17:18:10.498868+00:00" + "published": "2019-06-02T16:43:50.799554Z", + "updated": "2021-03-10T17:18:10.498868Z" } diff --git a/crates/apub/assets/lemmy/objects/instance.json b/crates/apub/assets/lemmy/objects/instance.json index a7c3ca5db..1e07043d9 100644 --- a/crates/apub/assets/lemmy/objects/instance.json +++ b/crates/apub/assets/lemmy/objects/instance.json @@ -26,5 +26,5 @@ "name": "Español" } ], - "published": "2022-01-19T21:52:11.110741+00:00" + "published": "2022-01-19T21:52:11.110741Z" } diff --git a/crates/apub/assets/lemmy/objects/note.json b/crates/apub/assets/lemmy/objects/note.json index 2e50abcdb..8366ebd6d 100644 --- a/crates/apub/assets/lemmy/objects/note.json +++ b/crates/apub/assets/lemmy/objects/note.json @@ -27,6 +27,6 @@ "identifier": "fr", "name": "Français" }, - "published": "2021-03-01T13:42:43.966208+00:00", - "updated": "2021-03-01T13:43:03.955787+00:00" + "published": "2021-03-01T13:42:43.966208Z", + "updated": "2021-03-01T13:43:03.955787Z" } diff --git a/crates/apub/assets/lemmy/objects/page.json b/crates/apub/assets/lemmy/objects/page.json index b3e9b480b..6b536dd90 100644 --- a/crates/apub/assets/lemmy/objects/page.json +++ b/crates/apub/assets/lemmy/objects/page.json @@ -30,5 +30,5 @@ "identifier": "fr", "name": "Français" }, - "published": "2021-02-26T12:35:34.292626+00:00" + "published": "2021-02-26T12:35:34.292626Z" } diff --git a/crates/apub/assets/lemmy/objects/person.json b/crates/apub/assets/lemmy/objects/person.json index 4f708656c..5be860c6c 100644 --- a/crates/apub/assets/lemmy/objects/person.json +++ b/crates/apub/assets/lemmy/objects/person.json @@ -22,8 +22,8 @@ "endpoints": { "sharedInbox": "https://enterprise.lemmy.ml/inbox" }, - "published": "2020-01-17T01:38:22.348392+00:00", - "updated": "2021-08-13T00:11:15.941990+00:00", + "published": "2020-01-17T01:38:22.348392Z", + "updated": "2021-08-13T00:11:15.941990Z", "publicKey": { "id": "https://enterprise.lemmy.ml/u/picard#main-key", "owner": "https://enterprise.lemmy.ml/u/picard", diff --git a/crates/apub/src/activities/block/block_user.rs b/crates/apub/src/activities/block/block_user.rs index d133e8f75..1a7bf00c2 100644 --- a/crates/apub/src/activities/block/block_user.rs +++ b/crates/apub/src/activities/block/block_user.rs @@ -20,7 +20,7 @@ use activitypub_federation::{ traits::{ActivityHandler, Actor}, }; use anyhow::anyhow; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_api_common::{ context::LemmyContext, utils::{remove_user_data, remove_user_data_in_community, sanitize_html_opt}, @@ -39,7 +39,7 @@ use lemmy_db_schema::{ }, traits::{Bannable, Crud, Followable}, }; -use lemmy_utils::{error::LemmyError, utils::time::convert_datetime}; +use lemmy_utils::error::LemmyError; use url::Url; impl BlockUser { @@ -49,7 +49,7 @@ impl BlockUser { mod_: &ApubPerson, remove_data: Option, reason: Option, - expires: Option, + expires: Option>, context: &Data, ) -> Result { let audience = if let SiteOrCommunity::Community(c) = target { @@ -71,7 +71,7 @@ impl BlockUser { &context.settings().get_protocol_and_hostname(), )?, audience, - expires: expires.map(convert_datetime), + expires, }) } @@ -82,7 +82,7 @@ impl BlockUser { mod_: &ApubPerson, remove_data: bool, reason: Option, - expires: Option, + expires: Option>, context: &Data, ) -> Result<(), LemmyError> { let block = BlockUser::new( @@ -149,7 +149,7 @@ impl ActivityHandler for BlockUser { #[tracing::instrument(skip_all)] async fn receive(self, context: &Data) -> Result<(), LemmyError> { - let expires = self.expires.map(|u| u.naive_local()); + let expires = self.expires.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/mod.rs b/crates/apub/src/activities/block/mod.rs index e9986afc8..0d64aacd4 100644 --- a/crates/apub/src/activities/block/mod.rs +++ b/crates/apub/src/activities/block/mod.rs @@ -10,7 +10,7 @@ use activitypub_federation::{ fetch::object_id::ObjectId, traits::{Actor, Object}, }; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_api_common::{community::BanFromCommunity, context::LemmyContext, person::BanPerson}; use lemmy_db_schema::{ newtypes::CommunityId, @@ -49,7 +49,7 @@ impl Object for SiteOrCommunity { type Error = LemmyError; #[tracing::instrument(skip_all)] - fn last_refreshed_at(&self) -> Option { + fn last_refreshed_at(&self) -> Option> { Some(match self { SiteOrCommunity::Site(i) => i.last_refreshed_at, SiteOrCommunity::Community(c) => c.last_refreshed_at, diff --git a/crates/apub/src/activities/block/undo_block_user.rs b/crates/apub/src/activities/block/undo_block_user.rs index 9238a6952..d64e2fbe3 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) -> Result<(), LemmyError> { - let expires = self.object.expires.map(|u| u.naive_local()); + let expires = self.object.expires.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/fetcher/post_or_comment.rs b/crates/apub/src/fetcher/post_or_comment.rs index 929149669..31c53864a 100644 --- a/crates/apub/src/fetcher/post_or_comment.rs +++ b/crates/apub/src/fetcher/post_or_comment.rs @@ -6,7 +6,7 @@ use crate::{ }, }; use activitypub_federation::{config::Data, traits::Object}; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_api_common::context::LemmyContext; use lemmy_db_schema::{ source::{community::Community, post::Post}, @@ -35,7 +35,7 @@ impl Object for PostOrComment { type Kind = PageOrNote; type Error = LemmyError; - fn last_refreshed_at(&self) -> Option { + fn last_refreshed_at(&self) -> Option> { None } diff --git a/crates/apub/src/fetcher/search.rs b/crates/apub/src/fetcher/search.rs index dd8ef2ca2..54951edd9 100644 --- a/crates/apub/src/fetcher/search.rs +++ b/crates/apub/src/fetcher/search.rs @@ -7,7 +7,7 @@ use activitypub_federation::{ fetch::{object_id::ObjectId, webfinger::webfinger_resolve_actor}, traits::Object, }; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_api_common::context::LemmyContext; use lemmy_utils::error::{LemmyError, LemmyErrorType}; use serde::Deserialize; @@ -80,7 +80,7 @@ impl Object for SearchableObjects { type Kind = SearchableKinds; type Error = LemmyError; - fn last_refreshed_at(&self) -> Option { + fn last_refreshed_at(&self) -> Option> { match self { SearchableObjects::Person(p) => p.last_refreshed_at(), SearchableObjects::Community(c) => c.last_refreshed_at(), diff --git a/crates/apub/src/fetcher/user_or_community.rs b/crates/apub/src/fetcher/user_or_community.rs index 2763af2f0..93e955c7b 100644 --- a/crates/apub/src/fetcher/user_or_community.rs +++ b/crates/apub/src/fetcher/user_or_community.rs @@ -7,7 +7,7 @@ use activitypub_federation::{ config::Data, traits::{Actor, Object}, }; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_api_common::context::LemmyContext; use lemmy_db_schema::source::activity::ActorType; use lemmy_utils::error::LemmyError; @@ -39,7 +39,7 @@ impl Object for UserOrCommunity { type Kind = PersonOrGroup; type Error = LemmyError; - fn last_refreshed_at(&self) -> Option { + fn last_refreshed_at(&self) -> Option> { Some(match self { UserOrCommunity::User(p) => p.last_refreshed_at, UserOrCommunity::Community(p) => p.last_refreshed_at, diff --git a/crates/apub/src/lib.rs b/crates/apub/src/lib.rs index 1e03701ab..69eacdc93 100644 --- a/crates/apub/src/lib.rs +++ b/crates/apub/src/lib.rs @@ -1,5 +1,6 @@ use crate::fetcher::post_or_comment::PostOrComment; use activitypub_federation::config::{Data, UrlVerifier}; +use anyhow::anyhow; use async_trait::async_trait; use lemmy_api_common::context::LemmyContext; use lemmy_db_schema::{ @@ -38,7 +39,7 @@ pub struct VerifyUrlData(pub ActualDbPool); #[async_trait] impl UrlVerifier for VerifyUrlData { - async fn verify(&self, url: &Url) -> Result<(), &'static str> { + async fn verify(&self, url: &Url) -> Result<(), anyhow::Error> { let local_site_data = local_site_data_cached(&mut (&self.0).into()) .await .expect("read local site data"); @@ -46,16 +47,16 @@ impl UrlVerifier for VerifyUrlData { LemmyError { error_type: LemmyErrorType::FederationDisabled, .. - } => "Federation disabled", + } => anyhow!("Federation disabled"), LemmyError { error_type: LemmyErrorType::DomainBlocked(_), .. - } => "Domain is blocked", + } => anyhow!("Domain is blocked"), LemmyError { error_type: LemmyErrorType::DomainNotInAllowList(_), .. - } => "Domain is not in allowlist", - _ => "Failed validating apub id", + } => anyhow!("Domain is not in allowlist"), + _ => anyhow!("Failed validating apub id"), })?; Ok(()) } diff --git a/crates/apub/src/objects/comment.rs b/crates/apub/src/objects/comment.rs index 1b7724431..9be6639c0 100644 --- a/crates/apub/src/objects/comment.rs +++ b/crates/apub/src/objects/comment.rs @@ -15,7 +15,7 @@ use activitypub_federation::{ protocol::{values::MediaTypeMarkdownOrHtml, verification::verify_domains_match}, traits::Object, }; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_api_common::{ context::LemmyContext, utils::{local_site_opt_to_slur_regex, sanitize_html}, @@ -59,7 +59,7 @@ impl Object for ApubComment { type Kind = Note; type Error = LemmyError; - fn last_refreshed_at(&self) -> Option { + fn last_refreshed_at(&self) -> Option> { None } @@ -170,8 +170,8 @@ impl Object for ApubComment { post_id: post.id, content, removed: None, - published: note.published.map(|u| u.naive_local()), - updated: note.updated.map(|u| u.naive_local()), + published: note.published.map(Into::into), + updated: note.updated.map(Into::into), deleted: Some(false), ap_id: Some(note.id.into()), distinguished: note.distinguished, diff --git a/crates/apub/src/objects/community.rs b/crates/apub/src/objects/community.rs index 8dba209d6..3e8c62746 100644 --- a/crates/apub/src/objects/community.rs +++ b/crates/apub/src/objects/community.rs @@ -14,7 +14,7 @@ use activitypub_federation::{ kinds::actor::GroupType, traits::{Actor, Object}, }; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_api_common::{ context::LemmyContext, utils::{generate_featured_url, generate_moderators_url, generate_outbox_url}, @@ -58,7 +58,7 @@ impl Object for ApubCommunity { type Kind = Group; type Error = LemmyError; - fn last_refreshed_at(&self) -> Option { + fn last_refreshed_at(&self) -> Option> { Some(self.last_refreshed_at) } diff --git a/crates/apub/src/objects/instance.rs b/crates/apub/src/objects/instance.rs index 9351c6dae..a9060ad4f 100644 --- a/crates/apub/src/objects/instance.rs +++ b/crates/apub/src/objects/instance.rs @@ -16,7 +16,7 @@ use activitypub_federation::{ protocol::{values::MediaTypeHtml, verification::verify_domains_match}, traits::{Actor, Object}, }; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_api_common::{ context::LemmyContext, utils::{local_site_opt_to_slur_regex, sanitize_html_opt}, @@ -66,7 +66,7 @@ impl Object for ApubSite { type Kind = Instance; type Error = LemmyError; - fn last_refreshed_at(&self) -> Option { + fn last_refreshed_at(&self) -> Option> { Some(self.last_refreshed_at) } @@ -141,7 +141,7 @@ impl Object for ApubSite { let site_form = SiteInsertForm { name: apub.name.clone(), sidebar, - updated: apub.updated.map(|u| u.clone().naive_local()), + updated: apub.updated, icon: apub.icon.clone().map(|i| i.url.into()), banner: apub.image.clone().map(|i| i.url.into()), description, diff --git a/crates/apub/src/objects/person.rs b/crates/apub/src/objects/person.rs index d17ad235b..d4e2506db 100644 --- a/crates/apub/src/objects/person.rs +++ b/crates/apub/src/objects/person.rs @@ -17,7 +17,7 @@ use activitypub_federation::{ protocol::verification::verify_domains_match, traits::{Actor, Object}, }; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_api_common::{ context::LemmyContext, utils::{generate_outbox_url, local_site_opt_to_slur_regex, sanitize_html, sanitize_html_opt}, @@ -63,7 +63,7 @@ impl Object for ApubPerson { type Kind = Person; type Error = LemmyError; - fn last_refreshed_at(&self) -> Option { + fn last_refreshed_at(&self) -> Option> { Some(self.last_refreshed_at) } @@ -162,12 +162,11 @@ impl Object for ApubPerson { deleted: Some(false), avatar: person.icon.map(|i| i.url.into()), banner: person.image.map(|i| i.url.into()), - published: person.published.map(|u| u.naive_local()), - updated: person.updated.map(|u| u.naive_local()), + published: person.published.map(Into::into), + updated: person.updated.map(Into::into), actor_id: Some(person.id.into()), bio, local: Some(false), - admin: Some(false), bot_account: Some(person.kind == UserTypes::Service), private_key: None, public_key: person.public_key.public_key_pem, diff --git a/crates/apub/src/objects/post.rs b/crates/apub/src/objects/post.rs index df3aefed2..aee2eaf90 100644 --- a/crates/apub/src/objects/post.rs +++ b/crates/apub/src/objects/post.rs @@ -20,7 +20,7 @@ use activitypub_federation::{ traits::Object, }; use anyhow::anyhow; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use html2md::parse_html; use lemmy_api_common::{ context::LemmyContext, @@ -80,7 +80,7 @@ impl Object for ApubPost { type Kind = Page; type Error = LemmyError; - fn last_refreshed_at(&self) -> Option { + fn last_refreshed_at(&self) -> Option> { None } @@ -249,8 +249,8 @@ impl Object for ApubPost { community_id: community.id, removed: None, locked: page.comments_enabled.map(|e| !e), - published: page.published.map(|u| u.naive_local()), - updated: page.updated.map(|u| u.naive_local()), + published: page.published.map(Into::into), + updated: page.updated.map(Into::into), deleted: Some(false), nsfw: page.sensitive, embed_title, @@ -271,7 +271,7 @@ impl Object for ApubPost { .community_id(community.id) .ap_id(Some(page.id.clone().into())) .locked(page.comments_enabled.map(|e| !e)) - .updated(page.updated.map(|u| u.naive_local())) + .updated(page.updated.map(Into::into)) .build() }; diff --git a/crates/apub/src/objects/private_message.rs b/crates/apub/src/objects/private_message.rs index 9a92b0b51..2210e0b0e 100644 --- a/crates/apub/src/objects/private_message.rs +++ b/crates/apub/src/objects/private_message.rs @@ -11,7 +11,7 @@ use activitypub_federation::{ protocol::{values::MediaTypeHtml, verification::verify_domains_match}, traits::Object, }; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use lemmy_api_common::{ context::LemmyContext, utils::{check_person_block, sanitize_html}, @@ -52,7 +52,7 @@ impl Object for ApubPrivateMessage { type Kind = ChatMessage; type Error = LemmyError; - fn last_refreshed_at(&self) -> Option { + fn last_refreshed_at(&self) -> Option> { None } @@ -130,8 +130,8 @@ impl Object for ApubPrivateMessage { creator_id: creator.id, recipient_id: recipient.id, content, - published: note.published.map(|u| u.naive_local()), - updated: note.updated.map(|u| u.naive_local()), + published: note.published.map(Into::into), + updated: note.updated.map(Into::into), deleted: Some(false), read: None, ap_id: Some(note.id.into()), diff --git a/crates/apub/src/protocol/activities/block/block_user.rs b/crates/apub/src/protocol/activities/block/block_user.rs index 2cad2adcd..b958b58e1 100644 --- a/crates/apub/src/protocol/activities/block/block_user.rs +++ b/crates/apub/src/protocol/activities/block/block_user.rs @@ -10,7 +10,7 @@ use activitypub_federation::{ protocol::helpers::deserialize_one_or_many, }; use anyhow::anyhow; -use chrono::{DateTime, FixedOffset}; +use chrono::{DateTime, Utc}; use lemmy_api_common::context::LemmyContext; use lemmy_utils::error::LemmyError; use serde::{Deserialize, Serialize}; @@ -38,7 +38,7 @@ pub struct BlockUser { pub(crate) remove_data: Option, /// block reason, written to mod log pub(crate) summary: Option, - pub(crate) expires: Option>, + pub(crate) expires: Option>, } #[async_trait::async_trait] diff --git a/crates/apub/src/protocol/objects/chat_message.rs b/crates/apub/src/protocol/objects/chat_message.rs index 22bdd916a..8cb83e664 100644 --- a/crates/apub/src/protocol/objects/chat_message.rs +++ b/crates/apub/src/protocol/objects/chat_message.rs @@ -9,7 +9,7 @@ use activitypub_federation::{ values::MediaTypeHtml, }, }; -use chrono::{DateTime, FixedOffset}; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; @@ -27,8 +27,8 @@ pub struct ChatMessage { pub(crate) media_type: Option, #[serde(deserialize_with = "deserialize_skip_error", default)] pub(crate) source: Option, - pub(crate) published: Option>, - pub(crate) updated: Option>, + pub(crate) published: Option>, + pub(crate) updated: Option>, } /// https://docs.pleroma.social/backend/development/ap_extensions/#chatmessages diff --git a/crates/apub/src/protocol/objects/group.rs b/crates/apub/src/protocol/objects/group.rs index 9c679fdf1..3ee788f94 100644 --- a/crates/apub/src/protocol/objects/group.rs +++ b/crates/apub/src/protocol/objects/group.rs @@ -22,7 +22,7 @@ use activitypub_federation::{ verification::verify_domains_match, }, }; -use chrono::{DateTime, FixedOffset}; +use chrono::{DateTime, Utc}; use lemmy_api_common::{ context::LemmyContext, utils::{local_site_opt_to_slur_regex, sanitize_html, sanitize_html_opt}, @@ -73,8 +73,8 @@ pub struct Group { pub(crate) featured: Option>, #[serde(default)] pub(crate) language: Vec, - pub(crate) published: Option>, - pub(crate) updated: Option>, + pub(crate) published: Option>, + pub(crate) updated: Option>, } impl Group { @@ -107,8 +107,8 @@ impl Group { title, description, removed: None, - published: self.published.map(|u| u.naive_local()), - updated: self.updated.map(|u| u.naive_local()), + published: self.published, + updated: self.updated, deleted: Some(false), nsfw: Some(self.sensitive.unwrap_or(false)), actor_id: Some(self.id.into()), @@ -138,8 +138,8 @@ impl Group { &self.source, )), removed: None, - published: self.published.map(|u| u.naive_local()), - updated: Some(self.updated.map(|u| u.naive_local())), + published: self.published.map(Into::into), + updated: Some(self.updated.map(Into::into)), deleted: None, nsfw: Some(self.sensitive.unwrap_or(false)), actor_id: Some(self.id.into()), diff --git a/crates/apub/src/protocol/objects/instance.rs b/crates/apub/src/protocol/objects/instance.rs index 4a3d6ea2e..8c9944306 100644 --- a/crates/apub/src/protocol/objects/instance.rs +++ b/crates/apub/src/protocol/objects/instance.rs @@ -7,7 +7,7 @@ use activitypub_federation::{ kinds::actor::ApplicationType, protocol::{helpers::deserialize_skip_error, public_key::PublicKey, values::MediaTypeHtml}, }; -use chrono::{DateTime, FixedOffset}; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; use url::Url; @@ -39,6 +39,6 @@ pub struct Instance { pub(crate) image: Option, #[serde(default)] pub(crate) language: Vec, - pub(crate) published: DateTime, - pub(crate) updated: Option>, + pub(crate) published: DateTime, + pub(crate) updated: Option>, } diff --git a/crates/apub/src/protocol/objects/note.rs b/crates/apub/src/protocol/objects/note.rs index f594c14e4..259a8fcfa 100644 --- a/crates/apub/src/protocol/objects/note.rs +++ b/crates/apub/src/protocol/objects/note.rs @@ -14,7 +14,7 @@ use activitypub_federation::{ values::MediaTypeMarkdownOrHtml, }, }; -use chrono::{DateTime, FixedOffset}; +use chrono::{DateTime, Utc}; use lemmy_api_common::context::LemmyContext; use lemmy_db_schema::{ source::{community::Community, post::Post}, @@ -43,8 +43,8 @@ pub struct Note { pub(crate) media_type: Option, #[serde(deserialize_with = "deserialize_skip_error", default)] pub(crate) source: Option, - pub(crate) published: Option>, - pub(crate) updated: Option>, + pub(crate) published: Option>, + pub(crate) updated: Option>, #[serde(default)] pub(crate) tag: Vec, // lemmy extension diff --git a/crates/apub/src/protocol/objects/page.rs b/crates/apub/src/protocol/objects/page.rs index f3308b075..f7952885e 100644 --- a/crates/apub/src/protocol/objects/page.rs +++ b/crates/apub/src/protocol/objects/page.rs @@ -17,7 +17,7 @@ use activitypub_federation::{ }, traits::{ActivityHandler, Object}, }; -use chrono::{DateTime, FixedOffset}; +use chrono::{DateTime, Utc}; use itertools::Itertools; use lemmy_api_common::context::LemmyContext; use lemmy_db_schema::newtypes::DbUrl; @@ -63,8 +63,8 @@ pub struct Page { pub(crate) image: Option, pub(crate) comments_enabled: Option, pub(crate) sensitive: Option, - pub(crate) published: Option>, - pub(crate) updated: Option>, + pub(crate) published: Option>, + pub(crate) updated: Option>, pub(crate) language: Option, pub(crate) audience: Option>, } diff --git a/crates/apub/src/protocol/objects/person.rs b/crates/apub/src/protocol/objects/person.rs index ecedbcd71..cc9607c7f 100644 --- a/crates/apub/src/protocol/objects/person.rs +++ b/crates/apub/src/protocol/objects/person.rs @@ -6,7 +6,7 @@ use activitypub_federation::{ fetch::object_id::ObjectId, protocol::{helpers::deserialize_skip_error, public_key::PublicKey}, }; -use chrono::{DateTime, FixedOffset}; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; use url::Url; @@ -43,6 +43,6 @@ pub struct Person { pub(crate) image: Option, pub(crate) matrix_user_id: Option, pub(crate) endpoints: Option, - pub(crate) published: Option>, - pub(crate) updated: Option>, + pub(crate) published: Option>, + pub(crate) updated: Option>, } diff --git a/crates/db_schema/src/aggregates/structs.rs b/crates/db_schema/src/aggregates/structs.rs index 3b3612bb7..f34ff9c89 100644 --- a/crates/db_schema/src/aggregates/structs.rs +++ b/crates/db_schema/src/aggregates/structs.rs @@ -8,10 +8,10 @@ use crate::schema::{ post_aggregates, site_aggregates, }; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[cfg(feature = "full")] use ts_rs::TS; - #[derive(PartialEq, Debug, Serialize, Deserialize, Clone)] #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))] #[cfg_attr(feature = "full", diesel(table_name = comment_aggregates))] @@ -24,7 +24,7 @@ pub struct CommentAggregates { pub score: i64, pub upvotes: i64, pub downvotes: i64, - pub published: chrono::NaiveDateTime, + pub published: DateTime, /// The total number of children in this comment branch. pub child_count: i32, pub hot_rank: i32, @@ -46,7 +46,7 @@ pub struct CommunityAggregates { pub subscribers: i64, pub posts: i64, pub comments: i64, - pub published: chrono::NaiveDateTime, + pub published: DateTime, /// The number of users with any activity in the last day. pub users_active_day: i64, /// The number of users with any activity in the last week. @@ -86,11 +86,11 @@ pub struct PostAggregates { pub score: i64, pub upvotes: i64, pub downvotes: i64, - pub published: chrono::NaiveDateTime, + pub published: DateTime, /// A newest comment time, limited to 2 days, to prevent necrobumping - pub newest_comment_time_necro: chrono::NaiveDateTime, + pub newest_comment_time_necro: DateTime, /// The time of the newest comment in the post. - pub newest_comment_time: chrono::NaiveDateTime, + pub newest_comment_time: DateTime, /// If the post is featured on the community. pub featured_community: bool, /// If the post is featured on the site / to local. @@ -115,7 +115,7 @@ pub struct PersonPostAggregates { /// /// This is updated to the current post comment count every time they view a post. pub read_comments: i64, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[derive(Clone, Default)] @@ -125,7 +125,7 @@ pub struct PersonPostAggregatesForm { pub person_id: PersonId, pub post_id: PostId, pub read_comments: i64, - pub published: Option, + pub published: Option>, } #[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)] diff --git a/crates/db_schema/src/diesel_ltree.patch b/crates/db_schema/src/diesel_ltree.patch index ee6b241c6..669d9a717 100644 --- a/crates/db_schema/src/diesel_ltree.patch +++ b/crates/db_schema/src/diesel_ltree.patch @@ -14,7 +14,7 @@ index 255c6422..f2ccf5e2 100644 #[diesel(postgres_type(name = "registration_mode_enum"))] pub struct RegistrationModeEnum; @@ -76,13 +76,13 @@ diesel::table! { - published -> Timestamp, + published -> Timestamptz, } } diff --git a/crates/db_schema/src/impls/email_verification.rs b/crates/db_schema/src/impls/email_verification.rs index 59c5b9536..c5a8792fb 100644 --- a/crates/db_schema/src/impls/email_verification.rs +++ b/crates/db_schema/src/impls/email_verification.rs @@ -13,7 +13,9 @@ use diesel::{ dsl::{now, IntervalDsl}, insert_into, result::Error, + sql_types::Timestamptz, ExpressionMethods, + IntoSql, QueryDsl, }; use diesel_async::RunQueryDsl; @@ -31,7 +33,7 @@ impl EmailVerification { let conn = &mut get_conn(pool).await?; email_verification .filter(verification_token.eq(token)) - .filter(published.gt(now - 7.days())) + .filter(published.gt(now.into_sql::() - 7.days())) .first::(conn) .await } diff --git a/crates/db_schema/src/impls/instance.rs b/crates/db_schema/src/impls/instance.rs index 3cdcac171..6c79bbef1 100644 --- a/crates/db_schema/src/impls/instance.rs +++ b/crates/db_schema/src/impls/instance.rs @@ -3,12 +3,12 @@ use crate::{ newtypes::InstanceId, schema::{federation_allowlist, federation_blocklist, instance, local_site, site}, source::instance::{Instance, InstanceForm}, - utils::{functions::lower, get_conn, naive_now, DbPool}, + utils::{functions::lower, get_conn, naive_now, now, DbPool}, }; use diesel::{ dsl::{count_star, insert_into, now}, result::Error, - sql_types::{Nullable, Timestamp}, + sql_types::{Nullable, Timestamptz}, ExpressionMethods, NullableExpressionMethods, QueryDsl, @@ -68,7 +68,7 @@ impl Instance { let conn = &mut get_conn(pool).await?; instance::table .select(instance::domain) - .filter(coalesce(instance::updated, instance::published).lt(now - 3.days())) + .filter(coalesce(instance::updated, instance::published).lt(now() - 3.days())) .get_results(conn) .await } @@ -142,4 +142,4 @@ impl Instance { } } -sql_function! { fn coalesce(x: Nullable, y: Timestamp) -> Timestamp; } +sql_function! { fn coalesce(x: Nullable, y: Timestamptz) -> Timestamptz; } diff --git a/crates/db_schema/src/impls/password_reset_request.rs b/crates/db_schema/src/impls/password_reset_request.rs index a5a8fc494..5600ffc66 100644 --- a/crates/db_schema/src/impls/password_reset_request.rs +++ b/crates/db_schema/src/impls/password_reset_request.rs @@ -8,7 +8,9 @@ use crate::{ use diesel::{ dsl::{insert_into, now, IntervalDsl}, result::Error, + sql_types::Timestamptz, ExpressionMethods, + IntoSql, QueryDsl, }; use diesel_async::RunQueryDsl; @@ -59,7 +61,7 @@ impl PasswordResetRequest { let conn = &mut get_conn(pool).await?; password_reset_request .filter(token.eq(token_)) - .filter(published.gt(now - 1.days())) + .filter(published.gt(now.into_sql::() - 1.days())) .first::(conn) .await } @@ -71,7 +73,7 @@ impl PasswordResetRequest { let conn = &mut get_conn(pool).await?; password_reset_request .filter(local_user_id.eq(user_id)) - .filter(published.gt(now - 1.days())) + .filter(published.gt(now.into_sql::() - 1.days())) .count() .get_result(conn) .await diff --git a/crates/db_schema/src/impls/person.rs b/crates/db_schema/src/impls/person.rs index d8a80596f..723062aeb 100644 --- a/crates/db_schema/src/impls/person.rs +++ b/crates/db_schema/src/impls/person.rs @@ -11,6 +11,7 @@ use crate::{ traits::{ApubActor, Crud, Followable}, utils::{functions::lower, get_conn, naive_now, DbPool}, }; +use chrono::{DateTime, Utc}; use diesel::{dsl::insert_into, result::Error, ExpressionMethods, JoinOnDsl, QueryDsl}; use diesel_async::RunQueryDsl; @@ -89,7 +90,7 @@ impl Person { } } -pub fn is_banned(banned_: bool, expires: Option) -> bool { +pub fn is_banned(banned_: bool, expires: Option>) -> bool { if let Some(expires) = expires { banned_ && expires.gt(&naive_now()) } else { @@ -240,7 +241,6 @@ mod tests { bio: None, local: true, bot_account: false, - admin: false, private_key: None, public_key: "nada".to_owned(), last_refreshed_at: inserted_person.published, diff --git a/crates/db_schema/src/schema.rs b/crates/db_schema/src/schema.rs index 66502d943..19d64e72d 100644 --- a/crates/db_schema/src/schema.rs +++ b/crates/db_schema/src/schema.rs @@ -24,7 +24,7 @@ diesel::table! { admin_person_id -> Int4, post_id -> Int4, reason -> Nullable, - when_ -> Timestamp, + when_ -> Timestamptz, } } @@ -33,7 +33,7 @@ diesel::table! { id -> Int4, admin_person_id -> Int4, reason -> Nullable, - when_ -> Timestamp, + when_ -> Timestamptz, } } @@ -42,7 +42,7 @@ diesel::table! { id -> Int4, admin_person_id -> Int4, reason -> Nullable, - when_ -> Timestamp, + when_ -> Timestamptz, } } @@ -52,7 +52,7 @@ diesel::table! { admin_person_id -> Int4, community_id -> Int4, reason -> Nullable, - when_ -> Timestamp, + when_ -> Timestamptz, } } @@ -61,7 +61,7 @@ diesel::table! { id -> Int4, uuid -> Uuid, answer -> Text, - published -> Timestamp, + published -> Timestamptz, } } @@ -75,8 +75,8 @@ diesel::table! { post_id -> Int4, content -> Text, removed -> Bool, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, deleted -> Bool, #[max_length = 255] ap_id -> Varchar, @@ -94,7 +94,7 @@ diesel::table! { score -> Int8, upvotes -> Int8, downvotes -> Int8, - published -> Timestamp, + published -> Timestamptz, child_count -> Int4, hot_rank -> Int4, controversy_rank -> Float8, @@ -108,7 +108,7 @@ diesel::table! { comment_id -> Int4, post_id -> Int4, score -> Int2, - published -> Timestamp, + published -> Timestamptz, } } @@ -118,7 +118,7 @@ diesel::table! { recipient_id -> Int4, comment_id -> Int4, read -> Bool, - published -> Timestamp, + published -> Timestamptz, } } @@ -131,8 +131,8 @@ diesel::table! { reason -> Text, resolved -> Bool, resolver_id -> Nullable, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, } } @@ -141,7 +141,7 @@ diesel::table! { id -> Int4, comment_id -> Int4, person_id -> Int4, - published -> Timestamp, + published -> Timestamptz, } } @@ -154,8 +154,8 @@ diesel::table! { title -> Varchar, description -> Nullable, removed -> Bool, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, deleted -> Bool, nsfw -> Bool, #[max_length = 255] @@ -163,7 +163,7 @@ diesel::table! { local -> Bool, private_key -> Nullable, public_key -> Text, - last_refreshed_at -> Timestamp, + last_refreshed_at -> Timestamptz, icon -> Nullable, banner -> Nullable, #[max_length = 255] @@ -189,7 +189,7 @@ diesel::table! { subscribers -> Int8, posts -> Int8, comments -> Int8, - published -> Timestamp, + published -> Timestamptz, users_active_day -> Int8, users_active_week -> Int8, users_active_month -> Int8, @@ -203,7 +203,7 @@ diesel::table! { id -> Int4, person_id -> Int4, community_id -> Int4, - published -> Timestamp, + published -> Timestamptz, } } @@ -212,7 +212,7 @@ diesel::table! { id -> Int4, community_id -> Int4, person_id -> Int4, - published -> Timestamp, + published -> Timestamptz, pending -> Bool, } } @@ -230,7 +230,7 @@ diesel::table! { id -> Int4, community_id -> Int4, person_id -> Int4, - published -> Timestamp, + published -> Timestamptz, } } @@ -239,8 +239,8 @@ diesel::table! { id -> Int4, community_id -> Int4, person_id -> Int4, - published -> Timestamp, - expires -> Nullable, + published -> Timestamptz, + expires -> Nullable, } } @@ -253,8 +253,8 @@ diesel::table! { image_url -> Text, alt_text -> Text, category -> Text, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, } } @@ -273,7 +273,7 @@ diesel::table! { local_user_id -> Int4, email -> Text, verification_token -> Text, - published -> Timestamp, + published -> Timestamptz, } } @@ -281,8 +281,8 @@ diesel::table! { federation_allowlist (id) { id -> Int4, instance_id -> Int4, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, } } @@ -290,8 +290,8 @@ diesel::table! { federation_blocklist (id) { id -> Int4, instance_id -> Int4, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, } } @@ -311,8 +311,8 @@ diesel::table! { id -> Int4, #[max_length = 255] domain -> Varchar, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, #[max_length = 255] software -> Nullable, #[max_length = 255] @@ -355,8 +355,8 @@ diesel::table! { captcha_enabled -> Bool, #[max_length = 255] captcha_difficulty -> Varchar, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, registration_mode -> RegistrationModeEnum, reports_email_admins -> Bool, } @@ -378,8 +378,8 @@ diesel::table! { comment_per_second -> Int4, search -> Int4, search_per_second -> Int4, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, } } @@ -401,7 +401,7 @@ diesel::table! { interface_language -> Varchar, show_avatars -> Bool, send_notifications_to_email -> Bool, - validator_time -> Timestamp, + validator_time -> Timestamptz, show_scores -> Bool, show_bot_accounts -> Bool, show_read_posts -> Bool, @@ -411,9 +411,10 @@ diesel::table! { totp_2fa_secret -> Nullable, totp_2fa_url -> Nullable, open_links_in_new_tab -> Bool, - infinite_scroll_enabled -> Bool, blur_nsfw -> Bool, auto_expand -> Bool, + infinite_scroll_enabled -> Bool, + admin -> Bool, } } @@ -431,7 +432,7 @@ diesel::table! { mod_person_id -> Int4, other_person_id -> Int4, removed -> Bool, - when_ -> Timestamp, + when_ -> Timestamptz, } } @@ -442,7 +443,7 @@ diesel::table! { other_person_id -> Int4, community_id -> Int4, removed -> Bool, - when_ -> Timestamp, + when_ -> Timestamptz, } } @@ -453,8 +454,8 @@ diesel::table! { other_person_id -> Int4, reason -> Nullable, banned -> Bool, - expires -> Nullable, - when_ -> Timestamp, + expires -> Nullable, + when_ -> Timestamptz, } } @@ -466,8 +467,8 @@ diesel::table! { community_id -> Int4, reason -> Nullable, banned -> Bool, - expires -> Nullable, - when_ -> Timestamp, + expires -> Nullable, + when_ -> Timestamptz, } } @@ -477,7 +478,7 @@ diesel::table! { mod_person_id -> Int4, post_id -> Int4, featured -> Bool, - when_ -> Timestamp, + when_ -> Timestamptz, is_featured_community -> Bool, } } @@ -487,7 +488,7 @@ diesel::table! { id -> Int4, community_id -> Int4, mod_person_id -> Int4, - when_ -> Timestamp, + when_ -> Timestamptz, reason -> Nullable, hidden -> Bool, } @@ -499,7 +500,7 @@ diesel::table! { mod_person_id -> Int4, post_id -> Int4, locked -> Bool, - when_ -> Timestamp, + when_ -> Timestamptz, } } @@ -510,7 +511,7 @@ diesel::table! { comment_id -> Int4, reason -> Nullable, removed -> Bool, - when_ -> Timestamp, + when_ -> Timestamptz, } } @@ -521,8 +522,8 @@ diesel::table! { community_id -> Int4, reason -> Nullable, removed -> Bool, - expires -> Nullable, - when_ -> Timestamp, + expires -> Nullable, + when_ -> Timestamptz, } } @@ -533,7 +534,7 @@ diesel::table! { post_id -> Int4, reason -> Nullable, removed -> Bool, - when_ -> Timestamp, + when_ -> Timestamptz, } } @@ -543,7 +544,7 @@ diesel::table! { mod_person_id -> Int4, other_person_id -> Int4, community_id -> Int4, - when_ -> Timestamp, + when_ -> Timestamptz, } } @@ -551,7 +552,7 @@ diesel::table! { password_reset_request (id) { id -> Int4, token -> Text, - published -> Timestamp, + published -> Timestamptz, local_user_id -> Int4, } } @@ -565,15 +566,15 @@ diesel::table! { display_name -> Nullable, avatar -> Nullable, banned -> Bool, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, #[max_length = 255] actor_id -> Varchar, bio -> Nullable, local -> Bool, private_key -> Nullable, public_key -> Text, - last_refreshed_at -> Timestamp, + last_refreshed_at -> Timestamptz, banner -> Nullable, deleted -> Bool, #[max_length = 255] @@ -581,9 +582,8 @@ diesel::table! { #[max_length = 255] shared_inbox_url -> Nullable, matrix_user_id -> Nullable, - admin -> Bool, bot_account -> Bool, - ban_expires -> Nullable, + ban_expires -> Nullable, instance_id -> Int4, } } @@ -603,7 +603,7 @@ diesel::table! { person_ban (id) { id -> Int4, person_id -> Int4, - published -> Timestamp, + published -> Timestamptz, } } @@ -612,7 +612,7 @@ diesel::table! { id -> Int4, person_id -> Int4, target_id -> Int4, - published -> Timestamp, + published -> Timestamptz, } } @@ -621,7 +621,7 @@ diesel::table! { id -> Int4, person_id -> Int4, follower_id -> Int4, - published -> Timestamp, + published -> Timestamptz, pending -> Bool, } } @@ -632,7 +632,7 @@ diesel::table! { recipient_id -> Int4, comment_id -> Int4, read -> Bool, - published -> Timestamp, + published -> Timestamptz, } } @@ -642,7 +642,7 @@ diesel::table! { person_id -> Int4, post_id -> Int4, read_comments -> Int8, - published -> Timestamp, + published -> Timestamptz, } } @@ -658,8 +658,8 @@ diesel::table! { community_id -> Int4, removed -> Bool, locked -> Bool, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, deleted -> Bool, nsfw -> Bool, embed_title -> Nullable, @@ -683,9 +683,9 @@ diesel::table! { score -> Int8, upvotes -> Int8, downvotes -> Int8, - published -> Timestamp, - newest_comment_time_necro -> Timestamp, - newest_comment_time -> Timestamp, + published -> Timestamptz, + newest_comment_time_necro -> Timestamptz, + newest_comment_time -> Timestamptz, featured_community -> Bool, featured_local -> Bool, hot_rank -> Int4, @@ -702,7 +702,7 @@ diesel::table! { post_id -> Int4, person_id -> Int4, score -> Int2, - published -> Timestamp, + published -> Timestamptz, } } @@ -711,7 +711,7 @@ diesel::table! { id -> Int4, post_id -> Int4, person_id -> Int4, - published -> Timestamp, + published -> Timestamptz, } } @@ -727,8 +727,8 @@ diesel::table! { reason -> Text, resolved -> Bool, resolver_id -> Nullable, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, } } @@ -737,7 +737,7 @@ diesel::table! { id -> Int4, post_id -> Int4, person_id -> Int4, - published -> Timestamp, + published -> Timestamptz, } } @@ -749,8 +749,8 @@ diesel::table! { content -> Text, deleted -> Bool, read -> Bool, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, #[max_length = 255] ap_id -> Varchar, local -> Bool, @@ -766,8 +766,8 @@ diesel::table! { reason -> Text, resolved -> Bool, resolver_id -> Nullable, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, } } @@ -775,7 +775,7 @@ diesel::table! { received_activity (id) { id -> Int8, ap_id -> Text, - published -> Timestamp, + published -> Timestamptz, } } @@ -786,7 +786,7 @@ diesel::table! { answer -> Text, admin_id -> Nullable, deny_reason -> Nullable, - published -> Timestamp, + published -> Timestamptz, } } @@ -806,7 +806,7 @@ diesel::table! { ap_id -> Text, data -> Json, sensitive -> Bool, - published -> Timestamp, + published -> Timestamptz, send_inboxes -> Array>, send_community_followers_of -> Nullable, send_all_instances -> Bool, @@ -821,15 +821,15 @@ diesel::table! { #[max_length = 20] name -> Varchar, sidebar -> Nullable, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, icon -> Nullable, banner -> Nullable, #[max_length = 150] description -> Nullable, #[max_length = 255] actor_id -> Varchar, - last_refreshed_at -> Timestamp, + last_refreshed_at -> Timestamptz, #[max_length = 255] inbox_url -> Varchar, private_key -> Nullable, @@ -866,8 +866,8 @@ diesel::table! { id -> Int4, local_site_id -> Int4, content -> Text, - published -> Timestamp, - updated -> Nullable, + published -> Timestamptz, + updated -> Nullable, } } diff --git a/crates/db_schema/src/source/activity.rs b/crates/db_schema/src/source/activity.rs index dcebbacb1..040dfd73f 100644 --- a/crates/db_schema/src/source/activity.rs +++ b/crates/db_schema/src/source/activity.rs @@ -2,6 +2,7 @@ use crate::{ newtypes::{CommunityId, DbUrl}, schema::sent_activity, }; +use chrono::{DateTime, Utc}; use diesel::{ deserialize::FromSql, pg::{Pg, PgValue}, @@ -74,7 +75,7 @@ pub struct SentActivity { pub ap_id: DbUrl, pub data: Value, pub sensitive: bool, - pub published: chrono::NaiveDateTime, + pub published: DateTime, pub send_inboxes: Vec>, pub send_community_followers_of: Option, pub send_all_instances: bool, @@ -108,7 +109,7 @@ pub enum ActorType { pub struct ReceivedActivity { pub id: i64, pub ap_id: DbUrl, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } // https://vasilakisfil.social/blog/2020/05/09/rust-diesel-jsonb/ diff --git a/crates/db_schema/src/source/captcha_answer.rs b/crates/db_schema/src/source/captcha_answer.rs index e3e64c4eb..b7e9636c4 100644 --- a/crates/db_schema/src/source/captcha_answer.rs +++ b/crates/db_schema/src/source/captcha_answer.rs @@ -1,5 +1,6 @@ #[cfg(feature = "full")] use crate::schema::captcha_answer; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; use uuid::Uuid; @@ -12,7 +13,7 @@ pub struct CaptchaAnswer { pub id: i32, pub uuid: Uuid, pub answer: String, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[skip_serializing_none] diff --git a/crates/db_schema/src/source/comment.rs b/crates/db_schema/src/source/comment.rs index f76e2fba7..efe3b7cdf 100644 --- a/crates/db_schema/src/source/comment.rs +++ b/crates/db_schema/src/source/comment.rs @@ -3,6 +3,7 @@ use crate::newtypes::LtreeDef; use crate::newtypes::{CommentId, DbUrl, LanguageId, PersonId, PostId}; #[cfg(feature = "full")] use crate::schema::{comment, comment_like, comment_saved}; +use chrono::{DateTime, Utc}; #[cfg(feature = "full")] use diesel_ltree::Ltree; use serde::{Deserialize, Serialize}; @@ -25,8 +26,8 @@ pub struct Comment { pub content: String, /// Whether the comment has been removed. pub removed: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, /// Whether the comment has been deleted by its creator. pub deleted: bool, /// The federated activity id / ap_id. @@ -57,8 +58,8 @@ pub struct CommentInsertForm { #[builder(!default)] pub content: String, pub removed: Option, - pub published: Option, - pub updated: Option, + pub published: Option>, + pub updated: Option>, pub deleted: Option, pub ap_id: Option, pub local: Option, @@ -73,7 +74,7 @@ pub struct CommentUpdateForm { pub content: Option, pub removed: Option, // Don't use a default naive_now here, because the create function does a lot of comment updates - pub updated: Option>, + pub updated: Option>>, pub deleted: Option, pub ap_id: Option, pub local: Option, @@ -91,7 +92,7 @@ pub struct CommentLike { pub comment_id: CommentId, pub post_id: PostId, // TODO this is redundant pub score: i16, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[derive(Clone)] @@ -112,7 +113,7 @@ pub struct CommentSaved { pub id: i32, pub comment_id: CommentId, pub person_id: PersonId, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] diff --git a/crates/db_schema/src/source/comment_reply.rs b/crates/db_schema/src/source/comment_reply.rs index 63c79ae27..30d4ae919 100644 --- a/crates/db_schema/src/source/comment_reply.rs +++ b/crates/db_schema/src/source/comment_reply.rs @@ -1,6 +1,7 @@ use crate::newtypes::{CommentId, CommentReplyId, PersonId}; #[cfg(feature = "full")] use crate::schema::comment_reply; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[cfg(feature = "full")] use ts_rs::TS; @@ -16,7 +17,7 @@ pub struct CommentReply { pub recipient_id: PersonId, pub comment_id: CommentId, pub read: bool, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] diff --git a/crates/db_schema/src/source/comment_report.rs b/crates/db_schema/src/source/comment_report.rs index 1483cd812..23697adce 100644 --- a/crates/db_schema/src/source/comment_report.rs +++ b/crates/db_schema/src/source/comment_report.rs @@ -1,6 +1,7 @@ use crate::newtypes::{CommentId, CommentReportId, PersonId}; #[cfg(feature = "full")] use crate::schema::comment_report; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -21,8 +22,8 @@ pub struct CommentReport { pub reason: String, pub resolved: bool, pub resolver_id: Option, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, } #[derive(Clone)] diff --git a/crates/db_schema/src/source/community.rs b/crates/db_schema/src/source/community.rs index 5d56c36a5..c00a065a6 100644 --- a/crates/db_schema/src/source/community.rs +++ b/crates/db_schema/src/source/community.rs @@ -4,6 +4,7 @@ use crate::{ newtypes::{CommunityId, DbUrl, InstanceId, PersonId}, source::placeholder_apub_url, }; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -25,8 +26,8 @@ pub struct Community { pub description: Option, /// Whether the community is removed by a mod. pub removed: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, /// Whether the community has been deleted by its creator. pub deleted: bool, /// Whether its an NSFW community. @@ -40,7 +41,7 @@ pub struct Community { #[serde(skip)] pub public_key: String, #[serde(skip)] - pub last_refreshed_at: chrono::NaiveDateTime, + pub last_refreshed_at: DateTime, /// A URL for an icon. pub icon: Option, /// A URL for a banner. @@ -75,15 +76,15 @@ pub struct CommunityInsertForm { pub title: String, pub description: Option, pub removed: Option, - pub published: Option, - pub updated: Option, + pub published: Option>, + pub updated: Option>, pub deleted: Option, pub nsfw: Option, pub actor_id: Option, pub local: Option, pub private_key: Option, pub public_key: String, - pub last_refreshed_at: Option, + pub last_refreshed_at: Option>, pub icon: Option, pub banner: Option, pub followers_url: Option, @@ -104,15 +105,15 @@ pub struct CommunityUpdateForm { pub title: Option, pub description: Option>, pub removed: Option, - pub published: Option, - pub updated: Option>, + pub published: Option>, + pub updated: Option>>, pub deleted: Option, pub nsfw: Option, pub actor_id: Option, pub local: Option, pub public_key: Option, pub private_key: Option>, - pub last_refreshed_at: Option, + pub last_refreshed_at: Option>, pub icon: Option>, pub banner: Option>, pub followers_url: Option, @@ -135,7 +136,7 @@ pub struct CommunityModerator { pub id: i32, pub community_id: CommunityId, pub person_id: PersonId, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[derive(Clone)] @@ -157,8 +158,8 @@ pub struct CommunityPersonBan { pub id: i32, pub community_id: CommunityId, pub person_id: PersonId, - pub published: chrono::NaiveDateTime, - pub expires: Option, + pub published: DateTime, + pub expires: Option>, } #[derive(Clone)] @@ -167,7 +168,7 @@ pub struct CommunityPersonBan { pub struct CommunityPersonBanForm { pub community_id: CommunityId, pub person_id: PersonId, - pub expires: Option>, + pub expires: Option>>, } #[derive(PartialEq, Eq, Debug)] @@ -181,7 +182,7 @@ pub struct CommunityFollower { pub id: i32, pub community_id: CommunityId, pub person_id: PersonId, - pub published: chrono::NaiveDateTime, + pub published: DateTime, pub pending: bool, } diff --git a/crates/db_schema/src/source/community_block.rs b/crates/db_schema/src/source/community_block.rs index 3efdce4f2..628e77ade 100644 --- a/crates/db_schema/src/source/community_block.rs +++ b/crates/db_schema/src/source/community_block.rs @@ -1,6 +1,7 @@ use crate::newtypes::{CommunityBlockId, CommunityId, PersonId}; #[cfg(feature = "full")] use crate::schema::community_block; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] @@ -14,7 +15,7 @@ pub struct CommunityBlock { pub id: CommunityBlockId, pub person_id: PersonId, pub community_id: CommunityId, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] diff --git a/crates/db_schema/src/source/custom_emoji.rs b/crates/db_schema/src/source/custom_emoji.rs index 5f8060e71..015004cae 100644 --- a/crates/db_schema/src/source/custom_emoji.rs +++ b/crates/db_schema/src/source/custom_emoji.rs @@ -1,6 +1,7 @@ use crate::newtypes::{CustomEmojiId, DbUrl, LocalSiteId}; #[cfg(feature = "full")] use crate::schema::custom_emoji; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -24,8 +25,8 @@ pub struct CustomEmoji { pub image_url: DbUrl, pub alt_text: String, pub category: String, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, } #[derive(Debug, Clone, TypedBuilder)] diff --git a/crates/db_schema/src/source/email_verification.rs b/crates/db_schema/src/source/email_verification.rs index 0ee5b47d0..af117e0bd 100644 --- a/crates/db_schema/src/source/email_verification.rs +++ b/crates/db_schema/src/source/email_verification.rs @@ -1,6 +1,7 @@ use crate::newtypes::LocalUserId; #[cfg(feature = "full")] use crate::schema::email_verification; +use chrono::{DateTime, Utc}; #[derive(Clone)] #[cfg_attr(feature = "full", derive(Queryable, Identifiable))] @@ -10,7 +11,7 @@ pub struct EmailVerification { pub local_user_id: LocalUserId, pub email: String, pub verification_code: String, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] diff --git a/crates/db_schema/src/source/federation_allowlist.rs b/crates/db_schema/src/source/federation_allowlist.rs index 309e24e36..534e1b02e 100644 --- a/crates/db_schema/src/source/federation_allowlist.rs +++ b/crates/db_schema/src/source/federation_allowlist.rs @@ -1,6 +1,7 @@ use crate::newtypes::InstanceId; #[cfg(feature = "full")] use crate::schema::federation_allowlist; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use std::fmt::Debug; @@ -14,8 +15,8 @@ use std::fmt::Debug; pub struct FederationAllowList { pub id: i32, pub instance_id: InstanceId, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, } #[derive(Clone, Default)] @@ -23,5 +24,5 @@ pub struct FederationAllowList { #[cfg_attr(feature = "full", diesel(table_name = federation_allowlist))] pub struct FederationAllowListForm { pub instance_id: InstanceId, - pub updated: Option, + pub updated: Option>, } diff --git a/crates/db_schema/src/source/federation_blocklist.rs b/crates/db_schema/src/source/federation_blocklist.rs index 2ee5ec0f0..0cf615d7b 100644 --- a/crates/db_schema/src/source/federation_blocklist.rs +++ b/crates/db_schema/src/source/federation_blocklist.rs @@ -1,6 +1,7 @@ use crate::newtypes::InstanceId; #[cfg(feature = "full")] use crate::schema::federation_blocklist; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use std::fmt::Debug; @@ -14,8 +15,8 @@ use std::fmt::Debug; pub struct FederationBlockList { pub id: i32, pub instance_id: InstanceId, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, } #[derive(Clone, Default)] @@ -23,5 +24,5 @@ pub struct FederationBlockList { #[cfg_attr(feature = "full", diesel(table_name = federation_blocklist))] pub struct FederationBlockListForm { pub instance_id: InstanceId, - pub updated: Option, + pub updated: Option>, } diff --git a/crates/db_schema/src/source/instance.rs b/crates/db_schema/src/source/instance.rs index db3bc277c..ac40849d3 100644 --- a/crates/db_schema/src/source/instance.rs +++ b/crates/db_schema/src/source/instance.rs @@ -1,6 +1,7 @@ use crate::newtypes::InstanceId; #[cfg(feature = "full")] use crate::schema::instance; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; use std::fmt::Debug; @@ -17,8 +18,8 @@ use typed_builder::TypedBuilder; pub struct Instance { pub id: InstanceId, pub domain: String, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, pub software: Option, pub version: Option, } @@ -32,5 +33,5 @@ pub struct InstanceForm { pub domain: String, pub software: Option, pub version: Option, - pub updated: Option, + pub updated: Option>, } diff --git a/crates/db_schema/src/source/local_site.rs b/crates/db_schema/src/source/local_site.rs index a57bf503c..e5945e86f 100644 --- a/crates/db_schema/src/source/local_site.rs +++ b/crates/db_schema/src/source/local_site.rs @@ -5,6 +5,7 @@ use crate::{ ListingType, RegistrationMode, }; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -54,8 +55,8 @@ pub struct LocalSite { pub captcha_enabled: bool, /// The captcha difficulty. pub captcha_difficulty: String, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, pub registration_mode: RegistrationMode, /// Whether to email admins on new reports. pub reports_email_admins: bool, @@ -112,5 +113,5 @@ pub struct LocalSiteUpdateForm { pub captcha_difficulty: Option, pub registration_mode: Option, pub reports_email_admins: Option, - pub updated: Option>, + pub updated: Option>>, } diff --git a/crates/db_schema/src/source/local_site_rate_limit.rs b/crates/db_schema/src/source/local_site_rate_limit.rs index ab14bfd83..b16d4e134 100644 --- a/crates/db_schema/src/source/local_site_rate_limit.rs +++ b/crates/db_schema/src/source/local_site_rate_limit.rs @@ -1,6 +1,7 @@ use crate::newtypes::LocalSiteId; #[cfg(feature = "full")] use crate::schema::local_site_rate_limit; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -32,8 +33,8 @@ pub struct LocalSiteRateLimit { pub comment_per_second: i32, pub search: i32, pub search_per_second: i32, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, } #[derive(Clone, TypedBuilder)] @@ -73,5 +74,5 @@ pub struct LocalSiteRateLimitUpdateForm { pub comment_per_second: Option, pub search: Option, pub search_per_second: Option, - pub updated: Option>, + pub updated: Option>>, } diff --git a/crates/db_schema/src/source/local_user.rs b/crates/db_schema/src/source/local_user.rs index 4e668bddf..8440531c6 100644 --- a/crates/db_schema/src/source/local_user.rs +++ b/crates/db_schema/src/source/local_user.rs @@ -5,6 +5,7 @@ use crate::{ ListingType, SortType, }; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -34,7 +35,7 @@ pub struct LocalUser { pub show_avatars: bool, pub send_notifications_to_email: bool, /// A validation ID used in logging out sessions. - pub validator_time: chrono::NaiveDateTime, + pub validator_time: DateTime, /// Whether to show comment / post scores. pub show_scores: bool, /// Whether to show bot accounts. @@ -57,6 +58,8 @@ pub struct LocalUser { pub auto_expand: bool, /// Whether infinite scroll is enabled. pub infinite_scroll_enabled: bool, + /// Whether the person is an admin. + pub admin: bool, } #[derive(Clone, TypedBuilder)] @@ -88,6 +91,7 @@ pub struct LocalUserInsertForm { pub blur_nsfw: Option, pub auto_expand: Option, pub infinite_scroll_enabled: Option, + pub admin: Option, } #[derive(Clone, Default)] @@ -115,4 +119,5 @@ pub struct LocalUserUpdateForm { pub blur_nsfw: Option, pub auto_expand: Option, pub infinite_scroll_enabled: Option, + pub admin: Option, } diff --git a/crates/db_schema/src/source/moderator.rs b/crates/db_schema/src/source/moderator.rs index 63049de2b..7e2ff2867 100644 --- a/crates/db_schema/src/source/moderator.rs +++ b/crates/db_schema/src/source/moderator.rs @@ -17,6 +17,7 @@ use crate::schema::{ mod_remove_post, mod_transfer_community, }; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -34,7 +35,7 @@ pub struct ModRemovePost { pub post_id: PostId, pub reason: Option, pub removed: bool, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -56,7 +57,7 @@ pub struct ModLockPost { pub mod_person_id: PersonId, pub post_id: PostId, pub locked: bool, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -77,7 +78,7 @@ pub struct ModFeaturePost { pub mod_person_id: PersonId, pub post_id: PostId, pub featured: bool, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, pub is_featured_community: bool, } @@ -102,7 +103,7 @@ pub struct ModRemoveComment { pub comment_id: CommentId, pub reason: Option, pub removed: bool, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -126,8 +127,8 @@ pub struct ModRemoveCommunity { pub community_id: CommunityId, pub reason: Option, pub removed: bool, - pub expires: Option, - pub when_: chrono::NaiveDateTime, + pub expires: Option>, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -137,7 +138,7 @@ pub struct ModRemoveCommunityForm { pub community_id: CommunityId, pub reason: Option, pub removed: Option, - pub expires: Option, + pub expires: Option>, } #[skip_serializing_none] @@ -153,8 +154,8 @@ pub struct ModBanFromCommunity { pub community_id: CommunityId, pub reason: Option, pub banned: bool, - pub expires: Option, - pub when_: chrono::NaiveDateTime, + pub expires: Option>, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -165,7 +166,7 @@ pub struct ModBanFromCommunityForm { pub community_id: CommunityId, pub reason: Option, pub banned: Option, - pub expires: Option, + pub expires: Option>, } #[skip_serializing_none] @@ -180,8 +181,8 @@ pub struct ModBan { pub other_person_id: PersonId, pub reason: Option, pub banned: bool, - pub expires: Option, - pub when_: chrono::NaiveDateTime, + pub expires: Option>, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -203,7 +204,7 @@ pub struct ModHideCommunity { pub id: i32, pub community_id: CommunityId, pub mod_person_id: PersonId, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, pub reason: Option, pub hidden: bool, } @@ -215,7 +216,7 @@ pub struct ModBanForm { pub other_person_id: PersonId, pub reason: Option, pub banned: Option, - pub expires: Option, + pub expires: Option>, } #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] @@ -229,7 +230,7 @@ pub struct ModAddCommunity { pub other_person_id: PersonId, pub community_id: CommunityId, pub removed: bool, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -251,7 +252,7 @@ pub struct ModTransferCommunity { pub mod_person_id: PersonId, pub other_person_id: PersonId, pub community_id: CommunityId, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -272,7 +273,7 @@ pub struct ModAdd { pub mod_person_id: PersonId, pub other_person_id: PersonId, pub removed: bool, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -293,7 +294,7 @@ pub struct AdminPurgePerson { pub id: i32, pub admin_person_id: PersonId, pub reason: Option, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -313,7 +314,7 @@ pub struct AdminPurgeCommunity { pub id: i32, pub admin_person_id: PersonId, pub reason: Option, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -334,7 +335,7 @@ pub struct AdminPurgePost { pub admin_person_id: PersonId, pub community_id: CommunityId, pub reason: Option, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -356,7 +357,7 @@ pub struct AdminPurgeComment { pub admin_person_id: PersonId, pub post_id: PostId, pub reason: Option, - pub when_: chrono::NaiveDateTime, + pub when_: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] diff --git a/crates/db_schema/src/source/password_reset_request.rs b/crates/db_schema/src/source/password_reset_request.rs index 6e1b572d3..648c7164c 100644 --- a/crates/db_schema/src/source/password_reset_request.rs +++ b/crates/db_schema/src/source/password_reset_request.rs @@ -1,6 +1,7 @@ use crate::newtypes::LocalUserId; #[cfg(feature = "full")] use crate::schema::password_reset_request; +use chrono::{DateTime, Utc}; #[derive(PartialEq, Eq, Debug)] #[cfg_attr(feature = "full", derive(Queryable, Identifiable))] @@ -8,7 +9,7 @@ use crate::schema::password_reset_request; pub struct PasswordResetRequest { pub id: i32, pub token: String, - pub published: chrono::NaiveDateTime, + pub published: DateTime, pub local_user_id: LocalUserId, } diff --git a/crates/db_schema/src/source/person.rs b/crates/db_schema/src/source/person.rs index 7772bb118..339ce5adf 100644 --- a/crates/db_schema/src/source/person.rs +++ b/crates/db_schema/src/source/person.rs @@ -4,6 +4,7 @@ use crate::{ newtypes::{DbUrl, InstanceId, PersonId}, source::placeholder_apub_url, }; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -25,8 +26,8 @@ pub struct Person { pub avatar: Option, /// Whether the person is banned. pub banned: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, /// The federated actor_id. pub actor_id: DbUrl, /// An optional bio, in markdown. @@ -38,7 +39,7 @@ pub struct Person { #[serde(skip)] pub public_key: String, #[serde(skip)] - pub last_refreshed_at: chrono::NaiveDateTime, + pub last_refreshed_at: DateTime, /// A URL for a banner. pub banner: Option, /// Whether the person is deleted. @@ -49,12 +50,10 @@ pub struct Person { pub shared_inbox_url: Option, /// A matrix id, usually given an @person:matrix.org pub matrix_user_id: Option, - /// Whether the person is an admin. - pub admin: bool, /// Whether the person is a bot account. pub bot_account: bool, /// When their ban, if it exists, expires, if at all. - pub ban_expires: Option, + pub ban_expires: Option>, pub instance_id: InstanceId, } @@ -72,21 +71,20 @@ pub struct PersonInsertForm { pub display_name: Option, pub avatar: Option, pub banned: Option, - pub published: Option, - pub updated: Option, + pub published: Option>, + pub updated: Option>, pub actor_id: Option, pub bio: Option, pub local: Option, pub private_key: Option, - pub last_refreshed_at: Option, + pub last_refreshed_at: Option>, pub banner: Option, pub deleted: Option, pub inbox_url: Option, pub shared_inbox_url: Option, pub matrix_user_id: Option, - pub admin: Option, pub bot_account: Option, - pub ban_expires: Option, + pub ban_expires: Option>, } #[derive(Clone, Default)] @@ -96,21 +94,20 @@ pub struct PersonUpdateForm { pub display_name: Option>, pub avatar: Option>, pub banned: Option, - pub updated: Option>, + pub updated: Option>>, pub actor_id: Option, pub bio: Option>, pub local: Option, pub public_key: Option, pub private_key: Option>, - pub last_refreshed_at: Option, + pub last_refreshed_at: Option>, pub banner: Option>, pub deleted: Option, pub inbox_url: Option, pub shared_inbox_url: Option>, pub matrix_user_id: Option>, - pub admin: Option, pub bot_account: Option, - pub ban_expires: Option>, + pub ban_expires: Option>>, } #[derive(PartialEq, Eq, Debug)] @@ -121,7 +118,7 @@ pub struct PersonFollower { pub id: i32, pub person_id: PersonId, pub follower_id: PersonId, - pub published: chrono::NaiveDateTime, + pub published: DateTime, pub pending: bool, } diff --git a/crates/db_schema/src/source/person_block.rs b/crates/db_schema/src/source/person_block.rs index f9bd6e565..3380fbfc3 100644 --- a/crates/db_schema/src/source/person_block.rs +++ b/crates/db_schema/src/source/person_block.rs @@ -1,6 +1,7 @@ use crate::newtypes::{PersonBlockId, PersonId}; #[cfg(feature = "full")] use crate::schema::person_block; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] @@ -11,7 +12,7 @@ pub struct PersonBlock { pub id: PersonBlockId, pub person_id: PersonId, pub target_id: PersonId, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] diff --git a/crates/db_schema/src/source/person_mention.rs b/crates/db_schema/src/source/person_mention.rs index 5b7732c6d..b9d7ccf8e 100644 --- a/crates/db_schema/src/source/person_mention.rs +++ b/crates/db_schema/src/source/person_mention.rs @@ -1,6 +1,7 @@ use crate::newtypes::{CommentId, PersonId, PersonMentionId}; #[cfg(feature = "full")] use crate::schema::person_mention; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[cfg(feature = "full")] use ts_rs::TS; @@ -16,7 +17,7 @@ pub struct PersonMention { pub recipient_id: PersonId, pub comment_id: CommentId, pub read: bool, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] diff --git a/crates/db_schema/src/source/post.rs b/crates/db_schema/src/source/post.rs index de56f1187..4fe8e34c6 100644 --- a/crates/db_schema/src/source/post.rs +++ b/crates/db_schema/src/source/post.rs @@ -1,6 +1,7 @@ use crate::newtypes::{CommunityId, DbUrl, LanguageId, PersonId, PostId}; #[cfg(feature = "full")] use crate::schema::{post, post_like, post_read, post_saved}; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -27,8 +28,8 @@ pub struct Post { pub removed: bool, /// Whether the post is locked. pub locked: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, /// Whether the post is deleted. pub deleted: bool, /// Whether the post is NSFW. @@ -71,8 +72,8 @@ pub struct PostInsertForm { pub body: Option, pub removed: Option, pub locked: Option, - pub updated: Option, - pub published: Option, + pub updated: Option>, + pub published: Option>, pub deleted: Option, pub embed_title: Option, pub embed_description: Option, @@ -95,8 +96,8 @@ pub struct PostUpdateForm { pub body: Option>, pub removed: Option, pub locked: Option, - pub published: Option, - pub updated: Option>, + pub published: Option>, + pub updated: Option>>, pub deleted: Option, pub embed_title: Option>, pub embed_description: Option>, @@ -118,7 +119,7 @@ pub struct PostLike { pub post_id: PostId, pub person_id: PersonId, pub score: i16, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[derive(Clone)] @@ -138,7 +139,7 @@ pub struct PostSaved { pub id: i32, pub post_id: PostId, pub person_id: PersonId, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] @@ -156,7 +157,7 @@ pub struct PostRead { pub id: i32, pub post_id: PostId, pub person_id: PersonId, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))] diff --git a/crates/db_schema/src/source/post_report.rs b/crates/db_schema/src/source/post_report.rs index 74e418670..9f5f53d95 100644 --- a/crates/db_schema/src/source/post_report.rs +++ b/crates/db_schema/src/source/post_report.rs @@ -1,6 +1,7 @@ use crate::newtypes::{DbUrl, PersonId, PostId, PostReportId}; #[cfg(feature = "full")] use crate::schema::post_report; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -26,8 +27,8 @@ pub struct PostReport { pub reason: String, pub resolved: bool, pub resolver_id: Option, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, } #[derive(Clone, Default)] diff --git a/crates/db_schema/src/source/private_message.rs b/crates/db_schema/src/source/private_message.rs index bd8c73e30..033bfbe20 100644 --- a/crates/db_schema/src/source/private_message.rs +++ b/crates/db_schema/src/source/private_message.rs @@ -1,6 +1,7 @@ use crate::newtypes::{DbUrl, PersonId, PrivateMessageId}; #[cfg(feature = "full")] use crate::schema::private_message; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -24,8 +25,8 @@ pub struct PrivateMessage { pub content: String, pub deleted: bool, pub read: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, pub ap_id: DbUrl, pub local: bool, } @@ -43,8 +44,8 @@ pub struct PrivateMessageInsertForm { pub content: String, pub deleted: Option, pub read: Option, - pub published: Option, - pub updated: Option, + pub published: Option>, + pub updated: Option>, pub ap_id: Option, pub local: Option, } @@ -56,8 +57,8 @@ pub struct PrivateMessageUpdateForm { pub content: Option, pub deleted: Option, pub read: Option, - pub published: Option, - pub updated: Option>, + pub published: Option>, + pub updated: Option>>, pub ap_id: Option, pub local: Option, } diff --git a/crates/db_schema/src/source/private_message_report.rs b/crates/db_schema/src/source/private_message_report.rs index a9ee8998b..0afc5b039 100644 --- a/crates/db_schema/src/source/private_message_report.rs +++ b/crates/db_schema/src/source/private_message_report.rs @@ -1,6 +1,7 @@ use crate::newtypes::{PersonId, PrivateMessageId, PrivateMessageReportId}; #[cfg(feature = "full")] use crate::schema::private_message_report; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -25,8 +26,8 @@ pub struct PrivateMessageReport { pub reason: String, pub resolved: bool, pub resolver_id: Option, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, } #[derive(Clone)] diff --git a/crates/db_schema/src/source/registration_application.rs b/crates/db_schema/src/source/registration_application.rs index f57e6883d..1ed78703b 100644 --- a/crates/db_schema/src/source/registration_application.rs +++ b/crates/db_schema/src/source/registration_application.rs @@ -1,6 +1,7 @@ use crate::newtypes::{LocalUserId, PersonId}; #[cfg(feature = "full")] use crate::schema::registration_application; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -18,7 +19,7 @@ pub struct RegistrationApplication { pub answer: String, pub admin_id: Option, pub deny_reason: Option, - pub published: chrono::NaiveDateTime, + pub published: DateTime, } #[cfg_attr(feature = "full", derive(Insertable))] diff --git a/crates/db_schema/src/source/site.rs b/crates/db_schema/src/source/site.rs index e45ece706..0e175dc71 100644 --- a/crates/db_schema/src/source/site.rs +++ b/crates/db_schema/src/source/site.rs @@ -1,7 +1,7 @@ use crate::newtypes::{DbUrl, InstanceId, SiteId}; #[cfg(feature = "full")] use crate::schema::site; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -19,8 +19,8 @@ pub struct Site { pub name: String, /// A sidebar for the site in markdown. pub sidebar: Option, - pub published: NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, /// An icon URL. pub icon: Option, /// A banner url. @@ -30,7 +30,7 @@ pub struct Site { /// The federated actor_id. pub actor_id: DbUrl, /// The time the site was last refreshed. - pub last_refreshed_at: NaiveDateTime, + pub last_refreshed_at: DateTime, /// The site inbox pub inbox_url: DbUrl, pub private_key: Option, @@ -46,12 +46,12 @@ pub struct SiteInsertForm { #[builder(!default)] pub name: String, pub sidebar: Option, - pub updated: Option, + pub updated: Option>, pub icon: Option, pub banner: Option, pub description: Option, pub actor_id: Option, - pub last_refreshed_at: Option, + pub last_refreshed_at: Option>, pub inbox_url: Option, pub private_key: Option, pub public_key: Option, @@ -65,13 +65,13 @@ pub struct SiteInsertForm { pub struct SiteUpdateForm { pub name: Option, pub sidebar: Option>, - pub updated: Option>, + pub updated: Option>>, // when you want to null out a column, you have to send Some(None)), since sending None means you just don't want to update that column. pub icon: Option>, pub banner: Option>, pub description: Option>, pub actor_id: Option, - pub last_refreshed_at: Option, + pub last_refreshed_at: Option>, pub inbox_url: Option, pub private_key: Option>, pub public_key: Option, diff --git a/crates/db_schema/src/source/tagline.rs b/crates/db_schema/src/source/tagline.rs index 114e7f5bd..564c6dc80 100644 --- a/crates/db_schema/src/source/tagline.rs +++ b/crates/db_schema/src/source/tagline.rs @@ -1,6 +1,7 @@ use crate::newtypes::LocalSiteId; #[cfg(feature = "full")] use crate::schema::tagline; +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; #[cfg(feature = "full")] @@ -20,8 +21,8 @@ pub struct Tagline { pub id: i32, pub local_site_id: LocalSiteId, pub content: String, - pub published: chrono::NaiveDateTime, - pub updated: Option, + pub published: DateTime, + pub updated: Option>, } #[derive(Clone, Default)] @@ -30,5 +31,5 @@ pub struct Tagline { pub struct TaglineForm { pub local_site_id: LocalSiteId, pub content: String, - pub updated: Option, + pub updated: Option>, } diff --git a/crates/db_schema/src/utils.rs b/crates/db_schema/src/utils.rs index 892e69542..6534b4163 100644 --- a/crates/db_schema/src/utils.rs +++ b/crates/db_schema/src/utils.rs @@ -8,15 +8,17 @@ use crate::{ SortType, }; use activitypub_federation::{fetch::object_id::ObjectId, traits::Object}; -use chrono::NaiveDateTime; +use chrono::{DateTime, Utc}; use deadpool::Runtime; use diesel::{ backend::Backend, deserialize::FromSql, + helper_types::AsExprOf, pg::Pg, result::{ConnectionError, ConnectionResult, Error as DieselError, Error::QueryBuilderError}, serialize::{Output, ToSql}, - sql_types::Text, + sql_types::{Text, Timestamptz}, + IntoSql, PgConnection, }; use diesel_async::{ @@ -340,8 +342,8 @@ pub fn get_database_url(settings: Option<&Settings>) -> String { } } -pub fn naive_now() -> NaiveDateTime { - chrono::prelude::Utc::now().naive_utc() +pub fn naive_now() -> DateTime { + chrono::prelude::Utc::now() } pub fn post_to_comment_sort_type(sort: SortType) -> CommentSortType { @@ -380,10 +382,10 @@ static EMAIL_REGEX: Lazy = Lazy::new(|| { }); pub mod functions { - use diesel::sql_types::{BigInt, Text, Timestamp}; + use diesel::sql_types::{BigInt, Text, Timestamptz}; sql_function! { - fn hot_rank(score: BigInt, time: Timestamp) -> Integer; + fn hot_rank(score: BigInt, time: Timestamptz) -> Integer; } sql_function! { @@ -424,6 +426,11 @@ where } } +pub fn now() -> AsExprOf { + // https://github.com/diesel-rs/diesel/issues/1514 + diesel::dsl::now.into_sql::() +} + pub type ResultFuture<'a, T> = BoxFuture<'a, Result>; pub trait ReadFn<'a, T: JoinView, Args>: diff --git a/crates/db_views/src/comment_report_view.rs b/crates/db_views/src/comment_report_view.rs index 98ff555b7..c8f4e3e41 100644 --- a/crates/db_views/src/comment_report_view.rs +++ b/crates/db_views/src/comment_report_view.rs @@ -1,4 +1,4 @@ -use crate::structs::CommentReportView; +use crate::structs::{CommentReportView, LocalUserView}; use diesel::{ dsl::now, pg::Pg, @@ -38,7 +38,7 @@ use lemmy_db_schema::{ fn queries<'a>() -> Queries< impl ReadFn<'a, CommentReportView, (CommentReportId, PersonId)>, - impl ListFn<'a, CommentReportView, (CommentReportQuery, &'a Person)>, + impl ListFn<'a, CommentReportView, (CommentReportQuery, &'a LocalUserView)>, > { let all_joins = |query: comment_report::BoxedQuery<'a, Pg>, my_person_id: PersonId| { query @@ -93,8 +93,9 @@ fn queries<'a>() -> Queries< .await }; - let list = move |mut conn: DbConn<'a>, (options, my_person): (CommentReportQuery, &'a Person)| async move { - let mut query = all_joins(comment_report::table.into_boxed(), my_person.id) + let list = move |mut conn: DbConn<'a>, + (options, user): (CommentReportQuery, &'a LocalUserView)| async move { + let mut query = all_joins(comment_report::table.into_boxed(), user.person.id) .left_join( community_person_ban::table.on( community::id @@ -125,13 +126,13 @@ fn queries<'a>() -> Queries< .offset(offset); // If its not an admin, get only the ones you mod - if !my_person.admin { + if !user.local_user.admin { query .inner_join( community_moderator::table.on( community_moderator::community_id .eq(post::community_id) - .and(community_moderator::person_id.eq(my_person.id)), + .and(community_moderator::person_id.eq(user.person.id)), ), ) .load::<::JoinTuple>(&mut conn) @@ -213,9 +214,9 @@ impl CommentReportQuery { pub async fn list( self, pool: &mut DbPool<'_>, - my_person: &Person, + user: &LocalUserView, ) -> Result, Error> { - queries().list(pool, (self, my_person)).await + queries().list(pool, (self, user)).await } } @@ -254,7 +255,10 @@ mod tests { #![allow(clippy::unwrap_used)] #![allow(clippy::indexing_slicing)] - use crate::comment_report_view::{CommentReportQuery, CommentReportView}; + use crate::{ + comment_report_view::{CommentReportQuery, CommentReportView}, + structs::LocalUserView, + }; use lemmy_db_schema::{ aggregates::structs::CommentAggregates, source::{ @@ -262,6 +266,7 @@ mod tests { comment_report::{CommentReport, CommentReportForm}, community::{Community, CommunityInsertForm, CommunityModerator, CommunityModeratorForm}, instance::Instance, + local_user::{LocalUser, LocalUserInsertForm}, person::{Person, PersonInsertForm}, post::{Post, PostInsertForm}, }, @@ -288,6 +293,17 @@ mod tests { let inserted_timmy = Person::create(pool, &new_person).await.unwrap(); + let new_local_user = LocalUserInsertForm::builder() + .person_id(inserted_timmy.id) + .password_encrypted("123".to_string()) + .build(); + let timmy_local_user = LocalUser::create(pool, &new_local_user).await.unwrap(); + let timmy_view = LocalUserView { + local_user: timmy_local_user, + person: inserted_timmy.clone(), + counts: Default::default(), + }; + let new_person_2 = PersonInsertForm::builder() .name("sara_crv".into()) .public_key("pubkey".to_string()) @@ -412,7 +428,6 @@ mod tests { local: true, banned: false, deleted: false, - admin: false, bot_account: false, bio: None, banner: None, @@ -436,7 +451,6 @@ mod tests { local: true, banned: false, deleted: false, - admin: false, bot_account: false, bio: None, banner: None, @@ -480,7 +494,6 @@ mod tests { local: true, banned: false, deleted: false, - admin: false, bot_account: false, bio: None, banner: None, @@ -497,7 +510,7 @@ mod tests { // Do a batch read of timmys reports let reports = CommentReportQuery::default() - .list(pool, &inserted_timmy) + .list(pool, &timmy_view) .await .unwrap(); @@ -546,7 +559,6 @@ mod tests { local: true, banned: false, deleted: false, - admin: false, bot_account: false, bio: None, banner: None, @@ -572,7 +584,7 @@ mod tests { unresolved_only: (true), ..Default::default() } - .list(pool, &inserted_timmy) + .list(pool, &timmy_view) .await .unwrap(); assert_eq!(reports_after_resolve[0], expected_sara_report_view); diff --git a/crates/db_views/src/comment_view.rs b/crates/db_views/src/comment_view.rs index be7e043a2..716d563a7 100644 --- a/crates/db_views/src/comment_view.rs +++ b/crates/db_views/src/comment_view.rs @@ -205,7 +205,10 @@ fn queries<'a>() -> Queries< query = query.filter(comment::deleted.eq(false)); } - let is_admin = options.local_user.map(|l| l.person.admin).unwrap_or(false); + let is_admin = options + .local_user + .map(|l| l.local_user.admin) + .unwrap_or(false); // only show removed comments to admin when viewing user profile if !(options.is_profile_view && is_admin) { query = query.filter(comment::removed.eq(false)); @@ -847,7 +850,6 @@ mod tests { local: true, banned: false, deleted: false, - admin: false, bot_account: false, bio: None, banner: None, diff --git a/crates/db_views/src/local_user_view.rs b/crates/db_views/src/local_user_view.rs index 23a8b8f05..d0d461545 100644 --- a/crates/db_views/src/local_user_view.rs +++ b/crates/db_views/src/local_user_view.rs @@ -62,7 +62,7 @@ fn queries<'a>( ListMode::AdminsWithEmails => { local_user::table .filter(local_user::email.is_not_null()) - .filter(person::admin.eq(true)) + .filter(local_user::admin.eq(true)) .inner_join(person::table) .inner_join(person_aggregates::table.on(person::id.eq(person_aggregates::person_id))) .select(selection) diff --git a/crates/db_views/src/post_report_view.rs b/crates/db_views/src/post_report_view.rs index 07037f940..da264a79c 100644 --- a/crates/db_views/src/post_report_view.rs +++ b/crates/db_views/src/post_report_view.rs @@ -1,4 +1,4 @@ -use crate::structs::PostReportView; +use crate::structs::{LocalUserView, PostReportView}; use diesel::{ pg::Pg, result::Error, @@ -42,7 +42,7 @@ type PostReportViewTuple = ( fn queries<'a>() -> Queries< impl ReadFn<'a, PostReportView, (PostReportId, PersonId)>, - impl ListFn<'a, PostReportView, (PostReportQuery, &'a Person)>, + impl ListFn<'a, PostReportView, (PostReportQuery, &'a LocalUserView)>, > { let all_joins = |query: post_report::BoxedQuery<'a, Pg>, my_person_id: PersonId| { query @@ -91,8 +91,8 @@ fn queries<'a>() -> Queries< .await }; - let list = move |mut conn: DbConn<'a>, (options, my_person): (PostReportQuery, &'a Person)| async move { - let mut query = all_joins(post_report::table.into_boxed(), my_person.id); + let list = move |mut conn: DbConn<'a>, (options, user): (PostReportQuery, &'a LocalUserView)| async move { + let mut query = all_joins(post_report::table.into_boxed(), user.person.id); if let Some(community_id) = options.community_id { query = query.filter(post::community_id.eq(community_id)); @@ -110,13 +110,13 @@ fn queries<'a>() -> Queries< .offset(offset); // If its not an admin, get only the ones you mod - if !my_person.admin { + if !user.local_user.admin { query .inner_join( community_moderator::table.on( community_moderator::community_id .eq(post::community_id) - .and(community_moderator::person_id.eq(my_person.id)), + .and(community_moderator::person_id.eq(user.person.id)), ), ) .load::(&mut conn) @@ -193,9 +193,9 @@ impl PostReportQuery { pub async fn list( self, pool: &mut DbPool<'_>, - my_person: &Person, + user: &LocalUserView, ) -> Result, Error> { - queries().list(pool, (self, my_person)).await + queries().list(pool, (self, user)).await } } @@ -221,12 +221,16 @@ mod tests { #![allow(clippy::unwrap_used)] #![allow(clippy::indexing_slicing)] - use crate::post_report_view::{PostReportQuery, PostReportView}; + use crate::{ + post_report_view::{PostReportQuery, PostReportView}, + structs::LocalUserView, + }; use lemmy_db_schema::{ aggregates::structs::PostAggregates, source::{ community::{Community, CommunityInsertForm, CommunityModerator, CommunityModeratorForm}, instance::Instance, + local_user::{LocalUser, LocalUserInsertForm}, person::{Person, PersonInsertForm}, post::{Post, PostInsertForm}, post_report::{PostReport, PostReportForm}, @@ -254,6 +258,17 @@ mod tests { let inserted_timmy = Person::create(pool, &new_person).await.unwrap(); + let new_local_user = LocalUserInsertForm::builder() + .person_id(inserted_timmy.id) + .password_encrypted("123".to_string()) + .build(); + let timmy_local_user = LocalUser::create(pool, &new_local_user).await.unwrap(); + let timmy_view = LocalUserView { + local_user: timmy_local_user, + person: inserted_timmy.clone(), + counts: Default::default(), + }; + let new_person_2 = PersonInsertForm::builder() .name("sara_prv".into()) .public_key("pubkey".to_string()) @@ -369,7 +384,6 @@ mod tests { local: true, banned: false, deleted: false, - admin: false, bot_account: false, bio: None, banner: None, @@ -393,7 +407,6 @@ mod tests { local: true, banned: false, deleted: false, - admin: false, bot_account: false, bio: None, banner: None, @@ -445,7 +458,6 @@ mod tests { local: true, banned: false, deleted: false, - admin: false, bot_account: false, bio: None, banner: None, @@ -462,7 +474,7 @@ mod tests { // Do a batch read of timmys reports let reports = PostReportQuery::default() - .list(pool, &inserted_timmy) + .list(pool, &timmy_view) .await .unwrap(); @@ -509,7 +521,6 @@ mod tests { local: true, banned: false, deleted: false, - admin: false, bot_account: false, bio: None, banner: None, @@ -535,7 +546,7 @@ mod tests { unresolved_only: (true), ..Default::default() } - .list(pool, &inserted_timmy) + .list(pool, &timmy_view) .await .unwrap(); assert_eq!(reports_after_resolve[0], expected_sara_report_view); diff --git a/crates/db_views/src/post_view.rs b/crates/db_views/src/post_view.rs index f7add4cec..e2a0672c6 100644 --- a/crates/db_views/src/post_view.rs +++ b/crates/db_views/src/post_view.rs @@ -1,13 +1,14 @@ use crate::structs::{LocalUserView, PostView}; use diesel::{ debug_query, - dsl::{now, IntervalDsl}, + dsl::IntervalDsl, pg::Pg, result::Error, sql_function, - sql_types, + sql_types::{self, Timestamptz}, BoolExpressionMethods, ExpressionMethods, + IntoSql, JoinOnDsl, NullableExpressionMethods, PgTextExpressionMethods, @@ -217,7 +218,10 @@ fn queries<'a>() -> Queries< .filter(post::deleted.eq(false)); } - let is_admin = options.local_user.map(|l| l.person.admin).unwrap_or(false); + let is_admin = options + .local_user + .map(|l| l.local_user.admin) + .unwrap_or(false); // only show removed posts to admin when viewing user profile if !(options.is_profile_view && is_admin) { query = query @@ -324,6 +328,7 @@ fn queries<'a>() -> Queries< query = query.filter(person_block::person_id.is_null()); } } + let now = diesel::dsl::now.into_sql::(); query = match options.sort.unwrap_or(SortType::Hot) { SortType::Active => query @@ -945,7 +950,7 @@ mod tests { assert_eq!(1, post_listings_no_admin.len()); // Removed post is shown to admins on profile page - data.local_user_view.person.admin = true; + data.local_user_view.local_user.admin = true; let post_listings_is_admin = PostQuery { sort: Some(SortType::New), local_user: Some(&data.local_user_view), @@ -1071,7 +1076,6 @@ mod tests { avatar: None, actor_id: inserted_person.actor_id.clone(), local: true, - admin: false, bot_account: false, banned: false, deleted: false, diff --git a/crates/db_views/src/private_message_view.rs b/crates/db_views/src/private_message_view.rs index 58f1f3f8a..c1eeabab8 100644 --- a/crates/db_views/src/private_message_view.rs +++ b/crates/db_views/src/private_message_view.rs @@ -178,7 +178,6 @@ mod tests { let timmy_form = PersonInsertForm::builder() .name("timmy_rav".into()) - .admin(Some(true)) .public_key("pubkey".to_string()) .instance_id(instance.id) .build(); diff --git a/crates/db_views/src/registration_application_view.rs b/crates/db_views/src/registration_application_view.rs index 46556317f..13317ad1f 100644 --- a/crates/db_views/src/registration_application_view.rs +++ b/crates/db_views/src/registration_application_view.rs @@ -184,7 +184,6 @@ mod tests { let timmy_person_form = PersonInsertForm::builder() .name("timmy_rav".into()) - .admin(Some(true)) .public_key("pubkey".to_string()) .instance_id(inserted_instance.id) .build(); @@ -194,6 +193,7 @@ mod tests { let timmy_local_user_form = LocalUserInsertForm::builder() .person_id(inserted_timmy_person.id) .password_encrypted("nada".to_string()) + .admin(Some(true)) .build(); let _inserted_timmy_local_user = LocalUser::create(pool, &timmy_local_user_form) @@ -289,6 +289,7 @@ mod tests { password_encrypted: inserted_sara_local_user.password_encrypted, open_links_in_new_tab: inserted_sara_local_user.open_links_in_new_tab, infinite_scroll_enabled: inserted_sara_local_user.infinite_scroll_enabled, + admin: false, }, creator: Person { id: inserted_sara_person.id, @@ -301,7 +302,6 @@ mod tests { banned: false, ban_expires: None, deleted: false, - admin: false, bot_account: false, bio: None, banner: None, @@ -380,7 +380,6 @@ mod tests { banned: false, ban_expires: None, deleted: false, - admin: true, bot_account: false, bio: None, banner: None, diff --git a/crates/db_views_actor/src/person_view.rs b/crates/db_views_actor/src/person_view.rs index dd4edcaf0..493aab27a 100644 --- a/crates/db_views_actor/src/person_view.rs +++ b/crates/db_views_actor/src/person_view.rs @@ -1,10 +1,10 @@ use crate::structs::PersonView; use diesel::{ - dsl::now, pg::Pg, result::Error, BoolExpressionMethods, ExpressionMethods, + NullableExpressionMethods, PgTextExpressionMethods, QueryDsl, }; @@ -13,10 +13,10 @@ use lemmy_db_schema::{ aggregates::structs::PersonAggregates, newtypes::PersonId, schema, - schema::{person, person_aggregates}, + schema::{local_user, person, person_aggregates}, source::person::Person, traits::JoinView, - utils::{fuzzy_search, get_conn, limit_and_offset, DbConn, DbPool, ListFn, Queries, ReadFn}, + utils::{fuzzy_search, get_conn, limit_and_offset, now, DbConn, DbPool, ListFn, Queries, ReadFn}, PersonSortType, }; @@ -33,6 +33,7 @@ fn queries<'a>( let all_joins = |query: person::BoxedQuery<'a, Pg>| { query .inner_join(person_aggregates::table) + .left_join(local_user::table) .select((person::all_columns, person_aggregates::all_columns)) }; @@ -47,7 +48,7 @@ fn queries<'a>( match mode { ListMode::Admins => { query = query - .filter(person::admin.eq(true)) + .filter(local_user::admin.eq(true)) .filter(person::deleted.eq(false)) .order_by(person::published); } @@ -57,7 +58,7 @@ fn queries<'a>( person::banned.eq(true).and( person::ban_expires .is_null() - .or(person::ban_expires.gt(now)), + .or(person::ban_expires.gt(now().nullable())), ), ) .filter(person::deleted.eq(false)); @@ -95,9 +96,13 @@ impl PersonView { } pub async fn is_admin(pool: &mut DbPool<'_>, person_id: PersonId) -> Result { - use schema::person::dsl::{admin, id, person}; + use schema::{ + local_user::dsl::admin, + person::dsl::{id, person}, + }; let conn = &mut get_conn(pool).await?; let is_admin = person + .inner_join(local_user::table) .filter(id.eq(person_id)) .select(admin) .first::(conn) diff --git a/crates/routes/src/feeds.rs b/crates/routes/src/feeds.rs index 96e718631..49cef6d41 100644 --- a/crates/routes/src/feeds.rs +++ b/crates/routes/src/feeds.rs @@ -1,6 +1,6 @@ use actix_web::{error::ErrorBadRequest, web, Error, HttpRequest, HttpResponse, Result}; use anyhow::anyhow; -use chrono::{DateTime, NaiveDateTime, Utc}; +use chrono::{DateTime, Utc}; use lemmy_api_common::context::LemmyContext; use lemmy_db_schema::{ newtypes::LocalUserId, @@ -449,7 +449,7 @@ fn create_reply_and_mention_items( #[tracing::instrument(skip_all)] fn build_item( creator_name: &str, - published: &NaiveDateTime, + published: &DateTime, url: &str, content: &str, protocol_and_hostname: &str, @@ -460,7 +460,7 @@ fn build_item( i.author(format!( "/u/{creator_name} (link)" )); - let dt = DateTime::::from_utc(*published, Utc); + let dt = published; i.pub_date(dt.to_rfc2822()); i.comments(url.to_owned()); let guid = GuidBuilder::default().permalink(true).value(url).build(); @@ -487,7 +487,7 @@ fn create_post_items( dc_extension.creators(vec![p.creator.actor_id.to_string()]); - let dt = DateTime::::from_utc(p.post.published, Utc); + let dt = p.post.published; i.pub_date(dt.to_rfc2822()); let post_url = format!("{}/post/{}", protocol_and_hostname, p.post.id); diff --git a/crates/utils/src/claims.rs b/crates/utils/src/claims.rs index 77a720694..cebd422ac 100644 --- a/crates/utils/src/claims.rs +++ b/crates/utils/src/claims.rs @@ -2,7 +2,6 @@ use crate::error::LemmyError; use chrono::Utc; use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, TokenData, Validation}; use serde::{Deserialize, Serialize}; - type Jwt = String; #[derive(Debug, Serialize, Deserialize)] diff --git a/crates/utils/src/utils/time.rs b/crates/utils/src/utils/time.rs index c1e167651..1f7ebe145 100644 --- a/crates/utils/src/utils/time.rs +++ b/crates/utils/src/utils/time.rs @@ -1,12 +1,12 @@ -use chrono::{DateTime, FixedOffset, NaiveDateTime}; +use chrono::{DateTime, TimeZone, Utc}; -pub fn naive_from_unix(time: i64) -> NaiveDateTime { - NaiveDateTime::from_timestamp_opt(time, 0).expect("convert datetime") +pub fn naive_from_unix(time: i64) -> DateTime { + Utc + .timestamp_opt(time, 0) + .single() + .expect("convert datetime") } -pub fn convert_datetime(datetime: NaiveDateTime) -> DateTime { - DateTime::::from_utc( - datetime, - FixedOffset::east_opt(0).expect("create fixed offset"), - ) +pub fn convert_datetime(datetime: DateTime) -> DateTime { + datetime } diff --git a/migrations/2023-08-01-101826_admin_flag_local_user/down.sql b/migrations/2023-08-01-101826_admin_flag_local_user/down.sql new file mode 100644 index 000000000..8ec229be7 --- /dev/null +++ b/migrations/2023-08-01-101826_admin_flag_local_user/down.sql @@ -0,0 +1,16 @@ +ALTER TABLE person + ADD COLUMN admin boolean DEFAULT FALSE NOT NULL; + +UPDATE + person +SET + admin = TRUE +FROM + local_user +WHERE + local_user.person_id = person.id + AND local_user.admin; + +ALTER TABLE local_user + DROP COLUMN admin; + diff --git a/migrations/2023-08-01-101826_admin_flag_local_user/up.sql b/migrations/2023-08-01-101826_admin_flag_local_user/up.sql new file mode 100644 index 000000000..be5bdf4dc --- /dev/null +++ b/migrations/2023-08-01-101826_admin_flag_local_user/up.sql @@ -0,0 +1,16 @@ +ALTER TABLE local_user + ADD COLUMN admin boolean DEFAULT FALSE NOT NULL; + +UPDATE + local_user +SET + admin = TRUE +FROM + person +WHERE + local_user.person_id = person.id + AND person.admin; + +ALTER TABLE person + DROP COLUMN admin; + diff --git a/migrations/2023-08-02-174444_fix-timezones/down.sql b/migrations/2023-08-02-174444_fix-timezones/down.sql new file mode 100644 index 000000000..c81afa9d5 --- /dev/null +++ b/migrations/2023-08-02-174444_fix-timezones/down.sql @@ -0,0 +1,346 @@ +SET timezone TO utc; + +ALTER TABLE community_moderator + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE community_follower + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE person_ban + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE community_person_ban + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE community_person_ban + ALTER COLUMN expires TYPE timestamp + USING expires; + +ALTER TABLE person + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE person + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE person + ALTER COLUMN last_refreshed_at TYPE timestamp + USING last_refreshed_at; + +ALTER TABLE person + ALTER COLUMN ban_expires TYPE timestamp + USING ban_expires; + +ALTER TABLE post_like + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE post_saved + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE post_read + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE comment_like + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE comment_saved + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE comment + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE comment + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE mod_remove_post + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE mod_lock_post + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE mod_remove_comment + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE mod_remove_community + ALTER COLUMN expires TYPE timestamp + USING expires; + +ALTER TABLE mod_remove_community + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE mod_ban_from_community + ALTER COLUMN expires TYPE timestamp + USING expires; + +ALTER TABLE mod_ban_from_community + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE mod_ban + ALTER COLUMN expires TYPE timestamp + USING expires; + +ALTER TABLE mod_ban + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE mod_add_community + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE mod_add + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE person_mention + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE mod_feature_post + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE password_reset_request + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE private_message + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE private_message + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE sent_activity + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE received_activity + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE community + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE community + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE community + ALTER COLUMN last_refreshed_at TYPE timestamp + USING last_refreshed_at; + +ALTER TABLE post + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE post + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE comment_report + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE comment_report + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE post_report + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE post_report + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE post_aggregates + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE post_aggregates + ALTER COLUMN newest_comment_time_necro TYPE timestamp + USING newest_comment_time_necro; + +ALTER TABLE post_aggregates + ALTER COLUMN newest_comment_time TYPE timestamp + USING newest_comment_time; + +ALTER TABLE comment_aggregates + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE community_block + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE community_aggregates + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE mod_transfer_community + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE person_block + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE local_user + ALTER COLUMN validator_time TYPE timestamp + USING validator_time; + +ALTER TABLE admin_purge_person + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE email_verification + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE admin_purge_community + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE admin_purge_post + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE admin_purge_comment + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE registration_application + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE mod_hide_community + ALTER COLUMN when_ TYPE timestamp + USING when_; + +ALTER TABLE site + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE site + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE site + ALTER COLUMN last_refreshed_at TYPE timestamp + USING last_refreshed_at; + +ALTER TABLE comment_reply + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE person_post_aggregates + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE private_message_report + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE private_message_report + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE local_site + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE local_site + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE federation_allowlist + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE federation_allowlist + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE federation_blocklist + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE federation_blocklist + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE local_site_rate_limit + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE local_site_rate_limit + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE person_follower + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE tagline + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE tagline + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE custom_emoji + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE custom_emoji + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE instance + ALTER COLUMN published TYPE timestamp + USING published; + +ALTER TABLE instance + ALTER COLUMN updated TYPE timestamp + USING updated; + +ALTER TABLE captcha_answer + ALTER COLUMN published TYPE timestamp + USING published; + +CREATE OR REPLACE FUNCTION hot_rank (score numeric, published timestamp without time zone) + RETURNS integer + AS $$ +DECLARE + hours_diff numeric := EXTRACT(EPOCH FROM (timezone('utc', now()) - published)) / 3600; +BEGIN + IF (hours_diff > 0) THEN + RETURN floor(10000 * log(greatest (1, score + 3)) / power((hours_diff + 2), 1.8))::integer; + ELSE + RETURN 0; + END IF; +END; +$$ +LANGUAGE plpgsql +IMMUTABLE PARALLEL SAFE; + diff --git a/migrations/2023-08-02-174444_fix-timezones/up.sql b/migrations/2023-08-02-174444_fix-timezones/up.sql new file mode 100644 index 000000000..5ff41e304 --- /dev/null +++ b/migrations/2023-08-02-174444_fix-timezones/up.sql @@ -0,0 +1,351 @@ +SET timezone = 'UTC'; + +-- Allow ALTER TABLE ... SET DATA TYPE changing between timestamp and timestamptz to avoid a table rewrite when the session time zone is UTC (Noah Misch) +-- In the UTC time zone, these two data types are binary compatible. +ALTER TABLE community_moderator + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE community_follower + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE person_ban + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE community_person_ban + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE community_person_ban + ALTER COLUMN expires TYPE timestamptz + USING expires; + +ALTER TABLE person + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE person + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE person + ALTER COLUMN last_refreshed_at TYPE timestamptz + USING last_refreshed_at; + +ALTER TABLE person + ALTER COLUMN ban_expires TYPE timestamptz + USING ban_expires; + +ALTER TABLE post_like + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE post_saved + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE post_read + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE comment_like + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE comment_saved + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE comment + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE comment + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE mod_remove_post + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE mod_lock_post + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE mod_remove_comment + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE mod_remove_community + ALTER COLUMN expires TYPE timestamptz + USING expires; + +ALTER TABLE mod_remove_community + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE mod_ban_from_community + ALTER COLUMN expires TYPE timestamptz + USING expires; + +ALTER TABLE mod_ban_from_community + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE mod_ban + ALTER COLUMN expires TYPE timestamptz + USING expires; + +ALTER TABLE mod_ban + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE mod_add_community + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE mod_add + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE person_mention + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE mod_feature_post + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE password_reset_request + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE private_message + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE private_message + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE sent_activity + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE received_activity + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE community + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE community + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE community + ALTER COLUMN last_refreshed_at TYPE timestamptz + USING last_refreshed_at; + +ALTER TABLE post + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE post + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE comment_report + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE comment_report + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE post_report + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE post_report + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE post_aggregates + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE post_aggregates + ALTER COLUMN newest_comment_time_necro TYPE timestamptz + USING newest_comment_time_necro; + +ALTER TABLE post_aggregates + ALTER COLUMN newest_comment_time TYPE timestamptz + USING newest_comment_time; + +ALTER TABLE comment_aggregates + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE community_block + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE community_aggregates + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE mod_transfer_community + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE person_block + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE local_user + ALTER COLUMN validator_time TYPE timestamptz + USING validator_time; + +ALTER TABLE admin_purge_person + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE email_verification + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE admin_purge_community + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE admin_purge_post + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE admin_purge_comment + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE registration_application + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE mod_hide_community + ALTER COLUMN when_ TYPE timestamptz + USING when_; + +ALTER TABLE site + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE site + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE site + ALTER COLUMN last_refreshed_at TYPE timestamptz + USING last_refreshed_at; + +ALTER TABLE comment_reply + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE person_post_aggregates + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE private_message_report + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE private_message_report + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE local_site + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE local_site + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE federation_allowlist + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE federation_allowlist + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE federation_blocklist + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE federation_blocklist + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE local_site_rate_limit + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE local_site_rate_limit + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE person_follower + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE tagline + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE tagline + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE custom_emoji + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE custom_emoji + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE instance + ALTER COLUMN published TYPE timestamptz + USING published; + +ALTER TABLE instance + ALTER COLUMN updated TYPE timestamptz + USING updated; + +ALTER TABLE captcha_answer + ALTER COLUMN published TYPE timestamptz + USING published; + +-- same as before just with time zone argument +CREATE OR REPLACE FUNCTION hot_rank (score numeric, published timestamp with time zone) + RETURNS integer + AS $$ +DECLARE + hours_diff numeric := EXTRACT(EPOCH FROM (now() - published)) / 3600; +BEGIN + IF (hours_diff > 0) THEN + RETURN floor(10000 * log(greatest (1, score + 3)) / power((hours_diff + 2), 1.8))::integer; + ELSE + -- if the post is from the future, set hot score to 0. otherwise you can game the post to + -- always be on top even with only 1 vote by setting it to the future + RETURN 0; + END IF; +END; +$$ +LANGUAGE plpgsql +IMMUTABLE PARALLEL SAFE; + diff --git a/src/code_migrations.rs b/src/code_migrations.rs index 51302524f..e274ca940 100644 --- a/src/code_migrations.rs +++ b/src/code_migrations.rs @@ -457,7 +457,6 @@ async fn initialize_local_site_2022_10_10( // Register the user if there's a site setup let person_form = PersonInsertForm::builder() .name(setup.admin_username.clone()) - .admin(Some(true)) .instance_id(instance.id) .actor_id(Some(person_actor_id.clone())) .private_key(Some(person_keypair.private_key)) @@ -471,6 +470,7 @@ async fn initialize_local_site_2022_10_10( .person_id(person_inserted.id) .password_encrypted(setup.admin_password.clone()) .email(setup.admin_email.clone()) + .admin(Some(true)) .build(); LocalUser::create(pool, &local_user_form).await?; }; diff --git a/src/scheduled_tasks.rs b/src/scheduled_tasks.rs index a93494727..3b2bfe4b5 100644 --- a/src/scheduled_tasks.rs +++ b/src/scheduled_tasks.rs @@ -1,8 +1,8 @@ -use chrono::NaiveDateTime; +use chrono::{DateTime, TimeZone, Utc}; use clokwerk::{Scheduler, TimeUnits as CTimeUnits}; use diesel::{ - dsl::{now, IntervalDsl}, - sql_types::{Integer, Timestamp}, + dsl::IntervalDsl, + sql_types::{Integer, Timestamptz}, Connection, ExpressionMethods, NullableExpressionMethods, @@ -24,7 +24,7 @@ use lemmy_db_schema::{ sent_activity, }, source::instance::{Instance, InstanceForm}, - utils::{naive_now, DELETED_REPLACEMENT_TEXT}, + utils::{naive_now, now, DELETED_REPLACEMENT_TEXT}, }; use lemmy_routes::nodeinfo::NodeInfo; use lemmy_utils::{ @@ -181,8 +181,8 @@ fn update_hot_ranks(conn: &mut PgConnection) { #[derive(QueryableByName)] struct HotRanksUpdateResult { - #[diesel(sql_type = Timestamp)] - published: NaiveDateTime, + #[diesel(sql_type = Timestamptz)] + published: DateTime, } /// Runs the hot rank update query in batches until all rows have been processed. @@ -195,7 +195,10 @@ fn process_hot_ranks_in_batches( where_clause: &str, set_clause: &str, ) { - let process_start_time = NaiveDateTime::from_timestamp_opt(0, 0).expect("0 timestamp creation"); + let process_start_time: DateTime = Utc + .timestamp_opt(0, 0) + .single() + .expect("0 timestamp creation"); let update_batch_size = 1000; // Bigger batches than this tend to cause seq scans let mut processed_rows_count = 0; @@ -217,7 +220,7 @@ fn process_hot_ranks_in_batches( set_clause = set_clause, where_clause = where_clause )) - .bind::(previous_batch_last_published) + .bind::(previous_batch_last_published) .bind::(update_batch_size) .get_results::(conn); @@ -240,7 +243,7 @@ fn process_hot_ranks_in_batches( fn delete_expired_captcha_answers(conn: &mut PgConnection) { diesel::delete( - captcha_answer::table.filter(captcha_answer::published.lt(now - IntervalDsl::minutes(10))), + captcha_answer::table.filter(captcha_answer::published.lt(now() - IntervalDsl::minutes(10))), ) .execute(conn) .map(|_| { @@ -253,13 +256,13 @@ fn delete_expired_captcha_answers(conn: &mut PgConnection) { /// Clear old activities (this table gets very large) fn clear_old_activities(conn: &mut PgConnection) { info!("Clearing old activities..."); - diesel::delete(sent_activity::table.filter(sent_activity::published.lt(now - 3.months()))) + diesel::delete(sent_activity::table.filter(sent_activity::published.lt(now() - 3.months()))) .execute(conn) .map_err(|e| error!("Failed to clear old sent activities: {e}")) .ok(); diesel::delete( - received_activity::table.filter(received_activity::published.lt(now - 3.months())), + received_activity::table.filter(received_activity::published.lt(now() - 3.months())), ) .execute(conn) .map(|_| info!("Done.")) @@ -273,7 +276,7 @@ fn overwrite_deleted_posts_and_comments(conn: &mut PgConnection) { diesel::update( post::table .filter(post::deleted.eq(true)) - .filter(post::updated.lt(now.nullable() - 1.months())) + .filter(post::updated.lt(now().nullable() - 1.months())) .filter(post::body.ne(DELETED_REPLACEMENT_TEXT)), ) .set(( @@ -291,7 +294,7 @@ fn overwrite_deleted_posts_and_comments(conn: &mut PgConnection) { diesel::update( comment::table .filter(comment::deleted.eq(true)) - .filter(comment::updated.lt(now.nullable() - 1.months())) + .filter(comment::updated.lt(now().nullable() - 1.months())) .filter(comment::content.ne(DELETED_REPLACEMENT_TEXT)), ) .set(comment::content.eq(DELETED_REPLACEMENT_TEXT)) @@ -341,17 +344,19 @@ fn update_banned_when_expired(conn: &mut PgConnection) { diesel::update( person::table .filter(person::banned.eq(true)) - .filter(person::ban_expires.lt(now)), + .filter(person::ban_expires.lt(now().nullable())), ) .set(person::banned.eq(false)) .execute(conn) .map_err(|e| error!("Failed to update person.banned when expires: {e}")) .ok(); - diesel::delete(community_person_ban::table.filter(community_person_ban::expires.lt(now))) - .execute(conn) - .map_err(|e| error!("Failed to remove community_ban expired rows: {e}")) - .ok(); + diesel::delete( + community_person_ban::table.filter(community_person_ban::expires.lt(now().nullable())), + ) + .execute(conn) + .map_err(|e| error!("Failed to remove community_ban expired rows: {e}")) + .ok(); } /// Updates the instance software and version