Index: Cargo.lock ================================================================== --- Cargo.lock +++ Cargo.lock @@ -101,13 +101,13 @@ "pin-project-lite", ] [[package]] name = "async-compression" -version = "0.4.24" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d615619615a650c571269c00dca41db04b9210037fa76ed8239f70404ab56985" +checksum = "40f6024f3f856663b45fd0c9b6f2024034a702f453549449e0d84a305900dad4" dependencies = [ "brotli", "flate2", "futures-core", "memchr", @@ -248,11 +248,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "async-task" version = "4.7.1" @@ -288,13 +288,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -379,13 +379,13 @@ "alloc-stdlib", ] [[package]] name = "bumpalo" -version = "3.18.1" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -553,11 +553,11 @@ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "darling_macro" version = "0.20.11" @@ -564,11 +564,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "der" version = "0.7.10" @@ -596,21 +596,21 @@ checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "derive_builder_macro" version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "derive_more" version = "2.0.1" @@ -626,11 +626,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "digest" version = "0.10.7" @@ -658,11 +658,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "dotenvy" version = "0.15.7" @@ -693,16 +693,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "etcetera" version = "0.8.0" @@ -906,11 +906,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "futures-sink" version = "0.3.31" @@ -1158,11 +1158,11 @@ "rustls", "rustls-pki-types", "tokio", "tokio-rustls", "tower-service", - "webpki-roots 1.0.0", + "webpki-roots 1.0.1", ] [[package]] name = "hyper-tls" version = "0.6.0" @@ -1342,13 +1342,13 @@ "icu_properties", ] [[package]] name = "indexmap" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown", ] @@ -1422,13 +1422,13 @@ "spin", ] [[package]] name = "libc" -version = "0.2.173" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libm" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1645,11 +1645,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "openssl-probe" version = "0.1.6" @@ -1877,13 +1877,13 @@ "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4e529991f949c5e25755532370b8af5d114acae52326361d68d47af64aa842" +checksum = "fcebb1209ee276352ef14ff8732e24cc2b02bbac986cd74a4c81bcb2f9881970" dependencies = [ "cfg_aliases", "libc", "once_cell", "socket2 0.5.10", @@ -1900,13 +1900,13 @@ "proc-macro2", ] [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2047,11 +2047,11 @@ "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 1.0.0", + "webpki-roots 1.0.1", ] [[package]] name = "ring" version = "0.17.14" @@ -2098,11 +2098,11 @@ "quick-xml", ] [[package]] name = "rsstg" -version = "0.4.0" +version = "0.4.1" dependencies = [ "anyhow", "async-std", "atom_syndication", "chrono", @@ -2114,11 +2114,10 @@ "reqwest", "rss", "sedregex", "sqlx", "tgbot", - "thiserror", ] [[package]] name = "rustc-demangle" version = "0.1.25" @@ -2158,13 +2157,13 @@ "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.27" +version = "0.23.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" +checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643" dependencies = [ "once_cell", "ring", "rustls-pki-types", "rustls-webpki", @@ -2267,11 +2266,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "serde_json" version = "1.0.140" @@ -2323,11 +2322,11 @@ checksum = "81679d9ed988d5e9a5e6531dc3f2c28efbd639cbd1dfb628df08edea6004da77" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "sha1" version = "0.10.6" @@ -2376,16 +2375,13 @@ "rand_core 0.6.4", ] [[package]] name = "slab" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2491,11 +2487,11 @@ dependencies = [ "proc-macro2", "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "sqlx-macros-core" version = "0.8.6" @@ -2515,11 +2511,11 @@ "sha2", "sqlx-core", "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.103", + "syn 2.0.104", "url", ] [[package]] name = "sqlx-mysql" @@ -2667,13 +2663,13 @@ "unicode-ident", ] [[package]] name = "syn" -version = "2.0.103" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] @@ -2693,11 +2689,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "system-configuration" version = "0.6.1" @@ -2732,13 +2728,13 @@ "windows-sys 0.59.0", ] [[package]] name = "tgbot" -version = "0.36.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ba13ab4b7a3241c72cbbd997f95dce32bbb3e8c49b09813a151ba8c68c1b08" +checksum = "a5280aeee7c4600846513c67329304a100e6ab4295e6389e6194aa16b5e73595" dependencies = [ "async-stream", "bytes", "derive_more", "futures-util", @@ -2769,11 +2765,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "tinystr" version = "0.8.1" @@ -2938,17 +2934,17 @@ "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "tracing-core" version = "0.1.34" @@ -3100,11 +3096,11 @@ dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" @@ -3135,11 +3131,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] @@ -3188,18 +3184,18 @@ name = "webpki-roots" version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "webpki-roots 1.0.0", + "webpki-roots 1.0.1", ] [[package]] name = "webpki-roots" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2853738d1cc4f2da3a225c18ec6c3721abb31961096e9dbf5ab35fa88b19cfdb" +checksum = "8782dd5a41a24eed3a4f40b606249b3e236ca61adf1f25ea4d45c73de122b502" dependencies = [ "rustls-pki-types", ] [[package]] @@ -3253,11 +3249,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "windows-interface" version = "0.59.1" @@ -3264,11 +3260,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "windows-link" version = "0.1.3" @@ -3275,13 +3271,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-registry" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bab093bdd303a1240bb99b8aba8ea8a69ee19d34c9e2ef9594e708a4878820" +checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" dependencies = [ "windows-link", "windows-result", "windows-strings", ] @@ -3328,10 +3324,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets 0.52.6", ] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] [[package]] name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3353,16 +3358,32 @@ checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3372,10 +3393,16 @@ name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" @@ -3384,10 +3411,16 @@ name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" @@ -3396,16 +3429,28 @@ name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" @@ -3414,10 +3459,16 @@ name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" @@ -3426,10 +3477,16 @@ name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" @@ -3438,10 +3495,16 @@ name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" @@ -3450,10 +3513,16 @@ name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" @@ -3494,32 +3563,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] [[package]] name = "zerofrom" version = "0.1.6" @@ -3535,11 +3604,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", "synstructure", ] [[package]] name = "zeroize" @@ -3575,7 +3644,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.103", + "syn 2.0.104", ] Index: Cargo.toml ================================================================== --- Cargo.toml +++ Cargo.toml @@ -1,26 +1,25 @@ [package] name = "rsstg" -version = "0.4.0" +version = "0.4.1" authors = ["arcade"] edition = "2021" [dependencies] anyhow = "1.0.86" async-std = { version = "1.12.0", features = [ "attributes", "tokio1" ] } atom_syndication = { version = "0.12.4", features = [ "with-serde" ] } chrono = "0.4.38" config = { version = "0.15", default-features = false, features = [ "toml" ] } -tgbot = "0.36.1" +tgbot = "0.37" futures = "0.3.30" futures-util = "0.3.30" lazy_static = "1.5.0" regex = "1.10.6" reqwest = { version = "0.12.7", features = [ "brotli", "socks", "deflate" ]} rss = "2.0.9" sedregex = "0.2.5" sqlx = { version = "0.8", features = [ "postgres", "runtime-async-std-rustls", "chrono", "macros" ], default-features = false } -thiserror = "2.0.0" [profile.release] lto = true codegen-units = 1 Index: src/command.rs ================================================================== --- src/command.rs +++ src/command.rs @@ -17,74 +17,84 @@ Message, ParseMode::MarkdownV2, }; lazy_static! { - static ref RE_USERNAME: Regex = Regex::new(r"^@[a-zA-Z][a-zA-Z0-9_]+$").unwrap(); + static ref RE_USERNAME: Regex = Regex::new(r"^@([a-zA-Z][a-zA-Z0-9_]+)$").unwrap(); static ref RE_LINK: Regex = Regex::new(r"^https?://[a-zA-Z.0-9-]+/[-_a-zA-Z.:0-9/?=]+$").unwrap(); static ref RE_IV_HASH: Regex = Regex::new(r"^[a-f0-9]{14}$").unwrap(); } -pub async fn start(core: &Core, msg: &Message) -> Result<()> { +pub async fn start (core: &Core, msg: &Message) -> Result<()> { core.send("We are open\\. Probably\\. Visit [channel](https://t.me/rsstg_bot_help/3) for details\\.", Some(msg.chat.get_id()), Some(MarkdownV2)).await?; Ok(()) } -pub async fn list(core: &Core, msg: &Message) -> Result<()> { +pub async fn list (core: &Core, msg: &Message) -> Result<()> { let sender = msg.sender.get_user_id() .ok_or(anyhow!("Ignoring unreal users."))?; let reply = core.list(sender).await?; core.send(reply, Some(msg.chat.get_id()), Some(MarkdownV2)).await?; Ok(()) } -pub async fn command (core: &Core, msg: &Message, command: &[String]) -> Result<()> { +pub async fn command (core: &Core, command: &str, msg: &Message, words: &[String]) -> Result<()> { let mut conn = core.db.begin().await?; let sender = msg.sender.get_user_id() .ok_or(anyhow!("Ignoring unreal users."))?; - let reply = if command.len() >= 2 { - match command[1].parse::() { + let reply = if words.len() == 1 { + match words[0].parse::() { Err(err) => format!("I need a number.\n{}", &err).into(), - Ok(number) => match &command[0][..] { + Ok(number) => match command { "/check" => core.check(number, false).await .context("Channel check failed.")?.into(), "/clean" => conn.clean(number, sender).await?, "/enable" => conn.enable(number, sender).await?.into(), "/delete" => conn.delete(number, sender).await?, "/disable" => conn.disable(number, sender).await?.into(), - _ => bail!("Command {} not handled.", &command[0]), + _ => bail!("Command {command} {words:?} not handled."), }, } } else { - "This command needs a number.".into() + "This command needs exacly one number.".into() }; core.send(reply, Some(msg.chat.get_id()), None).await?; Ok(()) } -pub async fn update (core: &Core, msg: &Message, command: &[String]) -> Result<()> { +pub async fn update (core: &Core, command: &str, msg: &Message, words: &[String]) -> Result<()> { let sender = msg.sender.get_user_id() .ok_or(anyhow!("Ignoring unreal users."))?; let mut source_id: Option = None; let at_least = "Requires at least 3 parameters."; - let mut i_command = command.iter(); - let first_word = i_command.next().context(at_least)?; - match first_word.as_ref() { + let mut i_words = words.iter(); + match command { "/update" => { - let next_word = i_command.next().context(at_least)?; + let next_word = i_words.next().context(at_least)?; source_id = Some(next_word.parse::() .context(format!("I need a number, but got {next_word}."))?); }, "/add" => {}, - _ => bail!("Passing {first_word} is not possible here."), + _ => bail!("Passing {command} is not possible here."), }; let (channel, url, iv_hash, url_re) = ( - i_command.next().context(at_least)?, - i_command.next().context(at_least)?, - i_command.next(), - i_command.next()); + i_words.next().context(at_least)?, + i_words.next().context(at_least)?, + i_words.next(), + i_words.next()); + /* + let channel = match RE_USERNAME.captures(channel) { + Some(caps) => match caps.get(1) { + Some(data) => data.as_str(), + None => bail!("No string found in channel name"), + }, + None => { + bail!("Usernames should be something like \"@\\[a\\-zA\\-Z]\\[a\\-zA\\-Z0\\-9\\_]+\", aren't they?\nNot {channel:?}"); + }, + }; + */ if ! RE_USERNAME.is_match(channel) { bail!("Usernames should be something like \"@\\[a\\-zA\\-Z]\\[a\\-zA\\-Z0\\-9\\_]+\", aren't they?\nNot {channel:?}"); }; if ! RE_LINK.is_match(url) { bail!("Link should be a link to atom/rss feed, something like \"https://domain/path\".\nNot {url:?}"); @@ -113,11 +123,11 @@ } } }, None => None, }; - let chat_id = ChatUsername::from(channel.clone()); + let chat_id = ChatUsername::from(channel.as_ref()); let channel_id = core.tg.execute(GetChat::new(chat_id.clone())).await?.id; let chan_adm = core.tg.execute(GetChatAdministrators::new(chat_id)).await .context("Sorry, I have no access to that chat.")?; let (mut me, mut user) = (false, false); for admin in chan_adm { Index: src/core.rs ================================================================== --- src/core.rs +++ src/core.rs @@ -7,11 +7,10 @@ borrow::Cow, collections::{ BTreeMap, HashSet, }, - num::TryFromIntError, sync::{ Arc, Mutex }, }; @@ -37,19 +36,10 @@ Update, UpdateType, UserPeerId, }, }; -use thiserror::Error; - -#[derive(Error, Debug)] -pub enum RssError { - // #[error(transparent)] - // Tg(#[from] TgError), - #[error(transparent)] - Int(#[from] TryFromIntError), -} #[derive(Clone)] pub struct Core { owner_chat: ChatPeerId, // max_delay: u16, @@ -98,65 +88,10 @@ } }); Ok(core) } - /* - pub async fn stream(&self) -> Result<()> { - let mut offset: i64 = 0; - let mut params = GetUpdatesParams { - offset: None, - limit: Some(100), - timeout: Some(300), - allowed_updates: Some(vec![AllowedUpdate::Message]), - }; - loop { - let updates = self.tg.get_updates(¶ms).await?.result; - if updates.is_empty() { - offset = 0; - params.offset = None; - continue; - } - for update in updates { - if i64::from(update.update_id) >= offset { - offset = i64::from(update.update_id) + 1; - params.offset = Some(offset); - } - if let UpdateContent::Message(msg) = update.content { - if let Some(text) = msg.text { - if let Some(entities) = msg.entities { - let chars: Vec = text.encode_utf16().collect(); - for entity in entities { - if entity.type_field == MessageEntityType::BotCommand && entity.offset != 0 { - bail!("commands should be at message start"); - }; - let cmd = String::from_utf16_lossy(&chars[entity.offset as usize..entity.length as usize]); - let words: Vec<&str> = text.split_whitespace().collect(); - let res = match cmd.as_ref() { - "/check" | "/clean" | "/enable" | "/delete" | "/disable" => command::command(self, msg.chat.id, words).await, - "/start" => command::start(self, msg.chat.id).await, - "/list" => command::list(self, msg.chat.id).await, - "/add" | "/update" => command::update(self, msg.chat.id, words).await, - any => Err(anyhow!("Unknown command: {any}")), - }; - if let Err(err) = res { - if let Err(err2) = self.send(format!("\\#error\n```\n{err:?}\n```"), - Some(msg.chat.id), - Some(ParseMode::MarkdownV2) - ).await{ - dbg!(err2); - }; - } - }; - }; - }; - }; - } - } - } - */ - pub async fn send (&self, msg: S, target: Option, mode: Option) -> Result where S: Into { let msg = msg.into(); let mode = mode.unwrap_or(ParseMode::Html); @@ -309,15 +244,16 @@ async fn handle (&self, update: Update) { if let UpdateType::Message(msg) = update.update_type { if let Ok(cmd) = Command::try_from(msg) { let msg = cmd.get_message(); let words = cmd.get_args(); - let res = match cmd.get_name() { - "/check" | "/clean" | "/enable" | "/delete" | "/disable" => command::command(self, msg, words).await, + let command = cmd.get_name(); + let res = match command { + "/check" | "/clean" | "/enable" | "/delete" | "/disable" => command::command(self, command, msg, words).await, "/start" => command::start(self, msg).await, "/list" => command::list(self, msg).await, - "/add" | "/update" => command::update(self, msg, words).await, + "/add" | "/update" => command::update(self, command, msg, words).await, any => Err(anyhow!("Unknown command: {any}")), }; if let Err(err) = res { if let Err(err2) = self.send(format!("\\#error\n```\n{err:?}\n```"), Some(msg.chat.get_id()), Index: src/sql.rs ================================================================== --- src/sql.rs +++ src/sql.rs @@ -1,16 +1,14 @@ -use std::{ - borrow::Cow, - sync::{ - Arc, - Mutex, - }, -}; +use std::borrow::Cow; use anyhow::{ Result, bail, +}; +use async_std::sync::{ + Arc, + Mutex, }; use chrono::{ DateTime, FixedOffset, Local, @@ -48,30 +46,30 @@ pub owner: Option, } #[derive(Clone)] pub struct Db { - pool: Arc>>>, + pool: Arc>>, } pub struct Conn{ conn: PoolConnection, } impl Db { pub fn new (pguri: &str) -> Result { Ok(Db{ - pool: Arc::new(Mutex::new(Arc::new(PgPoolOptions::new() + pool: Arc::new(Mutex::new(PgPoolOptions::new() .max_connections(5) .acquire_timeout(std::time::Duration::new(300, 0)) .idle_timeout(std::time::Duration::new(60, 0)) - .connect_lazy(pguri)?))), + .connect_lazy(pguri)?)), }) } pub async fn begin(&self) -> Result { - let pool = self.pool.lock().unwrap().clone(); + let pool = self.pool.lock_arc().await; let conn = Conn::new(pool.acquire().await?).await?; Ok(conn) } }