From dbfa486897d29cbbadfaffa0b2adc19f3720f342 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 9 Jul 2023 00:56:56 +0100 Subject: [PATCH] update minijinja version --- Cargo.lock | 372 ++++++++++++++++++++++--- Cargo.toml | 2 + auth/simple-auth-server/Cargo.toml | 2 +- background-jobs/Cargo.toml | 6 +- background-jobs/src/persistent_jobs.rs | 15 +- databases/redis/Cargo.toml | 2 +- databases/redis/src/main.rs | 2 +- graphql/juniper-advanced/Cargo.toml | 2 +- https-tls/awc-https/Cargo.toml | 2 +- templating/minijinja/Cargo.toml | 4 +- templating/minijinja/src/main.rs | 3 +- websockets/chat-tcp/Cargo.toml | 2 +- 12 files changed, 349 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd06b61b..8b286e46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -696,6 +696,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "allocator-api2" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56fc6cf8dc8c4158eed8649f9b8b0ea1518eb62b544fe9490d66fa0b349eafe9" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -778,43 +784,60 @@ checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "apalis" -version = "0.3.6" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1dfa7394642efc1aa1f07fd069019b98b24519962e2791c8b396b450457ba3a" +checksum = "f3b612d9e7a6d5bd8bc3c533a02cc92f1faf677f9ce869f1f229e008c0bfb958" dependencies = [ "apalis-core", + "apalis-cron", "apalis-redis", + "apalis-sql", ] [[package]] name = "apalis-core" -version = "0.3.6" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5c28b120411d25c16ad0dfdfa1d41b0661717ce99c77fe45d3d6f5c4f4e089d" +checksum = "f5a7fa6614f9d29077a1f5f09d4a812326900ae137c5b644ebe93c422a8e4361" dependencies = [ - "anyhow", + "async-stream", "async-trait", "chrono", "futures 0.3.28", + "graceful-shutdown", "http", "log", "pin-project-lite 0.2.10", "serde", - "serde_json", "strum", "thiserror", "tokio 1.29.1", "tower", "tracing", "tracing-futures", - "uuid 0.8.2", + "ulid", +] + +[[package]] +name = "apalis-cron" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7757a13691a4adf31b7cd971d2ed175ebf897dcb60398de9d25c78e80070ea6" +dependencies = [ + "apalis-core", + "async-stream", + "chrono", + "cron", + "futures 0.3.28", + "tokio 1.29.1", + "tower", ] [[package]] name = "apalis-redis" -version = "0.3.6" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f8bebf6d1c5c3354e5e5c1fe4bead7ad70209de0066b6f021002322b5d0c45" +checksum = "5c716b3de2fd68bd4967c243bfc452cb88602abc4f3ee586d109e0fb368c6fc8" dependencies = [ "apalis-core", "async-stream", @@ -822,11 +845,29 @@ dependencies = [ "chrono", "futures 0.3.28", "log", - "redis 0.21.7", + "redis", "serde", "serde_json", "tokio 1.29.1", - "uuid 0.8.2", +] + +[[package]] +name = "apalis-sql" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8e0971620c65068a26b8fe06ebdec8a235388991ecdd64c267d9edae313244" +dependencies = [ + "apalis-core", + "async-stream", + "async-trait", + "chrono", + "debounced", + "futures 0.3.28", + "futures-lite", + "serde", + "serde_json", + "sqlx", + "tokio 1.29.1", ] [[package]] @@ -1079,6 +1120,15 @@ dependencies = [ "tokio-postgres", ] +[[package]] +name = "atoi" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +dependencies = [ + "num-traits", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -1131,7 +1181,7 @@ dependencies = [ "log", "mime", "rustls 0.20.8", - "webpki-roots 0.22.6", + "webpki-roots 0.24.0", ] [[package]] @@ -2257,6 +2307,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" + [[package]] name = "crc32c" version = "0.6.3" @@ -2275,6 +2340,17 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "cron" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ff76b51e4c068c52bfd2866e1567bee7c567ae8f24ada09fd4307019e25eab7" +dependencies = [ + "chrono", + "nom", + "once_cell", +] + [[package]] name = "crossbeam" version = "0.8.2" @@ -2521,7 +2597,7 @@ dependencies = [ "env_logger", "futures-util", "log", - "redis 0.22.3", + "redis", "serde", ] @@ -2576,6 +2652,16 @@ dependencies = [ "tokio 1.29.1", ] +[[package]] +name = "debounced" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d8b0346b9fa0aa01a3fa4bcce48d62f8738e9c2956e92f275bbf6cf9d6fab5" +dependencies = [ + "futures-timer", + "futures-util", +] + [[package]] name = "derivative" version = "2.2.0" @@ -2742,6 +2828,12 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + [[package]] name = "dtoa" version = "1.0.8" @@ -2918,7 +3010,7 @@ dependencies = [ "intl-memoizer", "intl_pluralrules", "rustc-hash", - "self_cell", + "self_cell 0.10.2", "smallvec 1.11.0", "unic-langid", ] @@ -3180,12 +3272,38 @@ dependencies = [ "futures-util", ] +[[package]] +name = "futures-intrusive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" +dependencies = [ + "futures-core", + "lock_api 0.4.10", + "parking_lot 0.11.2", +] + [[package]] name = "futures-io" version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite 0.2.10", + "waker-fn", +] + [[package]] name = "futures-macro" version = "0.3.28" @@ -3209,6 +3327,12 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + [[package]] name = "futures-util" version = "0.3.28" @@ -3305,6 +3429,17 @@ dependencies = [ "walkdir", ] +[[package]] +name = "graceful-shutdown" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3effbaf774a1da3462925bb182ccf975c284cf46edca5569ea93420a657af484" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.10", + "tokio 1.29.1", +] + [[package]] name = "graphql-parser" version = "0.3.0" @@ -3408,6 +3543,10 @@ name = "hashbrown" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +dependencies = [ + "ahash 0.8.3", + "allocator-api2", +] [[package]] name = "hashlink" @@ -3418,11 +3557,23 @@ dependencies = [ "hashbrown 0.11.2", ] +[[package]] +name = "hashlink" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "312f66718a2d7789ffef4f4b7b213138ed9f1eb3aa1d0d82fc99f88fb3ffd26f" +dependencies = [ + "hashbrown 0.14.0", +] + [[package]] name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "hello-world" @@ -4467,20 +4618,20 @@ dependencies = [ [[package]] name = "minijinja" -version = "0.30.7" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819be6b8bd3236f0fdbf86b1ff2d1f42ef8ef939eed74f6bc3ecf2e6344cd96" +checksum = "f40870a194358132836de5c67e5038c279de3bff7a05f5da201ed13f6064b979" dependencies = [ "memo-map", - "self_cell", + "self_cell 1.0.1", "serde", ] [[package]] name = "minijinja-autoreload" -version = "0.30.7" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be41d48530b2dbe0e5e94dc2921aafb076a0cad4fc72d64a8f75806d73b0ae45" +checksum = "da478920dbbf1718fd9f391f690c4c24aebfca6375a767a12406103b49ea1e92" dependencies = [ "minijinja", "notify", @@ -4941,6 +5092,12 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" +[[package]] +name = "parking" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" + [[package]] name = "parking_lot" version = "0.9.0" @@ -5576,29 +5733,9 @@ dependencies = [ [[package]] name = "redis" -version = "0.21.7" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "152f3863635cbb76b73bc247845781098302c6c9ad2060e1a9a7de56840346b6" -dependencies = [ - "async-trait", - "bytes 1.4.0", - "combine 4.6.6", - "futures-util", - "itoa 1.0.8", - "percent-encoding", - "pin-project-lite 0.2.10", - "ryu", - "sha1 0.6.1", - "tokio 1.29.1", - "tokio-util 0.7.8", - "url", -] - -[[package]] -name = "redis" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa8455fa3621f6b41c514946de66ea0531f57ca017b2e6c7cc368035ea5b46df" +checksum = "3ea8c51b5dc1d8e5fd3350ec8167f464ec0995e79f2e90a075b63371500d557f" dependencies = [ "arc-swap", "async-trait", @@ -5610,6 +5747,7 @@ dependencies = [ "percent-encoding", "pin-project-lite 0.2.10", "ryu", + "sha1_smol", "tokio 1.29.1", "tokio-util 0.7.8", "url", @@ -5915,7 +6053,7 @@ dependencies = [ "bitflags 1.3.2", "fallible-iterator", "fallible-streaming-iterator", - "hashlink", + "hashlink 0.7.0", "libsqlite3-sys", "memchr", "smallvec 1.11.0", @@ -6099,6 +6237,16 @@ dependencies = [ "base64 0.21.2", ] +[[package]] +name = "rustls-webpki" +version = "0.101.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.13" @@ -6253,6 +6401,12 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ef965a420fe14fdac7dd018862966a4c14094f900e1650bbc71ddd7d580c8af" +[[package]] +name = "self_cell" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c309e515543e67811222dbc9e3dd7e1056279b782e1dacffe4242b718734fb6" + [[package]] name = "semver" version = "0.9.0" @@ -6633,6 +6787,100 @@ dependencies = [ "lock_api 0.4.10", ] +[[package]] +name = "sqlformat" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" +dependencies = [ + "itertools", + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8de3b03a925878ed54a954f621e64bf55a3c1bd29652d0d1a17830405350188" +dependencies = [ + "sqlx-core", + "sqlx-macros", +] + +[[package]] +name = "sqlx-core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" +dependencies = [ + "ahash 0.7.6", + "atoi", + "bitflags 1.3.2", + "byteorder", + "bytes 1.4.0", + "crc", + "crossbeam-queue 0.3.8", + "dotenvy", + "either", + "event-listener", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-util", + "hashlink 0.8.3", + "hex", + "indexmap 1.9.3", + "itoa 1.0.8", + "libc", + "log", + "memchr", + "once_cell", + "paste", + "percent-encoding", + "rustls 0.20.8", + "rustls-pemfile", + "sha2", + "smallvec 1.11.0", + "sqlformat", + "sqlx-rt", + "stringprep", + "thiserror", + "tokio-stream", + "url", + "webpki-roots 0.22.6", +] + +[[package]] +name = "sqlx-macros" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9966e64ae989e7e575b19d7265cb79d7fc3cbbdf179835cb0d716f294c2049c9" +dependencies = [ + "dotenvy", + "either", + "heck", + "once_cell", + "proc-macro2", + "quote", + "sha2", + "sqlx-core", + "sqlx-rt", + "syn 1.0.109", + "url", +] + +[[package]] +name = "sqlx-rt" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" +dependencies = [ + "once_cell", + "tokio 1.29.1", + "tokio-rustls", +] + [[package]] name = "standback" version = "0.2.17" @@ -7703,6 +7951,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +[[package]] +name = "ulid" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13a3aaa69b04e5b66cc27309710a569ea23593612387d67daaf102e73aa974fd" +dependencies = [ + "rand 0.8.5", +] + [[package]] name = "uncased" version = "0.9.9" @@ -7835,6 +8092,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + [[package]] name = "unicode-width" version = "0.1.10" @@ -7847,6 +8110,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + [[package]] name = "universal-hash" version = "0.5.1" @@ -7934,10 +8203,6 @@ name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom 0.2.10", - "serde", -] [[package]] name = "uuid" @@ -8034,6 +8299,12 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "walkdir" version = "2.3.3" @@ -8200,6 +8471,15 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "webpki-roots" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" +dependencies = [ + "rustls-webpki", +] + [[package]] name = "websocket" version = "1.0.0" diff --git a/Cargo.toml b/Cargo.toml index 80b36e6c..cc562861 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,6 +87,7 @@ actix-web-lab = "0.19" actix-ws = "0.2.5" awc = "3" +chrono = { version = "0.4.20", default-features = false, features = ["clock", "serde"] } derive_more = "0.99.7" env_logger = "0.10" futures-util = { version = "0.3.17", default-features = false, features = ["std"] } @@ -95,3 +96,4 @@ rand = "0.8" serde = { version = "1", features = ["derive"] } serde_json = "1" tokio = { version = "1.24.2", features = ["sync"] } +tokio-util = "0.7.4" diff --git a/auth/simple-auth-server/Cargo.toml b/auth/simple-auth-server/Cargo.toml index 6f99be75..27c11242 100644 --- a/auth/simple-auth-server/Cargo.toml +++ b/auth/simple-auth-server/Cargo.toml @@ -8,7 +8,7 @@ actix-identity.workspace = true actix-session = { workspace = true, features = ["cookie-session"] } actix-web.workspace = true -chrono = { version = "0.4.20", features = ["serde"] } +chrono.workspace = true derive_more.workspace = true diesel = { version = "2", features = ["postgres", "r2d2", "uuid", "chrono"] } dotenv = "0.15" diff --git a/background-jobs/Cargo.toml b/background-jobs/Cargo.toml index 4ddda692..2fcc3682 100644 --- a/background-jobs/Cargo.toml +++ b/background-jobs/Cargo.toml @@ -7,12 +7,12 @@ edition = "2021" actix-web.workspace = true anyhow = "1" -apalis = { version = "0.3", features = ["redis"] } -chrono = { version = "0.4.20", default-features = false, features = ["clock", "serde"] } +apalis = { version = "0.4", features = ["redis"] } +chrono.workspace = true dotenv = "0.15" env_logger.workspace = true log.workspace = true rand.workspace = true serde.workspace = true tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } -tokio-util = "0.7.4" +tokio-util.workspace = true diff --git a/background-jobs/src/persistent_jobs.rs b/background-jobs/src/persistent_jobs.rs index bb6df6cf..a6ed7f33 100644 --- a/background-jobs/src/persistent_jobs.rs +++ b/background-jobs/src/persistent_jobs.rs @@ -29,13 +29,13 @@ impl Job for Email { const NAME: &'static str = "send_email"; } -async fn process_email_job(job: Email, _ctx: JobContext) -> Result { +async fn process_email_job(job: Email, _ctx: JobContext) -> Result<(), JobError> { log::info!("sending email to {}", &job.to); // simulate time taken to send email tokio::time::sleep(rand_delay_with_jitter()).await; - Ok(JobResult::Success) + Ok(()) } pub(crate) async fn start_processing_email_queue() -> anyhow::Result> { @@ -45,16 +45,17 @@ pub(crate) async fn start_processing_email_queue() -> anyhow::Result std::io::Result<()> { notifier.watch_path(&tmpl_path, true); } - env.set_source(minijinja::Source::from_path(tmpl_path)); + env.set_loader(path_loader(tmpl_path)); Ok(env) }); diff --git a/websockets/chat-tcp/Cargo.toml b/websockets/chat-tcp/Cargo.toml index a46ec167..2b3ad538 100644 --- a/websockets/chat-tcp/Cargo.toml +++ b/websockets/chat-tcp/Cargo.toml @@ -27,5 +27,5 @@ rand.workspace = true serde.workspace = true serde_json.workspace = true tokio = { workspace = true, features = ["full"] } -tokio-util = { version = "0.7", features = ["codec"] } +tokio-util.workspace = true tokio-stream = "0.1.8"