From bc28ac7400058f0be5efbc23f47b60dbe4d2eb63 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Tue, 3 Sep 2024 12:29:03 +0100 Subject: [PATCH 1/9] develop: bump to version 3.0.0-rc.1-develop --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b68c4335..6e2bd1e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3688,7 +3688,7 @@ dependencies = [ [[package]] name = "torrust-index" -version = "3.0.0-beta" +version = "3.0.0-rc.1-develop" dependencies = [ "anyhow", "argon2", @@ -3754,7 +3754,7 @@ dependencies = [ [[package]] name = "torrust-index-located-error" -version = "3.0.0-beta" +version = "3.0.0-rc.1-develop" dependencies = [ "thiserror", "tracing", diff --git a/Cargo.toml b/Cargo.toml index 28aafac3..a4d64f0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ license = "AGPL-3.0-only" publish = true repository = "https://github.com/torrust/torrust-tracker" rust-version = "1.72" -version = "3.0.0-beta" +version = "3.0.0-rc.1-develop" [profile.dev.package.sqlx-macros] opt-level = 3 @@ -89,7 +89,7 @@ text-to-png = "0" thiserror = "1" tokio = { version = "1", features = ["fs", "io-util", "macros", "net", "rt-multi-thread", "signal", "sync", "time"] } toml = "0" -torrust-index-located-error = { version = "3.0.0-beta", path = "packages/located-error" } +torrust-index-located-error = { version = "3.0.0-rc.1-develop", path = "packages/located-error" } tower = { version = "0.4", features = ["timeout"] } tower-http = { version = "0", features = ["compression-full", "cors", "propagate-header", "request-id", "trace"] } trace = "0.1.7" From 2e67cc12c9760fa0813243fe3104a71ccf9a00f4 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Fri, 6 Sep 2024 13:27:54 +0100 Subject: [PATCH 2/9] fix: [#613] wrong error message for password too long error --- src/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/errors.rs b/src/errors.rs index 276d9a8d..44b88b66 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -55,7 +55,7 @@ pub enum ServiceError { #[display(fmt = "Password too short")] PasswordTooShort, - #[display(fmt = "Username too long")] + #[display(fmt = "Password too long")] PasswordTooLong, #[display(fmt = "Passwords don't match")] PasswordsDontMatch, From 8246f07ede4fd616c459ac7a4160e41e8d1cce68 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Fri, 6 Sep 2024 13:48:15 +0100 Subject: [PATCH 3/9] feat: min and max password length should be also valid In the condiguration uyou can set the min and max password length but those values are not include (not valid). ```toml [auth.password_constraints] max_password_length = 64 min_password_length = 6 ``` This commit allows password with 6 and 64 chars. --- src/services/user.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/user.rs b/src/services/user.rs index 5e837dd3..fd9ab995 100644 --- a/src/services/user.rs +++ b/src/services/user.rs @@ -461,11 +461,11 @@ fn validate_password_constraints( let password_length = password.len(); - if password_length <= password_rules.min_password_length { + if password_length < password_rules.min_password_length { return Err(ServiceError::PasswordTooShort); } - if password_length >= password_rules.max_password_length { + if password_length > password_rules.max_password_length { return Err(ServiceError::PasswordTooLong); } From 69a463afca6d42981f05fedd82d10a5a8a6ca2e7 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Tue, 10 Sep 2024 09:26:35 +0100 Subject: [PATCH 4/9] chore(deps): udpate dependencies ```console cargo update Updating crates.io index Locking 83 packages to latest compatible versions Updating addr2line v0.22.0 -> v0.24.1 Removing ahash v0.7.8 Updating anyhow v1.0.86 -> v1.0.87 Updating async-trait v0.1.81 -> v0.1.82 Updating aws-lc-rs v1.8.1 -> v1.9.0 Updating aws-lc-sys v0.20.1 -> v0.21.1 Updating backtrace v0.3.73 -> v0.3.74 Updating bytemuck v1.17.0 -> v1.18.0 Updating casbin v2.2.0 -> v2.4.0 Updating cc v1.1.13 -> v1.1.18 Updating clap v4.5.16 -> v4.5.17 Updating clap_builder v4.5.15 -> v4.5.17 Updating cpufeatures v0.2.13 -> v0.2.14 Adding displaydoc v0.2.5 Updating fastrand v2.1.0 -> v2.1.1 Updating flate2 v1.0.32 -> v1.0.33 Updating gimli v0.29.0 -> v0.31.0 Updating globset v0.4.14 -> v0.4.15 Removing hashbrown v0.11.2 Updating hyper-rustls v0.27.2 -> v0.27.3 Updating hyper-util v0.1.7 -> v0.1.8 Adding icu_collections v1.5.0 Adding icu_locid v1.5.0 Adding icu_locid_transform v1.5.0 Adding icu_locid_transform_data v1.5.0 Adding icu_normalizer v1.5.0 Adding icu_normalizer_data v1.5.0 Adding icu_properties v1.5.1 Adding icu_properties_data v1.5.0 Adding icu_provider v1.5.0 Adding icu_provider_macros v1.5.0 Adding idna v1.0.2 Updating ignore v0.4.22 -> v0.4.23 Updating indexmap v2.4.0 -> v2.5.0 Updating ipnet v2.9.0 -> v2.10.0 Updating lettre v0.11.7 -> v0.11.8 Updating libsqlite3-sys v0.28.0 -> v0.30.1 Adding litemap v0.7.3 Updating object v0.36.3 -> v0.36.4 Updating parking v2.2.0 -> v2.2.1 Updating pest v2.7.11 -> v2.7.12 Updating pest_derive v2.7.11 -> v2.7.12 Updating pest_generator v2.7.11 -> v2.7.12 Updating pest_meta v2.7.11 -> v2.7.12 Updating prettyplease v0.2.20 -> v0.2.22 Updating psm v0.1.21 -> v0.1.23 Updating quote v1.0.36 -> v1.0.37 Removing redox_syscall v0.4.1 Updating rgb v0.8.48 -> v0.8.50 Removing ritelinked v0.3.2 Updating rustc_version v0.4.0 -> v0.4.1 Updating rustix v0.38.34 -> v0.38.36 Updating rustls-webpki v0.102.6 -> v0.102.8 Updating schannel v0.1.23 -> v0.1.24 Updating serde v1.0.208 -> v1.0.210 Updating serde_derive v1.0.208 -> v1.0.210 Updating serde_json v1.0.125 -> v1.0.128 Updating sqlformat v0.2.4 -> v0.2.6 Updating sqlx v0.8.0 -> v0.8.2 Updating sqlx-core v0.8.0 -> v0.8.2 Updating sqlx-macros v0.8.0 -> v0.8.2 Updating sqlx-macros-core v0.8.0 -> v0.8.2 Updating sqlx-mysql v0.8.0 -> v0.8.2 Updating sqlx-postgres v0.8.0 -> v0.8.2 Updating sqlx-sqlite v0.8.0 -> v0.8.2 Adding stable_deref_trait v1.2.0 Updating stacker v0.1.15 -> v0.1.17 Updating syn v2.0.75 -> v2.0.77 Adding synstructure v0.13.1 Updating system-configuration v0.6.0 -> v0.6.1 Adding tinystr v0.7.6 Updating tokio v1.39.3 -> v1.40.0 Updating tokio-stream v0.1.15 -> v0.1.16 Updating tokio-util v0.7.11 -> v0.7.12 Adding utf16_iter v1.0.5 Adding utf8_iter v1.0.4 Updating webpki-roots v0.26.3 -> v0.26.5 Updating whoami v1.5.1 -> v1.5.2 Adding write16 v1.0.0 Adding writeable v0.5.5 Updating xml-rs v0.8.21 -> v0.8.22 Adding yoke v0.7.4 Adding yoke-derive v0.7.4 Adding zerofrom v0.1.4 Adding zerofrom-derive v0.1.4 Removing zeroize_derive v1.4.2 Adding zerovec v0.10.4 Adding zerovec-derive v0.10.3 ``` --- Cargo.lock | 613 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 413 insertions(+), 200 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e2bd1e4..caa99818 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] @@ -23,17 +23,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.11" @@ -144,9 +133,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" [[package]] name = "arc-swap" @@ -202,13 +191,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -243,9 +232,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-lc-rs" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae74d9bd0a7530e8afd1770739ad34b36838829d6ad61818f9230f683f5ad77" +checksum = "2f95446d919226d587817a7d21379e6eb099b97b45110a7f272a444ca5c54070" dependencies = [ "aws-lc-sys", "mirai-annotations", @@ -255,9 +244,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.20.1" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0e249228c6ad2d240c2dc94b714d711629d52bad946075d8e9b2f5391f0703" +checksum = "234314bd569802ec87011d653d6815c6d7b9ffb969e9fee5b8b20ef860e8dce9" dependencies = [ "bindgen", "cc", @@ -350,17 +339,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide 0.8.0", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -412,7 +401,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.75", + "syn 2.0.77", "which 4.4.2", ] @@ -488,9 +477,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder" @@ -515,19 +504,19 @@ dependencies = [ [[package]] name = "casbin" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71063d3ee2f5ecc89229ccade0f3f8fb413b5e3978124a38b611216f91dd7c9" +checksum = "d51a6ae36c4b6d1241cfd6572ec861639095291f1fba7222443b63e44b25be5e" dependencies = [ "async-trait", "fixedbitset", "getrandom", + "hashlink", "once_cell", "parking_lot", "petgraph", "regex", "rhai", - "ritelinked", "serde", "thiserror", "tokio", @@ -535,9 +524,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.13" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" dependencies = [ "jobserver", "libc", @@ -595,9 +584,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.16" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -605,9 +594,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", @@ -624,7 +613,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -717,9 +706,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -819,7 +808,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -830,7 +819,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -884,7 +873,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -899,6 +888,17 @@ dependencies = [ "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "dotenvy" version = "0.15.7" @@ -994,9 +994,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fdeflate" @@ -1040,9 +1040,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "miniz_oxide 0.8.0", @@ -1185,7 +1185,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -1243,9 +1243,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "glob" @@ -1255,9 +1255,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ "aho-corasick", "bstr", @@ -1289,22 +1289,13 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.4.0", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.8", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -1317,7 +1308,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", ] @@ -1455,9 +1446,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http", @@ -1488,9 +1479,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", @@ -1529,6 +1520,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1545,11 +1654,23 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd69211b9b519e98303c015e21a007e293db403b6c85b9b124e133d25e242cdd" +dependencies = [ + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", +] + [[package]] name = "ignore" -version = "0.4.22" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" dependencies = [ "crossbeam-deque", "globset", @@ -1574,9 +1695,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -1600,9 +1721,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is_terminal_polyfill" @@ -1690,9 +1811,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "lettre" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a62049a808f1c4e2356a2a380bd5f2aca3b011b0b482cf3b914ba1731426969" +checksum = "1658ac89b01055e3ba23d66ecf6f8b97388ebe34ce125e49f8ef71234fb8aaba" dependencies = [ "async-trait", "base64 0.22.1", @@ -1704,7 +1825,7 @@ dependencies = [ "futures-util", "hostname", "httpdate", - "idna", + "idna 1.0.2", "mime", "native-tls", "nom", @@ -1712,6 +1833,7 @@ dependencies = [ "quoted_printable", "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "socket2", @@ -1747,9 +1869,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libsqlite3-sys" -version = "0.28.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ "cc", "pkg-config", @@ -1762,6 +1884,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -1897,7 +2025,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -2019,9 +2147,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.3" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -2055,7 +2183,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -2084,9 +2212,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -2106,7 +2234,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -2160,7 +2288,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -2190,9 +2318,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" dependencies = [ "memchr", "thiserror", @@ -2201,9 +2329,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" +checksum = "664d22978e2815783adbdd2c588b455b1bd625299ce36b2a99881ac9627e6d8d" dependencies = [ "pest", "pest_generator", @@ -2211,22 +2339,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" +checksum = "a2d5487022d5d33f4c30d91c22afa240ce2a644e87fe08caad974d4eab6badbe" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] name = "pest_meta" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" +checksum = "0091754bbd0ea592c4deb3a122ce8ecbb0753b738aa82bc055fcc2eccc8d8174" dependencies = [ "once_cell", "pest", @@ -2240,7 +2368,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.4.0", + "indexmap 2.5.0", ] [[package]] @@ -2266,7 +2394,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -2364,12 +2492,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -2389,25 +2517,25 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", "version_check", "yansi", ] [[package]] name = "psm" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" dependencies = [ "cc", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -2454,15 +2582,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ae028b272a6e99d9f8260ceefa3caa09300a8d6c8d2b2001316474bc52122e9" -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.3" @@ -2562,9 +2681,9 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.48" +version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f86ae463694029097b846d8f99fd5536740602ae00022c0c50c5600720b2f71" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" dependencies = [ "bytemuck", ] @@ -2575,7 +2694,7 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61797318be89b1a268a018a92a7657096d83f3ecb31418b9e9c16dcbb043b702" dependencies = [ - "ahash 0.8.11", + "ahash", "bitflags 2.6.0", "instant", "num-traits", @@ -2595,7 +2714,7 @@ checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -2613,16 +2732,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "ritelinked" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98f2771d255fd99f0294f13249fecd0cae6e074f86b4197ec1f1689d537b44d3" -dependencies = [ - "ahash 0.7.8", - "hashbrown 0.11.2", -] - [[package]] name = "roxmltree" version = "0.14.1" @@ -2666,18 +2775,18 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" dependencies = [ "bitflags 2.6.0", "errno", @@ -2720,9 +2829,9 @@ checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "aws-lc-rs", "ring", @@ -2778,11 +2887,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2822,9 +2931,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.208" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -2850,20 +2959,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", @@ -2912,7 +3021,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.4.0", + "indexmap 2.5.0", "serde", "serde_derive", "serde_json", @@ -2929,7 +3038,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -3093,9 +3202,9 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" dependencies = [ "nom", "unicode_categories", @@ -3103,9 +3212,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27144619c6e5802f1380337a209d2ac1c431002dd74c6e60aebff3c506dc4f0c" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" dependencies = [ "sqlx-core", "sqlx-macros", @@ -3116,9 +3225,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a999083c1af5b5d6c071d34a708a19ba3e02106ad82ef7bbd69f5e48266b613b" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" dependencies = [ "atoi", "byteorder", @@ -3135,7 +3244,7 @@ dependencies = [ "hashbrown 0.14.5", "hashlink", "hex", - "indexmap 2.4.0", + "indexmap 2.5.0", "log", "memchr", "native-tls", @@ -3157,22 +3266,22 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23217eb7d86c584b8cbe0337b9eacf12ab76fe7673c513141ec42565698bb88" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" dependencies = [ "proc-macro2", "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] name = "sqlx-macros-core" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a099220ae541c5db479c6424bdf1b200987934033c2584f79a0e1693601e776" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" dependencies = [ "dotenvy", "either", @@ -3188,7 +3297,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.75", + "syn 2.0.77", "tempfile", "tokio", "url", @@ -3196,9 +3305,9 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afe4c38a9b417b6a9a5eeffe7235d0a106716495536e7727d1c7f4b1ff3eba6" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" dependencies = [ "atoi", "base64 0.22.1", @@ -3239,9 +3348,9 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1dbb157e65f10dbe01f729339c06d239120221c9ad9fa0ba8408c4cc18ecf21" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" dependencies = [ "atoi", "base64 0.22.1", @@ -3278,9 +3387,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2cdd83c008a622d94499c0006d8ee5f821f36c89b7d625c900e5dc30b5c5ee" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" dependencies = [ "atoi", "flume", @@ -3300,17 +3409,23 @@ dependencies = [ "url", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "stacker" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" dependencies = [ "cc", "cfg-if", "libc", "psm", - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -3364,9 +3479,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -3388,11 +3503,22 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "system-configuration" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.6.0", "core-foundation", @@ -3497,7 +3623,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -3564,6 +3690,16 @@ dependencies = [ "safe_arch", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -3581,9 +3717,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -3604,7 +3740,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -3630,9 +3766,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -3641,9 +3777,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -3679,7 +3815,7 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", @@ -3712,7 +3848,7 @@ dependencies = [ "http-body", "hyper", "hyper-util", - "indexmap 2.4.0", + "indexmap 2.5.0", "jsonwebtoken", "lazy_static", "lettre", @@ -3842,7 +3978,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -4061,7 +4197,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", "serde", ] @@ -4099,6 +4235,18 @@ dependencies = [ "xmlwriter", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -4185,7 +4333,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -4219,7 +4367,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4242,9 +4390,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] @@ -4275,11 +4423,11 @@ dependencies = [ [[package]] name = "whoami" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "redox_syscall 0.4.1", + "redox_syscall", "wasite", ] @@ -4526,11 +4674,23 @@ version = "0.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "xml-rs" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" +checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" [[package]] name = "xmlparser" @@ -4550,6 +4710,30 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -4568,7 +4752,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "synstructure", ] [[package]] @@ -4576,19 +4781,27 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" dependencies = [ - "zeroize_derive", + "yoke", + "zerofrom", + "zerovec-derive", ] [[package]] -name = "zeroize_derive" -version = "1.4.2" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] From 0f3d122841f99aa4dd3da8d85803c8db6ec8e44b Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Fri, 13 Sep 2024 10:07:06 +0100 Subject: [PATCH 5/9] chore(deps): update dependencies ```output cargo update Updating crates.io index Locking 5 packages to latest compatible versions Updating anyhow v1.0.87 -> v1.0.88 Updating redox_syscall v0.5.3 -> v0.5.4 Updating rustix v0.38.36 -> v0.38.37 Updating rustls v0.23.12 -> v0.23.13 Updating unicode-ident v1.0.12 -> v1.0.13 ``` --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index caa99818..705aabe7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" +checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" [[package]] name = "arc-swap" @@ -2584,9 +2584,9 @@ checksum = "9ae028b272a6e99d9f8260ceefa3caa09300a8d6c8d2b2001316474bc52122e9" [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] @@ -2784,9 +2784,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.36" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -2797,9 +2797,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "aws-lc-rs", "log", @@ -4147,9 +4147,9 @@ checksum = "07547e3ee45e28326cc23faac56d44f58f16ab23e413db526debce3b0bfd2742" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" From 7d82eb2594d1db112b5f166c317115492e54b9db Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Fri, 13 Sep 2024 17:17:09 +0100 Subject: [PATCH 6/9] feat: [#730] add CMS content to configration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to pass legal texts to the frontent but we don't have a proper CMS. For now, we have just added the texts in the configuration to make it possible for users to overrride them. These are the new values in the config: ```toml [website.demo] warning = "⚠️ Please be aware: This demo resets all data weekly. Torrents not complying with our Usage Policies will be removed immediately without notice. We encourage the responsible use of this software in compliance with all legal requirements." [website.terms] [website.terms.upload] content_upload_agreement = """I confirm that the content I am uploading is authorized, and I have read and agree to the terms.""" [website.terms.page] content = """ Our software is designed to support the distribution of legal, authorized content only. Users may only upload or share files that fall under the following categories: - **Open-Source Licenses:** Content licensed under recognized open-source licenses, allowing for free distribution and modification. - **Creative Commons Licenses:** Content released under Creative Commons licenses that permit sharing and distribution. - **Public Domain:** Content that is free of copyright restrictions and available for public use. **Prohibited Content:** Any content that infringes copyright, is subject to copyright protection, or is illegal under applicable laws is strictly prohibited. This includes but is not limited to copyrighted movies, music, software, books, and any other media. **Enforcement:** We reserve the right to remove any content that does not comply with these policies without notice. We may also take additional steps, including reporting violations to the relevant authorities, if necessary. """ title = "Usage Policies and Content Restrictions" ``` --- src/config/mod.rs | 115 +++++++----------- src/config/v2/website.rs | 142 ++++++++++++++++++++++ src/services/settings.rs | 93 +++++++++++++- tests/fixtures/default_configuration.toml | 81 ++++++++++++ 4 files changed, 356 insertions(+), 75 deletions(-) create mode 100644 tests/fixtures/default_configuration.toml diff --git a/src/config/mod.rs b/src/config/mod.rs index a5935242..83c1fee3 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -47,6 +47,11 @@ pub type Logging = v2::logging::Logging; pub type Threshold = v2::logging::Threshold; pub type Website = v2::website::Website; +pub type Demo = v2::website::Demo; +pub type Terms = v2::website::Terms; +pub type TermsPage = v2::website::TermsPage; +pub type TermsUpload = v2::website::TermsUpload; +pub type Markdown = v2::website::Markdown; /// Configuration version const VERSION_2: &str = "2.0.0"; @@ -193,6 +198,14 @@ impl Info { config_toml_path, }) } + + #[must_use] + pub fn from_toml(config_toml: &str) -> Self { + Self { + config_toml: Some(config_toml.to_owned()), + config_toml_path: String::new(), + } + } } /// Errors that can occur when loading the configuration. @@ -385,88 +398,44 @@ mod tests { #[cfg(test)] fn default_config_toml() -> String { - let config = r#"[metadata] - app = "torrust-index" - purpose = "configuration" - schema_version = "2.0.0" - - [logging] - threshold = "info" - - [website] - name = "Torrust" - - [tracker] - api_url = "http://localhost:1212/" - listed = false - private = false - token = "MyAccessToken" - token_valid_seconds = 7257600 - url = "udp://localhost:6969" - - [net] - bind_address = "0.0.0.0:3001" - - [auth] - user_claim_token_pepper = "MaxVerstappenWC2021" - - [auth.password_constraints] - max_password_length = 64 - min_password_length = 6 - - [database] - connect_url = "sqlite://data.db?mode=rwc" - - [mail] - from = "example@email.com" - reply_to = "noreply@email.com" - - [mail.smtp] - port = 25 - server = "" - - [mail.smtp.credentials] - password = "" - username = "" - - [image_cache] - capacity = 128000000 - entry_size_limit = 4000000 - max_request_timeout_ms = 1000 - user_quota_bytes = 64000000 - user_quota_period_seconds = 3600 - - [api] - default_torrent_page_size = 10 - max_torrent_page_size = 30 - - [tracker_statistics_importer] - port = 3002 - torrent_info_update_interval = 3600 - "# - .lines() - .map(str::trim_start) - .collect::>() - .join("\n"); + use std::fs; + use std::path::PathBuf; + + // Get the path to the current Cargo.toml directory + let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR environment variable not set"); + + // Construct the path to the default configuration file relative to the Cargo.toml directory + let mut path = PathBuf::from(manifest_dir); + path.push("tests/fixtures/default_configuration.toml"); + + let config = fs::read_to_string(path) + .expect("Could not read default configuration TOML file: tests/fixtures/default_configuration.toml"); + + config.lines().map(str::trim_start).collect::>().join("\n"); + config } - #[tokio::test] - async fn configuration_should_build_settings_with_default_values() { - let configuration = Configuration::default().get_all().await; + /// Build settings from default configuration fixture in TOML. + /// + /// We just want to load that file without overriding with env var or other + /// configuration loading behavior. + #[cfg(test)] + fn default_settings() -> Settings { + use figment::providers::{Format, Toml}; + use figment::Figment; - let toml = toml::to_string(&configuration).expect("Could not encode TOML value for configuration"); + let figment = Figment::from(Toml::string(&default_config_toml())); + let settings: Settings = figment.extract().expect("Invalid configuration"); - assert_eq!(toml, default_config_toml()); + settings } #[tokio::test] - async fn configuration_should_return_all_settings() { - let configuration = Configuration::default().get_all().await; - - let toml = toml::to_string(&configuration).expect("Could not encode TOML value for configuration"); + async fn configuration_should_have_a_default_constructor() { + let settings = Configuration::default().get_all().await; - assert_eq!(toml, default_config_toml()); + assert_eq!(settings, default_settings()); } #[tokio::test] diff --git a/src/config/v2/website.rs b/src/config/v2/website.rs index 489ce265..a568c29b 100644 --- a/src/config/v2/website.rs +++ b/src/config/v2/website.rs @@ -6,12 +6,22 @@ pub struct Website { /// The name of the website. #[serde(default = "Website::default_name")] pub name: String, + + /// The demo settings when the app runs in `demo` mode. + #[serde(default = "Website::default_demo")] + pub demo: Option, + + /// The legal information. + #[serde(default = "Website::default_terms")] + pub terms: Terms, } impl Default for Website { fn default() -> Self { Self { name: Self::default_name(), + demo: Self::default_demo(), + terms: Self::default_terms(), } } } @@ -20,4 +30,136 @@ impl Website { fn default_name() -> String { "Torrust".to_string() } + + fn default_demo() -> Option { + None + } + + fn default_terms() -> Terms { + Terms::default() + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct Demo { + /// The fixed message to show when the index is running in demo mode. + #[serde(default = "Demo::default_warning")] + pub warning: String, +} + +impl Demo { + fn default_warning() -> String { + "⚠️ Please be aware: This demo resets all data weekly. Torrents not complying with our Usage Policies will be removed immediately without notice. We encourage the responsible use of this software in compliance with all legal requirements.".to_string() + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct Terms { + /// The terms page info. + #[serde(default = "Terms::default_page")] + pub page: TermsPage, + + /// The upload agreement info. + #[serde(default = "Terms::default_upload")] + pub upload: TermsUpload, +} + +impl Terms { + fn default_page() -> TermsPage { + TermsPage::default() + } + + fn default_upload() -> TermsUpload { + TermsUpload::default() + } +} + +impl Default for Terms { + fn default() -> Self { + Self { + page: Self::default_page(), + upload: Self::default_upload(), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct TermsPage { + /// The terms page title. + #[serde(default = "TermsPage::default_title")] + pub title: String, + + /// The terms page content. + #[serde(default = "TermsPage::default_content")] + pub content: Markdown, +} + +impl TermsPage { + fn default_title() -> String { + "Usage Policies and Content Restrictions".to_string() + } + + fn default_content() -> Markdown { + Markdown::new( + r" +# Usage Policies and Content Restrictions + +Our software is designed to support the distribution of legal, authorized content only. Users may only upload or share files that fall under the following categories: + +- **Open-Source Licenses:** Content licensed under recognized open-source licenses, allowing for free distribution and modification. +- **Creative Commons Licenses:** Content released under Creative Commons licenses that permit sharing and distribution. +- **Public Domain:** Content that is free of copyright restrictions and available for public use. + +**Prohibited Content:** Any content that infringes copyright, is subject to copyright protection, or is illegal under applicable laws is strictly prohibited. This includes but is not limited to copyrighted movies, music, software, books, and any other media. + +**Enforcement:** We reserve the right to remove any content that does not comply with these policies without notice. We may also take additional steps, including reporting violations to the relevant authorities, if necessary. + +", + ) + } +} + +impl Default for TermsPage { + fn default() -> Self { + Self { + title: Self::default_title(), + content: Self::default_content(), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct TermsUpload { + /// The terms page content. + #[serde(default = "TermsUpload::default_content_upload_agreement")] + pub content_upload_agreement: Markdown, +} + +impl TermsUpload { + fn default_content_upload_agreement() -> Markdown { + Markdown::new("I confirm that the content I am uploading is authorized, and I have read and agree to the terms.") + } +} + +impl Default for TermsUpload { + fn default() -> Self { + Self { + content_upload_agreement: Self::default_content_upload_agreement(), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct Markdown(String); + +impl Markdown { + #[must_use] + pub fn new(content: &str) -> Self { + Self(content.to_owned()) + } + + #[must_use] + pub fn source(&self) -> String { + self.0.clone() + } } diff --git a/src/services/settings.rs b/src/services/settings.rs index 2b49dff3..198cba5e 100644 --- a/src/services/settings.rs +++ b/src/services/settings.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use url::Url; use super::authorization::{self, ACTION}; -use crate::config::{Configuration, Settings}; +use crate::config::{self, Configuration, Settings}; use crate::errors::ServiceError; use crate::models::user::UserId; @@ -106,6 +106,7 @@ fn extract_public_settings(settings: &Settings) -> ConfigurationPublic { tracker_listed: settings.tracker.listed, tracker_private: settings.tracker.private, email_on_signup, + website: settings.website.clone().into(), } } @@ -118,6 +119,7 @@ pub struct ConfigurationPublic { tracker_listed: bool, tracker_private: bool, email_on_signup: EmailOnSignup, + website: Website, } /// Whether the email is required on signup or not. @@ -164,6 +166,92 @@ impl FromStr for EmailOnSignup { } } +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct Website { + pub name: String, + pub demo: Option, + pub terms: Terms, +} + +impl From for Website { + fn from(website: config::Website) -> Self { + Self { + name: website.name, + demo: website.demo.map(std::convert::Into::into), + terms: website.terms.into(), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct Demo { + pub warning: String, +} + +impl From for Demo { + fn from(demo: config::Demo) -> Self { + Self { warning: demo.warning } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct Terms { + pub page: TermsPage, + pub upload: TermsUpload, +} + +impl From for Terms { + fn from(terms: config::Terms) -> Self { + Self { + page: terms.page.into(), + upload: terms.upload.into(), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct TermsPage { + pub title: String, + pub content: Markdown, +} + +impl From for TermsPage { + fn from(terms_page: config::TermsPage) -> Self { + Self { + title: terms_page.title, + content: terms_page.content.into(), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct TermsUpload { + pub content_upload_agreement: Markdown, +} + +impl From for TermsUpload { + fn from(terms_upload: config::TermsUpload) -> Self { + Self { + content_upload_agreement: terms_upload.content_upload_agreement.into(), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct Markdown(pub String); + +impl Markdown { + fn new(content: &str) -> Self { + Self(content.to_owned()) + } +} + +impl From for Markdown { + fn from(markdown: config::Markdown) -> Self { + Self::new(&markdown.source()) + } +} + #[cfg(test)] mod tests { use crate::config::Configuration; @@ -191,11 +279,12 @@ mod tests { assert_eq!( extract_public_settings(&all_settings), ConfigurationPublic { - website_name: all_settings.website.name, + website_name: all_settings.website.name.clone(), tracker_url: all_settings.tracker.url, tracker_listed: all_settings.tracker.listed, tracker_private: all_settings.tracker.private, email_on_signup, + website: all_settings.website.into(), } ); } diff --git a/tests/fixtures/default_configuration.toml b/tests/fixtures/default_configuration.toml new file mode 100644 index 00000000..d86ac1c1 --- /dev/null +++ b/tests/fixtures/default_configuration.toml @@ -0,0 +1,81 @@ +[metadata] +app = "torrust-index" +purpose = "configuration" +schema_version = "2.0.0" + +[logging] +threshold = "info" + +[website] +name = "Torrust" + +[website.terms] + +[website.terms.upload] +content_upload_agreement = """I confirm that the content I am uploading is authorized, and I have read and agree to the terms.""" + +[website.terms.page] +content = """ + +# Usage Policies and Content Restrictions + +Our software is designed to support the distribution of legal, authorized content only. Users may only upload or share files that fall under the following categories: + +- **Open-Source Licenses:** Content licensed under recognized open-source licenses, allowing for free distribution and modification. +- **Creative Commons Licenses:** Content released under Creative Commons licenses that permit sharing and distribution. +- **Public Domain:** Content that is free of copyright restrictions and available for public use. + +**Prohibited Content:** Any content that infringes copyright, is subject to copyright protection, or is illegal under applicable laws is strictly prohibited. This includes but is not limited to copyrighted movies, music, software, books, and any other media. + +**Enforcement:** We reserve the right to remove any content that does not comply with these policies without notice. We may also take additional steps, including reporting violations to the relevant authorities, if necessary. + +""" +title = "Usage Policies and Content Restrictions" + +[tracker] +api_url = "http://localhost:1212/" +listed = false +private = false +token = "MyAccessToken" +token_valid_seconds = 7257600 +url = "udp://localhost:6969" + +[net] +bind_address = "0.0.0.0:3001" + +[auth] +user_claim_token_pepper = "MaxVerstappenWC2021" + +[auth.password_constraints] +max_password_length = 64 +min_password_length = 6 + +[database] +connect_url = "sqlite://data.db?mode=rwc" + +[mail] +from = "example@email.com" +reply_to = "noreply@email.com" + +[mail.smtp] +port = 25 +server = "" + +[mail.smtp.credentials] +password = "" +username = "" + +[image_cache] +capacity = 128000000 +entry_size_limit = 4000000 +max_request_timeout_ms = 1000 +user_quota_bytes = 64000000 +user_quota_period_seconds = 3600 + +[api] +default_torrent_page_size = 10 +max_torrent_page_size = 30 + +[tracker_statistics_importer] +port = 3002 +torrent_info_update_interval = 3600 From 5e0226d30ff69492a4fd5436fb2813b79621ce08 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Mon, 23 Sep 2024 15:41:34 +0100 Subject: [PATCH 7/9] chore(deps): update dependencies ```output cargo update Updating crates.io index Locking 27 packages to latest compatible versions Updating anyhow v1.0.88 -> v1.0.89 Updating arrayref v0.3.8 -> v0.3.9 Updating aws-lc-sys v0.21.1 -> v0.21.2 Updating axum v0.7.5 -> v0.7.6 Updating axum-core v0.4.3 -> v0.4.4 Updating bytes v1.7.1 -> v1.7.2 Updating casbin v2.4.0 -> v2.5.0 Updating cc v1.1.18 -> v1.1.21 Updating clap v4.5.17 -> v4.5.18 Updating clap_builder v4.5.17 -> v4.5.18 Updating clap_derive v4.5.13 -> v4.5.18 Updating iana-time-zone v0.1.60 -> v0.1.61 Updating lettre v0.11.8 -> v0.11.9 Updating pest v2.7.12 -> v2.7.13 Updating pest_derive v2.7.12 -> v2.7.13 Updating pest_generator v2.7.12 -> v2.7.13 Updating pest_meta v2.7.12 -> v2.7.13 Updating pkg-config v0.3.30 -> v0.3.31 Updating security-framework-sys v2.11.1 -> v2.12.0 Updating thiserror v1.0.63 -> v1.0.64 Updating thiserror-impl v1.0.63 -> v1.0.64 Updating toml_edit v0.22.20 -> v0.22.21 Adding tower v0.5.1 Updating tower-http v0.5.2 -> v0.6.1 Updating unicode-normalization v0.1.23 -> v0.1.24 Updating unicode-script v0.5.6 -> v0.5.7 Updating webpki-roots v0.26.5 -> v0.26.6 ``` --- Cargo.lock | 132 ++++++++++-------- .../config/index.development.sqlite3.toml | 2 + 2 files changed, 76 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 705aabe7..9f86bfdc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "arc-swap" @@ -157,9 +157,9 @@ dependencies = [ [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -244,9 +244,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234314bd569802ec87011d653d6815c6d7b9ffb969e9fee5b8b20ef860e8dce9" +checksum = "b3ddc4a5b231dd6958b140ff3151b6412b3f4321fab354f399eec8f14b06df62" dependencies = [ "bindgen", "cc", @@ -259,9 +259,9 @@ dependencies = [ [[package]] name = "axum" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +checksum = "8f43644eed690f5374f1af436ecd6aea01cd201f6fbdf0178adaf6907afb2cec" dependencies = [ "async-trait", "axum-core", @@ -286,7 +286,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 1.0.1", "tokio", - "tower", + "tower 0.5.1", "tower-layer", "tower-service", "tracing", @@ -294,9 +294,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +checksum = "5e6b8ba012a258d63c9adfa28b9ddcf66149da6f986c5b5452e629d5ee64bf00" dependencies = [ "async-trait", "bytes", @@ -307,7 +307,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.1", "tower-layer", "tower-service", "tracing", @@ -333,7 +333,7 @@ dependencies = [ "rustls-pki-types", "tokio", "tokio-rustls", - "tower", + "tower 0.4.13", "tower-service", ] @@ -489,9 +489,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "camino" @@ -504,9 +504,9 @@ dependencies = [ [[package]] name = "casbin" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51a6ae36c4b6d1241cfd6572ec861639095291f1fba7222443b63e44b25be5e" +checksum = "66e141a8db13c2e8bf3fdd6ac2b48ace7e70d2e4a66c329a4bb759e1368f22dc" dependencies = [ "async-trait", "fixedbitset", @@ -518,15 +518,16 @@ dependencies = [ "regex", "rhai", "serde", + "serde_json", "thiserror", "tokio", ] [[package]] name = "cc" -version = "1.1.18" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "jobserver", "libc", @@ -584,9 +585,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -594,9 +595,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -606,9 +607,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -1492,16 +1493,16 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower", + "tower 0.4.13", "tower-service", "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1811,9 +1812,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "lettre" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1658ac89b01055e3ba23d66ecf6f8b97388ebe34ce125e49f8ef71234fb8aaba" +checksum = "69f204773bab09b150320ea1c83db41dc6ee606a4bc36dc1f43005fe7b58ce06" dependencies = [ "async-trait", "base64 0.22.1", @@ -2318,9 +2319,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.12" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" +checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" dependencies = [ "memchr", "thiserror", @@ -2329,9 +2330,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.12" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "664d22978e2815783adbdd2c588b455b1bd625299ce36b2a99881ac9627e6d8d" +checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" dependencies = [ "pest", "pest_generator", @@ -2339,9 +2340,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.12" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d5487022d5d33f4c30d91c22afa240ce2a644e87fe08caad974d4eab6badbe" +checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" dependencies = [ "pest", "pest_meta", @@ -2352,9 +2353,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.12" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0091754bbd0ea592c4deb3a122ce8ecbb0753b738aa82bc055fcc2eccc8d8174" +checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" dependencies = [ "once_cell", "pest", @@ -2432,9 +2433,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "png" @@ -2915,9 +2916,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -3608,18 +3609,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -3811,9 +3812,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ "indexmap 2.5.0", "serde", @@ -3877,7 +3878,7 @@ dependencies = [ "tokio", "toml", "torrust-index-located-error", - "tower", + "tower 0.4.13", "tower-http", "trace", "tracing", @@ -3913,11 +3914,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower-http" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" dependencies = [ "async-compression", "bitflags 2.6.0", @@ -3925,7 +3942,6 @@ dependencies = [ "futures-core", "http", "http-body", - "http-body-util", "pin-project-lite", "tokio", "tokio-util", @@ -4153,9 +4169,9 @@ checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] @@ -4168,9 +4184,9 @@ checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" [[package]] name = "unicode-script" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8d71f5726e5f285a935e9fe8edfd53f0491eb6e9a5774097fdabee7cd8c9cd" +checksum = "9fb421b350c9aff471779e262955939f565ec18b86c15364e6bdf0d662ca7c1f" [[package]] name = "unicode-vo" @@ -4390,9 +4406,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.5" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] diff --git a/share/default/config/index.development.sqlite3.toml b/share/default/config/index.development.sqlite3.toml index 4b4af3aa..9f00351e 100644 --- a/share/default/config/index.development.sqlite3.toml +++ b/share/default/config/index.development.sqlite3.toml @@ -3,6 +3,8 @@ app = "torrust-index" purpose = "configuration" schema_version = "2.0.0" +[website.demo] + [logging] #threshold = "off" #threshold = "error" From cdf2fe3504bc809eac4f65cbf24b4fe545d54c65 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Mon, 23 Sep 2024 15:56:13 +0100 Subject: [PATCH 8/9] fix: chedck error Mutable static variables are discouraged. I guess we should move them to the proxy service. We wanted to avoid generating the error images every time we need them becuase it's costly. I would created them when the proxy service is instanciated or maybe we can create a new service with static content for the proxy. --- src/ui/proxy.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/proxy.rs b/src/ui/proxy.rs index 78dd2fc2..a886e6de 100644 --- a/src/ui/proxy.rs +++ b/src/ui/proxy.rs @@ -32,7 +32,11 @@ pub fn load_error_images() { }); } +#[allow(static_mut_refs)] pub fn map_error_to_image(error: &Error) -> Bytes { + // todo: remove "#[allow(static_mut_refs)]" attribute by assigning a owner + // to the static mutable variables ERROR_IMAGE_*. Maybe the proxy service. + load_error_images(); unsafe { match error { From 867a1f5c5e545347b4a88a6a0dda31351bb38b88 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Tue, 24 Sep 2024 09:52:52 +0100 Subject: [PATCH 9/9] release: version 3.0.0-rc.1 --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9f86bfdc..9d6dd97a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3825,7 +3825,7 @@ dependencies = [ [[package]] name = "torrust-index" -version = "3.0.0-rc.1-develop" +version = "3.0.0-rc.1" dependencies = [ "anyhow", "argon2", @@ -3891,7 +3891,7 @@ dependencies = [ [[package]] name = "torrust-index-located-error" -version = "3.0.0-rc.1-develop" +version = "3.0.0-rc.1" dependencies = [ "thiserror", "tracing", diff --git a/Cargo.toml b/Cargo.toml index a4d64f0d..68daa021 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ license = "AGPL-3.0-only" publish = true repository = "https://github.com/torrust/torrust-tracker" rust-version = "1.72" -version = "3.0.0-rc.1-develop" +version = "3.0.0-rc.1" [profile.dev.package.sqlx-macros] opt-level = 3 @@ -89,7 +89,7 @@ text-to-png = "0" thiserror = "1" tokio = { version = "1", features = ["fs", "io-util", "macros", "net", "rt-multi-thread", "signal", "sync", "time"] } toml = "0" -torrust-index-located-error = { version = "3.0.0-rc.1-develop", path = "packages/located-error" } +torrust-index-located-error = { version = "3.0.0-rc.1", path = "packages/located-error" } tower = { version = "0.4", features = ["timeout"] } tower-http = { version = "0", features = ["compression-full", "cors", "propagate-header", "request-id", "trace"] } trace = "0.1.7"