From e14b823ba5ae3059a1b52d38ad68bc6751e553f0 Mon Sep 17 00:00:00 2001 From: lxl66566 Date: Sun, 9 Jun 2024 18:44:41 +0800 Subject: [PATCH 1/6] fix clippy issues; remove once_cell and lazy_static --- Cargo.lock | 2 -- Cargo.toml | 8 +---- build.rs | 2 -- src/client.rs | 15 +++++----- src/commands.rs | 7 ++--- src/data.rs | 18 +++++------ src/feed.rs | 80 +++++++++++++++++++++---------------------------- src/fetcher.rs | 12 ++------ src/main.rs | 12 ++++---- src/opml.rs | 4 +-- 10 files changed, 62 insertions(+), 98 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e143df78..6824a165 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1387,8 +1387,6 @@ dependencies = [ "either", "futures", "hyper-proxy", - "lazy_static", - "once_cell", "pinyin", "quick-xml", "regex", diff --git a/Cargo.toml b/Cargo.toml index 6effa9e0..dc72a62a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,18 +16,12 @@ native-tls = [ "reqwest/native-tls-vendored", "reqwest/native-tls-alpn", ] -rustls = [ - "tbot/rustls", - "hyper-proxy/rustls", - "reqwest/rustls-tls", -] +rustls = ["tbot/rustls", "hyper-proxy/rustls", "reqwest/rustls-tls"] [build-dependencies] ctl10n = "0.2.0" [dependencies] -lazy_static = "1.4" -once_cell = "1.18" anyhow = "1.0" structopt = "0.3" futures = "0.3" diff --git a/build.rs b/build.rs index a892cd1f..a62d49b2 100644 --- a/build.rs +++ b/build.rs @@ -1,8 +1,6 @@ use std::env; use std::path::Path; -use ctl10n; - const LOCALES: &[&str] = &["zh", "en"]; fn main() { diff --git a/src/client.rs b/src/client.rs index b36c6651..54e5f5ae 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1,17 +1,17 @@ use std::env; use std::time::Duration; -use once_cell::sync::OnceCell; use reqwest::{ self, header::{HeaderValue, CONTENT_TYPE}, }; +use std::sync::OnceLock; use thiserror::Error; use crate::feed::Rss; -static RESP_SIZE_LIMIT: OnceCell = OnceCell::new(); -static CLIENT: OnceCell = OnceCell::new(); +static RESP_SIZE_LIMIT: OnceLock = OnceLock::new(); +static CLIENT: OnceLock = OnceLock::new(); #[derive(Error, Debug)] pub enum FeedError { @@ -28,10 +28,9 @@ impl FeedError { match self { Self::Network(source) => tr!("network_error", source = source), Self::Parsing(source) => tr!("parsing_error", source = source), - Self::TooLarge(limit) => tr!( - "rss_size_limit_exceeded", - size = format_byte_size((*limit).into()) - ), + Self::TooLarge(limit) => { + tr!("rss_size_limit_exceeded", size = format_byte_size(*limit)) + } } } } @@ -153,7 +152,7 @@ mod test { #[test] fn max_format_byte_size() { - assert_eq!(format_byte_size(std::u64::MAX), "16EiB"); + assert_eq!(format_byte_size(u64::MAX), "16EiB"); } #[test] diff --git a/src/commands.rs b/src/commands.rs index 20faf02c..018f8d91 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -45,7 +45,7 @@ pub async fn check_command(opt: &crate::Opt, cmd: &Command) -> bool { let reply_target = &mut MsgTarget::new(cmd.chat.id, cmd.message_id); // Private mode - if !opt.admin.is_empty() && !is_from_bot_admin(&cmd, &opt.admin) { + if !opt.admin.is_empty() && !is_from_bot_admin(cmd, &opt.admin) { eprintln!( "Unauthenticated request from user/channel: {:?}, command: {}, args: {}", cmd.from, cmd.command, cmd.text.value @@ -62,7 +62,7 @@ pub async fn check_command(opt: &crate::Opt, cmd: &Command) -> bool { } // Restrict mode: bot commands are only accessible to admins. Group { .. } | Supergroup { .. } if opt.restricted => { - let user_is_admin = is_from_chat_admin(&cmd).await; + let user_is_admin = is_from_chat_admin(cmd).await; if !user_is_admin { let _ignore_result = update_response( &cmd.bot, @@ -226,8 +226,7 @@ async fn check_channel_permission( } let bot_is_admin = admins .iter() - .find(|member| member.user.id == *crate::BOT_ID.get().unwrap()) - .is_some(); + .any(|member| member.user.id == *crate::BOT_ID.get().unwrap()); if !bot_is_admin { update_response( bot, diff --git a/src/data.rs b/src/data.rs index adefa65e..815710e2 100644 --- a/src/data.rs +++ b/src/data.rs @@ -6,7 +6,6 @@ use std::time::{Duration, SystemTime}; use atomicwrites::{AtomicFile, OverwriteBehavior}; use serde::{Deserialize, Serialize}; -use serde_json; use thiserror::Error; use crate::feed; @@ -94,11 +93,11 @@ impl Database { } pub fn all_feeds(&self) -> Vec { - self.feeds.iter().map(|(_, v)| v.clone()).collect() + self.feeds.values().cloned().collect() } pub fn all_subscribers(&self) -> Vec { - self.subscribers.iter().map(|(k, _)| *k).collect() + self.subscribers.keys().copied().collect() } pub fn subscribed_feeds(&self, subscriber: SubscriberId) -> Option> { @@ -144,10 +143,7 @@ impl Database { pub fn subscribe(&mut self, subscriber: SubscriberId, rss_link: &str, rss: &feed::Rss) -> bool { let feed_id = gen_hash(&rss_link); { - let subscribed_feeds = self - .subscribers - .entry(subscriber) - .or_insert_with(HashSet::default); + let subscribed_feeds = self.subscribers.entry(subscriber).or_default(); if !subscribed_feeds.insert(feed_id) { return false; } @@ -218,7 +214,7 @@ impl Database { .remove(&from) .map(|feeds| { for feed_id in &feeds { - let feed = self.feeds.get_mut(&feed_id).unwrap(); + let feed = self.feeds.get_mut(feed_id).unwrap(); feed.subscribers.remove(&from); feed.subscribers.insert(to); } @@ -273,7 +269,7 @@ impl Database { } pub fn save(&self) -> Result<(), DataError> { - let feeds_list: Vec<&Feed> = self.feeds.iter().map(|(_id, feed)| feed).collect(); + let feeds_list: Vec<&Feed> = self.feeds.values().collect(); let file = AtomicFile::new(&self.path, OverwriteBehavior::AllowOverwrite); file.write(|file| serde_json::to_writer(file, &feeds_list)) .map_err(|e| match e { @@ -294,8 +290,8 @@ pub enum FeedUpdate { fn gen_item_hash(item: &feed::Item) -> u64 { item.id.as_ref().map(|id| gen_hash(&id)).unwrap_or_else(|| { - let title = item.title.as_ref().map(|s| s.as_str()).unwrap_or_default(); - let link = item.link.as_ref().map(|s| s.as_str()).unwrap_or_default(); + let title = item.title.as_deref().unwrap_or_default(); + let link = item.link.as_deref().unwrap_or_default(); gen_hash(&format!("{}{}", title, link)) }) } diff --git a/src/feed.rs b/src/feed.rs index d24d5eaa..2d13ae9b 100644 --- a/src/feed.rs +++ b/src/feed.rs @@ -1,17 +1,16 @@ use std::borrow::Cow; use std::cell::RefCell; -use std::mem; use std::ops::{Deref, DerefMut}; use std::rc::Rc; use std::str; -use lazy_static::lazy_static; use quick_xml::events::attributes::Attributes; use quick_xml::events::BytesStart; use quick_xml::events::Event as XmlEvent; use quick_xml::Reader as XmlReader; use regex::Regex; use serde::Deserialize; +use std::sync::LazyLock; trait FromXml: Sized { fn from_xml( @@ -76,12 +75,11 @@ impl FromXml for SkipThisElement { let mut buf = bufs.pop(); let mut depth = 1u64; loop { - match reader.read_event(&mut buf) { - Ok(XmlEvent::Start(_)) => depth += 1, - Ok(XmlEvent::End(_)) if depth == 1 => break, - Ok(XmlEvent::End(_)) => depth -= 1, - Ok(XmlEvent::Eof) => break, // just ignore EOF - Err(err) => return Err(err.into()), + match reader.read_event(&mut buf)? { + XmlEvent::Start(_) => depth += 1, + XmlEvent::End(_) if depth == 1 => break, + XmlEvent::End(_) => depth -= 1, + XmlEvent::Eof => break, // just ignore EOF _ => (), } buf.clear(); @@ -99,16 +97,15 @@ impl FromXml for Option { let mut buf = bufs.pop(); let mut output = None; loop { - match reader.read_event(&mut buf) { - Ok(XmlEvent::Start(ref e)) => { + match reader.read_event(&mut buf)? { + XmlEvent::Start(ref e) => { SkipThisElement::from_xml(bufs, reader, e)?; } - Ok(XmlEvent::Text(ref e)) => { + XmlEvent::Text(ref e) => { let text = reader.decode(e); output = text.parse().ok(); } - Ok(XmlEvent::End(_)) | Ok(XmlEvent::Eof) => break, - Err(err) => return Err(err.into()), + XmlEvent::End(_) | XmlEvent::Eof => break, _ => (), } buf.clear(); @@ -126,20 +123,19 @@ impl FromXml for Option { let mut buf = bufs.pop(); let mut content: Option = None; loop { - match reader.read_event(&mut buf) { - Ok(XmlEvent::Start(ref e)) => { + match reader.read_event(&mut buf)? { + XmlEvent::Start(ref e) => { SkipThisElement::from_xml(bufs, reader, e)?; } - Ok(XmlEvent::Text(ref e)) => { + XmlEvent::Text(ref e) => { let text = e.unescape_and_decode(reader)?; content = Some(text); } - Ok(XmlEvent::CData(ref e)) => { + XmlEvent::CData(ref e) => { let text = reader.decode(e).to_string(); content = Some(text); } - Ok(XmlEvent::End(_)) | Ok(XmlEvent::Eof) => break, - Err(err) => return Err(err.into()), + XmlEvent::End(_) | XmlEvent::Eof => break, _ => (), } buf.clear(); @@ -174,8 +170,8 @@ impl FromXml for Rss { let mut sy_freq: Option = None; loop { - match reader.read_event(&mut buf) { - Ok(XmlEvent::Empty(ref e)) => { + match reader.read_event(&mut buf)? { + XmlEvent::Empty(ref e) => { if reader.decode(e.local_name()) == "link" { match parse_atom_link(reader, e.attributes())? { Some(AtomLink::Alternate(link)) => rss.link = link, @@ -184,7 +180,7 @@ impl FromXml for Rss { } } } - Ok(XmlEvent::Start(ref e)) => { + XmlEvent::Start(ref e) => { match &*reader.decode(e.local_name()) { "channel" => { // RSS 0.9 1.0 @@ -229,12 +225,11 @@ impl FromXml for Rss { } } } - Ok(XmlEvent::End(_)) if reading_rss_1_0_head => { + XmlEvent::End(_) if reading_rss_1_0_head => { // reader.decode(e.local_name())? == "channel"; reading_rss_1_0_head = false; } - Ok(XmlEvent::End(_)) | Ok(XmlEvent::Eof) => break, - Err(err) => return Err(err.into()), + XmlEvent::End(_) | XmlEvent::Eof => break, _ => (), } buf.clear(); @@ -271,8 +266,8 @@ impl FromXml for Item { let mut buf = bufs.pop(); let mut item = Item::default(); loop { - match reader.read_event(&mut buf) { - Ok(XmlEvent::Empty(ref e)) => { + match reader.read_event(&mut buf)? { + XmlEvent::Empty(ref e) => { if reader.decode(e.name()) == "link" { if let Some(AtomLink::Alternate(link)) = parse_atom_link(reader, e.attributes())? @@ -281,7 +276,7 @@ impl FromXml for Item { } } } - Ok(XmlEvent::Start(ref e)) => { + XmlEvent::Start(ref e) => { match &*reader.decode(e.name()) { "title" => { item.title = as FromXml>::from_xml(bufs, reader, e)?; @@ -307,8 +302,7 @@ impl FromXml for Item { } } } - Ok(XmlEvent::End(_)) | Ok(XmlEvent::Eof) => break, - Err(err) => return Err(err.into()), + XmlEvent::End(_) | XmlEvent::Eof => break, _ => (), } buf.clear(); @@ -335,11 +329,11 @@ impl FromXml for Option { let mut buf = bufs.pop(); let mut output = None; loop { - match reader.read_event(&mut buf) { - Ok(XmlEvent::Start(ref e)) => { + match reader.read_event(&mut buf)? { + XmlEvent::Start(ref e) => { SkipThisElement::from_xml(bufs, reader, e)?; } - Ok(XmlEvent::Text(ref e)) => { + XmlEvent::Text(ref e) => { let period = match &*reader.decode(e) { "hourly" => SyPeriod::Hourly, "daily" => SyPeriod::Daily, @@ -350,8 +344,7 @@ impl FromXml for Option { }; output = Some(period); } - Ok(XmlEvent::End(_)) | Ok(XmlEvent::Eof) => break, - Err(err) => return Err(err.into()), + XmlEvent::End(_) | XmlEvent::Eof => break, _ => (), } buf.clear(); @@ -367,8 +360,8 @@ pub fn parse(reader: B) -> quick_xml::Result { let bufs = BufPool::new(4, 512); let mut buf = bufs.pop(); loop { - match reader.read_event(&mut buf) { - Ok(XmlEvent::Start(ref e)) => match &*reader.decode(e.name()) { + match reader.read_event(&mut buf)? { + XmlEvent::Start(ref e) => match &*reader.decode(e.name()) { "rss" => continue, "channel" | "feed" | "rdf:RDF" => { return Rss::from_xml(&bufs, &mut reader, e); @@ -377,8 +370,7 @@ pub fn parse(reader: B) -> quick_xml::Result { SkipThisElement::from_xml(&bufs, &mut reader, e)?; } }, - Ok(XmlEvent::Eof) => return Err(quick_xml::Error::UnexpectedEof("feed".to_string())), - Err(err) => return Err(err.into()), + XmlEvent::Eof => return Err(quick_xml::Error::UnexpectedEof("feed".to_string())), _ => (), } buf.clear(); @@ -402,9 +394,7 @@ fn url_relative_to_absolute(link: &mut String, host: &str) { } pub fn fix_relative_url(mut rss: Rss, rss_link: &str) -> Rss { - lazy_static! { - static ref HOST: Regex = Regex::new(r"^(https?://[^/]+)").unwrap(); - } + static HOST: LazyLock = LazyLock::new(|| Regex::new(r"^(https?://[^/]+)").unwrap()); let rss_host = HOST .captures(rss_link) .map_or(rss_link, |r| r.get(0).unwrap().as_str()); @@ -453,9 +443,7 @@ struct Buffer { impl Drop for Buffer { fn drop(&mut self) { - self.pool - .borrow_mut() - .push(mem::replace(&mut self.inner, Vec::new())) + self.pool.borrow_mut().push(std::mem::take(&mut self.inner)) } } @@ -736,7 +724,7 @@ mod test { #[test] fn atom_link_parsing() { - let data = vec![ + let data = [ r#""#, r#""#, r#""#, diff --git a/src/fetcher.rs b/src/fetcher.rs index 0116a542..023f9184 100644 --- a/src/fetcher.rs +++ b/src/fetcher.rs @@ -98,16 +98,8 @@ async fn fetch_and_push_updates( FeedUpdate::Items(items) => { let msgs = format_large_msg(format!("{}", Escape(&feed.title)), &items, |item| { - let title = item - .title - .as_ref() - .map(|s| s.as_str()) - .unwrap_or_else(|| &feed.title); - let link = item - .link - .as_ref() - .map(|s| s.as_str()) - .unwrap_or_else(|| &feed.link); + let title = item.title.as_deref().unwrap_or_else(|| &feed.title); + let link = item.link.as_deref().unwrap_or_else(|| &feed.link); format!("{}", Escape(link), Escape(title)) }); for msg in msgs { diff --git a/src/main.rs b/src/main.rs index 51852d36..92fdd63e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ #![feature(error_reporter)] +#![feature(lazy_cell)] #![recursion_limit = "256"] use std::convert::TryInto; @@ -10,9 +11,8 @@ use std::sync::Arc; use anyhow::Context; use hyper_proxy::{Intercept, Proxy}; -use once_cell::sync::OnceCell; +use std::sync::OnceLock; use structopt::StructOpt; -use tbot; use tbot::bot::Uri; use tokio::{self, sync::Mutex}; @@ -30,8 +30,8 @@ mod opml; use crate::data::Database; -static BOT_NAME: OnceCell = OnceCell::new(); -static BOT_ID: OnceCell = OnceCell::new(); +static BOT_NAME: OnceLock = OnceLock::new(); +static BOT_ID: OnceLock = OnceLock::new(); #[derive(Debug, StructOpt)] #[structopt( @@ -111,8 +111,8 @@ async fn main() -> anyhow::Result<()> { let opt = Opt::from_args(); let db = Arc::new(Mutex::new(Database::open(opt.database.clone())?)); - let bot_builder = tbot::bot::Builder::with_string_token(opt.token.clone()) - .server_uri(opt.api_uri.clone()); + let bot_builder = + tbot::bot::Builder::with_string_token(opt.token.clone()).server_uri(opt.api_uri.clone()); let bot = if let Some(proxy) = init_proxy() { bot_builder.proxy(proxy).build() } else { diff --git a/src/opml.rs b/src/opml.rs index de576370..7a30ca3c 100644 --- a/src/opml.rs +++ b/src/opml.rs @@ -55,10 +55,10 @@ pub fn into_opml(feeds: Vec) -> String { } // type of `attrs` is for zero allocation -fn with_tag<'a, W, F>( +fn with_tag( writer: &mut Writer, tag: &[u8], - attrs: &mut [Option>], + attrs: &mut [Option>], then: F, ) -> quick_xml::Result<()> where From 64e4bf5c6ad9715c7774557b64739615bbd3b758 Mon Sep 17 00:00:00 2001 From: lxl66566 Date: Sun, 9 Jun 2024 19:32:20 +0800 Subject: [PATCH 2/6] bump reqwest version from 0.11 to 0.12 --- Cargo.lock | 667 ++++++++++++++++++++++++++++++----------------------- Cargo.toml | 2 +- 2 files changed, 378 insertions(+), 291 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6824a165..c3672a53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,15 +99,21 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.56" +version = "0.1.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +checksum = "531b97fb4cd3dfdce92c35dedbfdc1f0b9d8091c8ca943d6dae340ef5012d514" dependencies = [ "proc-macro2", "quote", - "syn 1.0.98", + "syn 2.0.29", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "atomicwrites" version = "0.4.1" @@ -159,9 +165,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64" -version = "0.21.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" @@ -186,15 +192,15 @@ checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "bytes" -version = "1.1.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" [[package]] name = "cfg-if" @@ -282,7 +288,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" dependencies = [ - "sct 0.6.1", + "sct", ] [[package]] @@ -295,12 +301,6 @@ dependencies = [ "toml", ] -[[package]] -name = "data-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" - [[package]] name = "digest" version = "0.10.3" @@ -327,16 +327,10 @@ dependencies = [ ] [[package]] -name = "enum-as-inner" -version = "0.5.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" -dependencies = [ - "heck 0.4.0", - "proc-macro2", - "quote", - "syn 1.0.98", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" @@ -510,9 +504,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -527,16 +521,16 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "h2" -version = "0.3.19" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", - "http", + "http 1.1.0", "indexmap", "slab", "tokio", @@ -553,6 +547,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + [[package]] name = "headers" version = "0.3.7" @@ -563,7 +563,7 @@ dependencies = [ "bitflags", "bytes", "headers-core", - "http", + "http 0.2.8", "httpdate", "mime", "sha-1", @@ -575,7 +575,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http", + "http 0.2.8", ] [[package]] @@ -587,12 +587,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - [[package]] name = "hermit-abi" version = "0.1.19" @@ -609,21 +603,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] -name = "hostname" -version = "0.3.1" +name = "http" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ - "libc", - "match_cfg", - "winapi", + "bytes", + "fnv", + "itoa", ] [[package]] name = "http" -version = "0.2.8" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -637,15 +631,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", - "http", + "http 0.2.8", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http 1.1.0", + "http-body 1.0.0", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -663,9 +680,8 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "http 0.2.8", + "http-body 0.4.5", "httparse", "httpdate", "itoa", @@ -677,6 +693,26 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http 1.1.0", + "http-body 1.0.0", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-proxy" version = "0.9.1" @@ -686,17 +722,17 @@ dependencies = [ "bytes", "futures", "headers", - "http", - "hyper", + "http 0.2.8", + "hyper 0.14.19", "hyper-rustls 0.22.1", - "hyper-tls", + "hyper-tls 0.5.0", "native-tls", "rustls-native-certs", "tokio", "tokio-native-tls", "tokio-rustls 0.22.0", "tower-service", - "webpki 0.21.4", + "webpki", ] [[package]] @@ -707,26 +743,30 @@ checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" dependencies = [ "ct-logs", "futures-util", - "hyper", + "hyper 0.14.19", "log", "rustls 0.19.1", "rustls-native-certs", "tokio", "tokio-rustls 0.22.0", - "webpki 0.21.4", + "webpki", ] [[package]] name = "hyper-rustls" -version = "0.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ - "http", - "hyper", - "rustls 0.21.2", + "futures-util", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", + "rustls 0.22.4", + "rustls-pki-types", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls 0.25.0", + "tower-service", ] [[package]] @@ -737,10 +777,10 @@ checksum = "e01b408a306f4e49b1eac23dd88f0852c0abb2b1d162d498cd889cfcd56d8eec" dependencies = [ "async-socks5", "futures", - "http", - "hyper", + "http 0.2.8", + "hyper 0.14.19", "hyper-rustls 0.22.1", - "hyper-tls", + "hyper-tls 0.5.0", "rustls 0.19.1", "rustls-native-certs", "thiserror", @@ -754,12 +794,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.19", "native-tls", "tokio", "tokio-native-tls", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.3.1", + "pin-project-lite", + "socket2 0.5.3", + "tokio", + "tower", + "tower-service", + "tracing", +] + [[package]] name = "iana-time-zone" version = "0.1.57" @@ -796,12 +872,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.1" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ - "autocfg", - "hashbrown", + "equivalent", + "hashbrown 0.14.5", ] [[package]] @@ -824,18 +900,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ipconfig" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" -dependencies = [ - "socket2 0.4.9", - "widestring", - "winapi", - "winreg 0.7.0", -] - [[package]] name = "ipnet" version = "2.5.0" @@ -878,15 +942,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" - -[[package]] -name = "linked-hash-map" -version = "0.5.6" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "linux-raw-sys" @@ -913,21 +971,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - [[package]] name = "matches" version = "0.1.9" @@ -1165,12 +1208,6 @@ dependencies = [ "syn 1.0.98", ] -[[package]] -name = "ppv-lite86" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1204,12 +1241,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quick-xml" version = "0.23.0" @@ -1229,36 +1260,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom", -] - [[package]] name = "redox_syscall" version = "0.2.13" @@ -1308,22 +1309,24 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.18" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "async-compression", - "base64 0.21.2", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", - "http", - "http-body", - "hyper", - "hyper-rustls 0.24.0", - "hyper-tls", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-rustls 0.26.0", + "hyper-tls 0.6.0", + "hyper-util", "ipnet", "js-sys", "log", @@ -1332,33 +1335,25 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.2", + "rustls 0.22.4", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", + "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", + "tokio-rustls 0.25.0", "tokio-util", "tower-service", - "trust-dns-resolver", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "webpki-roots", - "winreg 0.10.1", -] - -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error", + "winreg", ] [[package]] @@ -1370,12 +1365,27 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + [[package]] name = "rssbot" version = "2.0.0-alpha.12" @@ -1435,21 +1445,23 @@ checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ "base64 0.13.0", "log", - "ring", - "sct 0.6.1", - "webpki 0.21.4", + "ring 0.16.20", + "sct", + "webpki", ] [[package]] name = "rustls" -version = "0.21.2" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", - "ring", + "ring 0.17.8", + "rustls-pki-types", "rustls-webpki", - "sct 0.7.0", + "subtle", + "zeroize", ] [[package]] @@ -1466,21 +1478,29 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.13.0", + "base64 0.22.1", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" -version = "0.100.2" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ - "ring", - "untrusted", + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", ] [[package]] @@ -1511,18 +1531,8 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -1619,9 +1629,9 @@ checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "smallvec" -version = "1.9.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" @@ -1649,6 +1659,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "strsim" version = "0.8.0" @@ -1672,13 +1688,19 @@ version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ - "heck 0.3.3", + "heck", "proc-macro-error", "proc-macro2", "quote", "syn 1.0.98", ] +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "syn" version = "1.0.98" @@ -1701,17 +1723,44 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tbot" version = "0.6.7" -source = "git+https://gitlab.com/SnejUgal/tbot.git#3b1fbfef72a4638afff0636a1d887001f47e23dd" +source = "git+https://gitlab.com/SnejUgal/tbot.git#1c3692ea007df7fa94183b422c2741ad731df5e0" dependencies = [ "futures", - "hyper", + "hyper 0.14.19", "hyper-proxy", "hyper-rustls 0.22.1", "hyper-socks2", - "hyper-tls", + "hyper-tls 0.5.0", "is-macro", "native-tls", "serde", @@ -1841,16 +1890,17 @@ checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ "rustls 0.19.1", "tokio", - "webpki 0.21.4", + "webpki", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.21.2", + "rustls 0.22.4", + "rustls-pki-types", "tokio", ] @@ -1876,7 +1926,7 @@ dependencies = [ "futures-io", "futures-sink", "futures-util", - "hashbrown", + "hashbrown 0.12.1", "pin-project-lite", "slab", "tokio", @@ -1892,6 +1942,27 @@ dependencies = [ "serde", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -1940,51 +2011,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "trust-dns-proto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna", - "ipnet", - "lazy_static", - "rand", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lazy_static", - "lru-cache", - "parking_lot", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", - "trust-dns-proto", -] - [[package]] name = "try-lock" version = "0.2.3" @@ -2045,6 +2071,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.2.2" @@ -2179,35 +2211,19 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] name = "webpki-roots" -version = "0.22.3" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" +checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" dependencies = [ - "webpki 0.22.0", + "rustls-pki-types", ] -[[package]] -name = "widestring" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" - [[package]] name = "winapi" version = "0.3.9" @@ -2236,7 +2252,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets", + "windows-targets 0.48.0", ] [[package]] @@ -2258,7 +2274,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", ] [[package]] @@ -2267,21 +2292,43 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ - "windows_aarch64_gnullvm", + "windows_aarch64_gnullvm 0.48.0", "windows_aarch64_msvc 0.48.0", "windows_i686_gnu 0.48.0", "windows_i686_msvc 0.48.0", "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm", + "windows_x86_64_gnullvm 0.48.0", "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" @@ -2294,6 +2341,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + [[package]] name = "windows_i686_gnu" version = "0.36.1" @@ -2306,6 +2359,18 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + [[package]] name = "windows_i686_msvc" version = "0.36.1" @@ -2318,6 +2383,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" @@ -2330,12 +2401,24 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -2349,19 +2432,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] -name = "winreg" -version = "0.7.0" +name = "windows_x86_64_msvc" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" -dependencies = [ - "winapi", -] +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winreg" -version = "0.10.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/Cargo.toml b/Cargo.toml index dc72a62a..ae3e9e18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,6 @@ version = "0.9" default-features = false [dependencies.reqwest] -version = "0.11" +version = "0.12" default-features = false features = ["gzip", "json"] From 9ca1749a61b2df0559bcdec4d9ab7e4f3d73d950 Mon Sep 17 00:00:00 2001 From: lxl66566 Date: Mon, 10 Jun 2024 10:41:28 +0800 Subject: [PATCH 3/6] add human readable support for max-feed-size --- README.en.md | 27 ++++++++++++++------------- README.md | 29 +++++++++++++++-------------- src/main.rs | 45 +++++++++++++++++++++++++++++++++++++++------ 3 files changed, 68 insertions(+), 33 deletions(-) diff --git a/README.en.md b/README.en.md index 0e19b8d9..6dac8a87 100644 --- a/README.en.md +++ b/README.en.md @@ -5,16 +5,17 @@ Telegram RSS bot [@RustRssBot](http://t.me/RustRssBot) **Supports:** - - [x] RSS 0.9 - - [x] RSS 0.91 - - [x] RSS 0.92 - - [x] RSS 0.93 - - [x] RSS 0.94 - - [x] RSS 1.0 - - [x] RSS 2.0 - - [x] Atom 0.3 - - [x] Atom 1.0 - - [x] JSON Feed 1 + +- [x] RSS 0.9 +- [x] RSS 0.91 +- [x] RSS 0.92 +- [x] RSS 0.93 +- [x] RSS 0.94 +- [x] RSS 1.0 +- [x] RSS 2.0 +- [x] Atom 0.3 +- [x] Atom 1.0 +- [x] JSON Feed 1 ## Usage @@ -25,13 +26,13 @@ Telegram RSS bot [@RustRssBot](http://t.me/RustRssBot) ## Download -The pre-compiled binaries can be downloaded directly from [Releases](https://github.com/iovxw/rssbot/releases). Make sure to use the english binary (`rssbot-en-amd64-linux`). The Linux version is statically linked to *musl*, no other dependencies required. +The pre-compiled binaries can be downloaded directly from [Releases](https://github.com/iovxw/rssbot/releases). Make sure to use the english binary (`rssbot-en-amd64-linux`). The Linux version is statically linked to _musl_, no other dependencies required. ## Compile **Please try to download from the Link above, if that's not feasible or you have other requirements you should compile manually** -Install *Rust Nightly* and *Cargo* ([`rustup` recommended](https://www.rustup.rs/)) first, then: +Install _Rust Nightly_ and _Cargo_ ([`rustup` recommended](https://www.rustup.rs/)) first, then: ``` LOCALE=en cargo build --release @@ -58,7 +59,7 @@ OPTIONS: multiple times to allow multiple admins --api-uri Custom telegram api URI [default: https://api.telegram.org/] -d, --database Path to database [default: ./rssbot.json] - --max-feed-size Maximum feed size, 0 is unlimited [default: 2097152] + --max-feed-size Maximum feed size, 0 is unlimited [default: 2M] --max-interval Maximum fetch interval [default: 43200] --min-interval Minimum fetch interval [default: 300] diff --git a/README.md b/README.md index a2b8ec4c..587bc7c5 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,20 @@ **Other Languages:** [English](README.en.md) -Telegram RSS 机器人 [@RustRssBot](http://t.me/RustRssBot) +Telegram RSS 机器人  [@RustRssBot](http://t.me/RustRssBot) **支持:** - - [x] RSS 0.9 - - [x] RSS 0.91 - - [x] RSS 0.92 - - [x] RSS 0.93 - - [x] RSS 0.94 - - [x] RSS 1.0 - - [x] RSS 2.0 - - [x] Atom 0.3 - - [x] Atom 1.0 - - [x] JSON Feed 1 + +- [x] RSS 0.9 +- [x] RSS 0.91 +- [x] RSS 0.92 +- [x] RSS 0.93 +- [x] RSS 0.94 +- [x] RSS 1.0 +- [x] RSS 2.0 +- [x] Atom 0.3 +- [x] Atom 1.0 +- [x] JSON Feed 1 ## 使用 @@ -25,13 +26,13 @@ Telegram RSS 机器人 [@RustRssBot](http://t.me/RustRssBot) ## 下载 -可直接从 [Releases](https://github.com/iovxw/rssbot/releases) 下载预编译的程序(带 `zh` 的为中文版), Linux 版本为 *musl* 静态链接, 无需其他依赖 +可直接从 [Releases](https://github.com/iovxw/rssbot/releases) 下载预编译的程序(带 `zh` 的为中文版), Linux 版本为 _musl_ 静态链接, 无需其他依赖 ## 编译 **请先尝试从上面下载, 如不可行或者有其他需求再手动编译** -先安装 *Rust Nightly* 以及 *Cargo* (推荐使用 [`rustup`](https://www.rustup.rs/)), 然后: +先安装 _Rust Nightly_ 以及 _Cargo_ (推荐使用 [`rustup`](https://www.rustup.rs/)), 然后: ``` cargo build --release @@ -56,7 +57,7 @@ OPTIONS: multiple times to allow multiple admins --api-uri Custom telegram api URI [default: https://api.telegram.org/] -d, --database Path to database [default: ./rssbot.json] - --max-feed-size Maximum feed size, 0 is unlimited [default: 2097152] + --max-feed-size Maximum feed size, 0 is unlimited [default: 2M] --max-interval Maximum fetch interval [default: 43200] --min-interval Minimum fetch interval [default: 300] diff --git a/src/main.rs b/src/main.rs index 92fdd63e..745a32b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ use std::path::PathBuf; use std::process; use std::sync::Arc; -use anyhow::Context; +use anyhow::{anyhow, Context}; use hyper_proxy::{Intercept, Proxy}; use std::sync::OnceLock; use structopt::StructOpt; @@ -67,10 +67,10 @@ pub struct Opt { )] // default is 12 hours max_interval: u32, - /// Maximum feed size, 0 is unlimited - #[structopt(long, value_name = "bytes", default_value = "2097152")] - // default is 2MiB - max_feed_size: u64, + /// Maximum feed size, 0 is unlimited. + #[structopt(long, value_name = "bytes", default_value = "2M")] + // Default is 2M. + max_feed_size: String, /// Private mode, only specified user can use this bot. /// This argument can be passed multiple times to allow multiple admins #[structopt( @@ -105,6 +105,22 @@ fn check_interval(s: String) -> Result<(), String> { }) } +/// Parse human readable size into bytes. +fn parse_human_size(s: &str) -> anyhow::Result { + const BASE: u64 = 1024; + let s = s.trim().trim_end_matches(|x| x == 'B' || x == 'b'); + match s.chars().last().map(|x| x.to_ascii_lowercase()) { + Some('b') => Ok(s[..s.len() - 1].parse()?), + Some('k') => Ok(s[..s.len() - 1].parse::()? * BASE), + Some('m') => Ok(s[..s.len() - 1].parse::()? * BASE.pow(2)), + Some('g') => Ok(s[..s.len() - 1].parse::()? * BASE.pow(3)), + Some('t') => Ok(s[..s.len() - 1].parse::()? * BASE.pow(4)), + Some(x) if x.is_ascii_digit() => Ok(s.parse()?), + Some(x) => Err(anyhow!("invalid size character: {}", x)), + None => Err(anyhow!("empty size")), + } +} + #[tokio::main] async fn main() -> anyhow::Result<()> { enable_fail_fast(); @@ -125,7 +141,11 @@ async fn main() -> anyhow::Result<()> { .context("Initialization failed, check your network and Telegram token")?; let bot_name = me.user.username.clone().unwrap(); - crate::client::init_client(&bot_name, opt.insecure, opt.max_feed_size); + crate::client::init_client( + &bot_name, + opt.insecure, + parse_human_size(&opt.max_feed_size).context("Invalid max_feed_size")?, + ); BOT_NAME.set(bot_name).unwrap(); BOT_ID.set(me.user.id).unwrap(); @@ -173,3 +193,16 @@ fn print_error(err: E) { .show_backtrace(true) ); } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_parse_human_size() { + assert_eq!(parse_human_size("2M").unwrap(), 2_097_152); + assert_eq!(parse_human_size("2G").unwrap(), 2_147_483_648); + assert_eq!(parse_human_size("2mb").unwrap(), 2_097_152); + assert_eq!(parse_human_size("2097152").unwrap(), 2_097_152); + } +} From e74e8428a3b24d3e1a5630dd707d01d4cbe92610 Mon Sep 17 00:00:00 2001 From: iovxw Date: Sun, 22 Dec 2024 11:26:43 +0800 Subject: [PATCH 4/6] Revert "bump reqwest version from 0.11 to 0.12" This reverts commit 64e4bf5c6ad9715c7774557b64739615bbd3b758. --- Cargo.lock | 667 +++++++++++++++++++++++------------------------------ Cargo.toml | 2 +- 2 files changed, 291 insertions(+), 378 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c3672a53..6824a165 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,21 +99,15 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.76" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531b97fb4cd3dfdce92c35dedbfdc1f0b9d8091c8ca943d6dae340ef5012d514" +checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 1.0.98", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "atomicwrites" version = "0.4.1" @@ -165,9 +159,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64" -version = "0.22.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "bitflags" @@ -192,15 +186,15 @@ checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "bytes" -version = "1.6.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.99" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cfg-if" @@ -288,7 +282,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" dependencies = [ - "sct", + "sct 0.6.1", ] [[package]] @@ -301,6 +295,12 @@ dependencies = [ "toml", ] +[[package]] +name = "data-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + [[package]] name = "digest" version = "0.10.3" @@ -327,10 +327,16 @@ dependencies = [ ] [[package]] -name = "equivalent" -version = "1.0.1" +name = "enum-as-inner" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +dependencies = [ + "heck 0.4.0", + "proc-macro2", + "quote", + "syn 1.0.98", +] [[package]] name = "errno" @@ -504,9 +510,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", "libc", @@ -521,16 +527,16 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "h2" -version = "0.4.5" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" dependencies = [ - "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http 1.1.0", + "futures-util", + "http", "indexmap", "slab", "tokio", @@ -547,12 +553,6 @@ dependencies = [ "ahash", ] -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "headers" version = "0.3.7" @@ -563,7 +563,7 @@ dependencies = [ "bitflags", "bytes", "headers-core", - "http 0.2.8", + "http", "httpdate", "mime", "sha-1", @@ -575,7 +575,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http 0.2.8", + "http", ] [[package]] @@ -587,6 +587,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -603,21 +609,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] -name = "http" -version = "0.2.8" +name = "hostname" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" dependencies = [ - "bytes", - "fnv", - "itoa", + "libc", + "match_cfg", + "winapi", ] [[package]] name = "http" -version = "1.1.0" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", @@ -631,38 +637,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", - "http 0.2.8", - "pin-project-lite", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http 1.1.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" -dependencies = [ - "bytes", - "futures-core", - "http 1.1.0", - "http-body 1.0.0", + "http", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" [[package]] name = "httpdate" @@ -680,8 +663,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "http 0.2.8", - "http-body 0.4.5", + "h2", + "http", + "http-body", "httparse", "httpdate", "itoa", @@ -693,26 +677,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2", - "http 1.1.0", - "http-body 1.0.0", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - [[package]] name = "hyper-proxy" version = "0.9.1" @@ -722,17 +686,17 @@ dependencies = [ "bytes", "futures", "headers", - "http 0.2.8", - "hyper 0.14.19", + "http", + "hyper", "hyper-rustls 0.22.1", - "hyper-tls 0.5.0", + "hyper-tls", "native-tls", "rustls-native-certs", "tokio", "tokio-native-tls", "tokio-rustls 0.22.0", "tower-service", - "webpki", + "webpki 0.21.4", ] [[package]] @@ -743,30 +707,26 @@ checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" dependencies = [ "ct-logs", "futures-util", - "hyper 0.14.19", + "hyper", "log", "rustls 0.19.1", "rustls-native-certs", "tokio", "tokio-rustls 0.22.0", - "webpki", + "webpki 0.21.4", ] [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" dependencies = [ - "futures-util", - "http 1.1.0", - "hyper 1.3.1", - "hyper-util", - "rustls 0.22.4", - "rustls-pki-types", + "http", + "hyper", + "rustls 0.21.2", "tokio", - "tokio-rustls 0.25.0", - "tower-service", + "tokio-rustls 0.24.1", ] [[package]] @@ -777,10 +737,10 @@ checksum = "e01b408a306f4e49b1eac23dd88f0852c0abb2b1d162d498cd889cfcd56d8eec" dependencies = [ "async-socks5", "futures", - "http 0.2.8", - "hyper 0.14.19", + "http", + "hyper", "hyper-rustls 0.22.1", - "hyper-tls 0.5.0", + "hyper-tls", "rustls 0.19.1", "rustls-native-certs", "thiserror", @@ -794,48 +754,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.19", + "hyper", "native-tls", "tokio", "tokio-native-tls", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper 1.3.1", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", - "pin-project-lite", - "socket2 0.5.3", - "tokio", - "tower", - "tower-service", - "tracing", -] - [[package]] name = "iana-time-zone" version = "0.1.57" @@ -872,12 +796,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ - "equivalent", - "hashbrown 0.14.5", + "autocfg", + "hashbrown", ] [[package]] @@ -900,6 +824,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "ipconfig" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" +dependencies = [ + "socket2 0.4.9", + "widestring", + "winapi", + "winreg 0.7.0", +] + [[package]] name = "ipnet" version = "2.5.0" @@ -942,9 +878,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "linked-hash-map" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" @@ -971,6 +913,21 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + [[package]] name = "matches" version = "0.1.9" @@ -1208,6 +1165,12 @@ dependencies = [ "syn 1.0.98", ] +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1241,6 +1204,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quick-xml" version = "0.23.0" @@ -1260,6 +1229,36 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + [[package]] name = "redox_syscall" version = "0.2.13" @@ -1309,24 +1308,22 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.4" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ "async-compression", - "base64 0.22.1", + "base64 0.21.2", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "hyper 1.3.1", - "hyper-rustls 0.26.0", - "hyper-tls 0.6.0", - "hyper-util", + "http", + "http-body", + "hyper", + "hyper-rustls 0.24.0", + "hyper-tls", "ipnet", "js-sys", "log", @@ -1335,55 +1332,48 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.4", + "rustls 0.21.2", "rustls-pemfile", - "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", - "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.25.0", + "tokio-rustls 0.24.1", "tokio-util", "tower-service", + "trust-dns-resolver", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "webpki-roots", - "winreg", + "winreg 0.10.1", ] [[package]] -name = "ring" -version = "0.16.20" +name = "resolv-conf" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", + "hostname", + "quick-error", ] [[package]] name = "ring" -version = "0.17.8" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", - "cfg-if", - "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys 0.52.0", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", ] [[package]] @@ -1445,23 +1435,21 @@ checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ "base64 0.13.0", "log", - "ring 0.16.20", - "sct", - "webpki", + "ring", + "sct 0.6.1", + "webpki 0.21.4", ] [[package]] name = "rustls" -version = "0.22.4" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" dependencies = [ "log", - "ring 0.17.8", - "rustls-pki-types", + "ring", "rustls-webpki", - "subtle", - "zeroize", + "sct 0.7.0", ] [[package]] @@ -1478,29 +1466,21 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" dependencies = [ - "base64 0.22.1", - "rustls-pki-types", + "base64 0.13.0", ] -[[package]] -name = "rustls-pki-types" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" - [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" dependencies = [ - "ring 0.17.8", - "rustls-pki-types", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -1531,8 +1511,18 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring", + "untrusted", +] + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", ] [[package]] @@ -1629,9 +1619,9 @@ checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "smallvec" -version = "1.13.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "socket2" @@ -1659,12 +1649,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "strsim" version = "0.8.0" @@ -1688,19 +1672,13 @@ version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ - "heck", + "heck 0.3.3", "proc-macro-error", "proc-macro2", "quote", "syn 1.0.98", ] -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - [[package]] name = "syn" version = "1.0.98" @@ -1723,44 +1701,17 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "tbot" version = "0.6.7" -source = "git+https://gitlab.com/SnejUgal/tbot.git#1c3692ea007df7fa94183b422c2741ad731df5e0" +source = "git+https://gitlab.com/SnejUgal/tbot.git#3b1fbfef72a4638afff0636a1d887001f47e23dd" dependencies = [ "futures", - "hyper 0.14.19", + "hyper", "hyper-proxy", "hyper-rustls 0.22.1", "hyper-socks2", - "hyper-tls 0.5.0", + "hyper-tls", "is-macro", "native-tls", "serde", @@ -1890,17 +1841,16 @@ checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ "rustls 0.19.1", "tokio", - "webpki", + "webpki 0.21.4", ] [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.22.4", - "rustls-pki-types", + "rustls 0.21.2", "tokio", ] @@ -1926,7 +1876,7 @@ dependencies = [ "futures-io", "futures-sink", "futures-util", - "hashbrown 0.12.1", + "hashbrown", "pin-project-lite", "slab", "tokio", @@ -1942,27 +1892,6 @@ dependencies = [ "serde", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" version = "0.3.2" @@ -2011,6 +1940,51 @@ dependencies = [ "tracing", ] +[[package]] +name = "trust-dns-proto" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "lazy_static", + "rand", + "smallvec", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lazy_static", + "lru-cache", + "parking_lot", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto", +] + [[package]] name = "try-lock" version = "0.2.3" @@ -2071,12 +2045,6 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - [[package]] name = "url" version = "2.2.2" @@ -2211,19 +2179,35 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring", + "untrusted", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", ] [[package]] name = "webpki-roots" -version = "0.26.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" +checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" dependencies = [ - "rustls-pki-types", + "webpki 0.22.0", ] +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + [[package]] name = "winapi" version = "0.3.9" @@ -2252,7 +2236,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.0", + "windows-targets", ] [[package]] @@ -2274,16 +2258,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", + "windows-targets", ] [[package]] @@ -2292,43 +2267,21 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_gnullvm", "windows_aarch64_msvc 0.48.0", "windows_i686_gnu 0.48.0", "windows_i686_msvc 0.48.0", "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_gnullvm", "windows_x86_64_msvc 0.48.0", ] -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - [[package]] name = "windows_aarch64_msvc" version = "0.36.1" @@ -2341,12 +2294,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - [[package]] name = "windows_i686_gnu" version = "0.36.1" @@ -2359,18 +2306,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - [[package]] name = "windows_i686_msvc" version = "0.36.1" @@ -2383,12 +2318,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - [[package]] name = "windows_x86_64_gnu" version = "0.36.1" @@ -2401,24 +2330,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -2431,24 +2348,20 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - [[package]] name = "winreg" -version = "0.52.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "winapi", ] [[package]] -name = "zeroize" -version = "1.8.1" +name = "winreg" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] diff --git a/Cargo.toml b/Cargo.toml index ae3e9e18..dc72a62a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,6 @@ version = "0.9" default-features = false [dependencies.reqwest] -version = "0.12" +version = "0.11" default-features = false features = ["gzip", "json"] From 0cb160c148d1485f2d2f3759e8ec64aec99923c3 Mon Sep 17 00:00:00 2001 From: iovxw Date: Sun, 22 Dec 2024 11:39:20 +0800 Subject: [PATCH 5/6] Partially revert 9ca1749a61b2df0559bcdec4d9ab7e4f3d73d950 --- README.en.md | 27 +++++++++++++-------------- README.md | 29 ++++++++++++++--------------- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/README.en.md b/README.en.md index 6dac8a87..0e19b8d9 100644 --- a/README.en.md +++ b/README.en.md @@ -5,17 +5,16 @@ Telegram RSS bot [@RustRssBot](http://t.me/RustRssBot) **Supports:** - -- [x] RSS 0.9 -- [x] RSS 0.91 -- [x] RSS 0.92 -- [x] RSS 0.93 -- [x] RSS 0.94 -- [x] RSS 1.0 -- [x] RSS 2.0 -- [x] Atom 0.3 -- [x] Atom 1.0 -- [x] JSON Feed 1 + - [x] RSS 0.9 + - [x] RSS 0.91 + - [x] RSS 0.92 + - [x] RSS 0.93 + - [x] RSS 0.94 + - [x] RSS 1.0 + - [x] RSS 2.0 + - [x] Atom 0.3 + - [x] Atom 1.0 + - [x] JSON Feed 1 ## Usage @@ -26,13 +25,13 @@ Telegram RSS bot [@RustRssBot](http://t.me/RustRssBot) ## Download -The pre-compiled binaries can be downloaded directly from [Releases](https://github.com/iovxw/rssbot/releases). Make sure to use the english binary (`rssbot-en-amd64-linux`). The Linux version is statically linked to _musl_, no other dependencies required. +The pre-compiled binaries can be downloaded directly from [Releases](https://github.com/iovxw/rssbot/releases). Make sure to use the english binary (`rssbot-en-amd64-linux`). The Linux version is statically linked to *musl*, no other dependencies required. ## Compile **Please try to download from the Link above, if that's not feasible or you have other requirements you should compile manually** -Install _Rust Nightly_ and _Cargo_ ([`rustup` recommended](https://www.rustup.rs/)) first, then: +Install *Rust Nightly* and *Cargo* ([`rustup` recommended](https://www.rustup.rs/)) first, then: ``` LOCALE=en cargo build --release @@ -59,7 +58,7 @@ OPTIONS: multiple times to allow multiple admins --api-uri Custom telegram api URI [default: https://api.telegram.org/] -d, --database Path to database [default: ./rssbot.json] - --max-feed-size Maximum feed size, 0 is unlimited [default: 2M] + --max-feed-size Maximum feed size, 0 is unlimited [default: 2097152] --max-interval Maximum fetch interval [default: 43200] --min-interval Minimum fetch interval [default: 300] diff --git a/README.md b/README.md index 587bc7c5..a2b8ec4c 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,19 @@ **Other Languages:** [English](README.en.md) -Telegram RSS 机器人  [@RustRssBot](http://t.me/RustRssBot) +Telegram RSS 机器人 [@RustRssBot](http://t.me/RustRssBot) **支持:** - -- [x] RSS 0.9 -- [x] RSS 0.91 -- [x] RSS 0.92 -- [x] RSS 0.93 -- [x] RSS 0.94 -- [x] RSS 1.0 -- [x] RSS 2.0 -- [x] Atom 0.3 -- [x] Atom 1.0 -- [x] JSON Feed 1 + - [x] RSS 0.9 + - [x] RSS 0.91 + - [x] RSS 0.92 + - [x] RSS 0.93 + - [x] RSS 0.94 + - [x] RSS 1.0 + - [x] RSS 2.0 + - [x] Atom 0.3 + - [x] Atom 1.0 + - [x] JSON Feed 1 ## 使用 @@ -26,13 +25,13 @@ Telegram RSS 机器人  [@RustRssBot](http://t.me/RustRssBot) ## 下载 -可直接从 [Releases](https://github.com/iovxw/rssbot/releases) 下载预编译的程序(带 `zh` 的为中文版), Linux 版本为 _musl_ 静态链接, 无需其他依赖 +可直接从 [Releases](https://github.com/iovxw/rssbot/releases) 下载预编译的程序(带 `zh` 的为中文版), Linux 版本为 *musl* 静态链接, 无需其他依赖 ## 编译 **请先尝试从上面下载, 如不可行或者有其他需求再手动编译** -先安装 _Rust Nightly_ 以及 _Cargo_ (推荐使用 [`rustup`](https://www.rustup.rs/)), 然后: +先安装 *Rust Nightly* 以及 *Cargo* (推荐使用 [`rustup`](https://www.rustup.rs/)), 然后: ``` cargo build --release @@ -57,7 +56,7 @@ OPTIONS: multiple times to allow multiple admins --api-uri Custom telegram api URI [default: https://api.telegram.org/] -d, --database Path to database [default: ./rssbot.json] - --max-feed-size Maximum feed size, 0 is unlimited [default: 2M] + --max-feed-size Maximum feed size, 0 is unlimited [default: 2097152] --max-interval Maximum fetch interval [default: 43200] --min-interval Minimum fetch interval [default: 300] From b27ab897a550059e7740e4cff51bc519da283b04 Mon Sep 17 00:00:00 2001 From: iovxw Date: Sun, 22 Dec 2024 11:45:46 +0800 Subject: [PATCH 6/6] Partially revert e14b823ba5ae3059a1b52d38ad68bc6751e553f0 --- Cargo.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index dc72a62a..e7a8c0b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,11 @@ native-tls = [ "reqwest/native-tls-vendored", "reqwest/native-tls-alpn", ] -rustls = ["tbot/rustls", "hyper-proxy/rustls", "reqwest/rustls-tls"] +rustls = [ + "tbot/rustls", + "hyper-proxy/rustls", + "reqwest/rustls-tls", +] [build-dependencies] ctl10n = "0.2.0"