Skip to content

Commit

Permalink
Further fix the Telegram bot link preview issue. Update dependencies.…
Browse files Browse the repository at this point in the history
… Bump version.
  • Loading branch information
kukabi committed Jan 24, 2024
1 parent 895e38e commit 54035fe
Show file tree
Hide file tree
Showing 31 changed files with 151 additions and 146 deletions.
129 changes: 61 additions & 68 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _docker/compose/.env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=0.17.15
VERSION=0.17.16
ENV=production
LOG_LEVEL=debug

Expand Down
16 changes: 8 additions & 8 deletions subvt-app-service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[package]
name = "subvt-app-service"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

[dependencies]
actix-http = "3.4.0"
actix-service = "2.0.2"
actix-web = "4.4.0"
actix-http = "3.5"
actix-service = "2.0"
actix-web = "4.4"
anyhow = { workspace = true }
async-trait = "0.1"
futures = "0.3"
hex = "0.4"
libsecp256k1 = "0.7.0"
libsecp256k1 = "0.7"
lazy_static = { workspace = true }
log = { workspace = true }
once_cell = "1"
rustc-hash = "1.1.0"
rustc-hash = "1.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sha2 = "0.10.2"
sha2 = "0.10"
subvt-config = { path = "../subvt-config" }
subvt-logging = { path = "../subvt-logging" }
subvt-metrics = { path = "../subvt-metrics" }
Expand All @@ -29,4 +29,4 @@ subvt-types = { path = "../subvt-types" }
tokio = { version = "1.35", features = ["full"] }

[dev-dependencies]
actix-rt = "2.9.0"
actix-rt = "2.9"
4 changes: 2 additions & 2 deletions subvt-block-processor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-block-processor"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand All @@ -15,7 +15,7 @@ lazy_static = { workspace = true }
log = { workspace = true }
once_cell = "1"
parity-scale-codec = "3.4"
rustc-hash = "1.1.0"
rustc-hash = "1.1"
serde_json = "1.0"
subvt-config = { path = "../subvt-config" }
subvt-logging = { path = "../subvt-logging" }
Expand Down
4 changes: 2 additions & 2 deletions subvt-config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "subvt-config"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

[dependencies]
config = "0.13.1"
config = "0.13"
serde = { version = "1.0", features = ["derive"] }
4 changes: 2 additions & 2 deletions subvt-governance/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "subvt-governance"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

[dependencies]
anyhow = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
reqwest = { version = "0.11.11", features = ["blocking", "json", "gzip", "brotli"] }
reqwest = { version = "0.11", features = ["blocking", "json", "gzip", "brotli"] }
serde_json = "1.0"
subvt-config = { path = "../subvt-config" }
subvt-types = { path = "../subvt-types" }
Expand Down
2 changes: 1 addition & 1 deletion subvt-logging/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-logging"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-metrics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-metrics"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-network-status-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-network-status-server"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-network-status-updater/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-network-status-updater"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-nft/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-nft"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand Down
4 changes: 2 additions & 2 deletions subvt-notification-generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-notification-generator"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand All @@ -15,7 +15,7 @@ lazy_static = { workspace = true }
log = { workspace = true }
once_cell = "1"
redis = "0.24"
rustc-hash = "1.1.0"
rustc-hash = "1.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
subvt-config = { path = "../subvt-config" }
Expand Down
12 changes: 6 additions & 6 deletions subvt-notification-processor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-notification-processor"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand All @@ -15,14 +15,14 @@ fcm = "0.9.1"
futures = "0.3"
futures-util = "0.3"
itertools = { workspace = true }
job_scheduler = "1.2.1"
job_scheduler = "1.2"
lazy_static = { workspace = true }
lettre = { version = "0.11.2", default-features = true, features = ["tokio1-native-tls"]}
lettre_email = "0.9.4"
lettre = { version = "0.11", default-features = true, features = ["tokio1-native-tls"]}
lettre_email = "0.9"
log = { workspace = true }
once_cell = "1"
redis = { version = "0.24", features = ["tokio-comp"] }
rustc-hash = "1.1.0"
rustc-hash = "1.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
subvt-config = { path = "../subvt-config" }
Expand All @@ -33,6 +33,6 @@ subvt-service-common = { path = "../subvt-service-common" }
subvt-telegram-bot = { path = "../subvt-telegram-bot" }
subvt-types = { path = "../subvt-types" }
subvt-utility = { path = "../subvt-utility" }
tera = "1.16.0"
tera = "1.19"
thiserror = { workspace = true }
tokio = { version = "1.35", features = ["full"] }
6 changes: 4 additions & 2 deletions subvt-notification-processor/src/sender/telegram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
use crate::sender::NotificationSenderError;
use crate::{ContentProvider, NotificationSender};
use async_trait::async_trait;
use subvt_telegram_bot::{AsyncApi, AsyncTelegramApi, ChatId, ParseMode, SendMessageParams};
use subvt_telegram_bot::{
AsyncApi, AsyncTelegramApi, ChatId, LinkPreviewOptions, ParseMode, SendMessageParams,
};
use subvt_types::app::notification::{Notification, NotificationChannel};

pub(crate) struct TelegramSender {
Expand Down Expand Up @@ -30,7 +32,7 @@ impl TelegramSender {
text: message,
parse_mode: Some(ParseMode::Html),
entities: None,
link_preview_options: None,
link_preview_options: Some(LinkPreviewOptions::builder().is_disabled(true).build()),
disable_notification: None,
protect_content: None,
reply_parameters: None,
Expand Down
6 changes: 3 additions & 3 deletions subvt-onekv-updater/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-onekv-updater"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand All @@ -12,8 +12,8 @@ lazy_static = { workspace = true }
log = { workspace = true }
once_cell = "1"
prometheus = { version = "0.13", features = ["process"] }
rand = "0.8.5"
reqwest = { version = "0.11.11", features = ["blocking", "json", "gzip", "brotli"] }
rand = "0.8"
reqwest = { version = "0.11", features = ["blocking", "json", "gzip", "brotli"] }
subvt-config = { path = "../subvt-config" }
subvt-metrics = { path = "../subvt-metrics" }
subvt-persistence = { path = "../subvt-persistence" }
Expand Down
6 changes: 3 additions & 3 deletions subvt-persistence/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-persistence"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand All @@ -10,9 +10,9 @@ chrono = "0.4"
hex = "0.4"
lazy_static = { workspace = true }
log = { workspace = true }
parity-scale-codec = "3.4"
parity-scale-codec = "3.6"
redis = { version = "0.24", features = ["tokio-comp"] }
rustc-hash = "1.1.0"
rustc-hash = "1.1"
serde = { version = "1.0" }
serde_json = "1.0"
subvt-config = { path = "../subvt-config" }
Expand Down
6 changes: 3 additions & 3 deletions subvt-plotter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-plotter"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand All @@ -14,11 +14,11 @@ log = { workspace = true }
lazy_static = { workspace = true }
thiserror = { workspace = true }
rand = "0.8.5"
resvg = "0.37"
resvg = "0.38"
rustc-hash = "1.1.0"
subvt-config = { path = "../subvt-config" }
subvt-types = { path = "../subvt-types" }
subvt-utility = { path = "../subvt-utility" }
svg = "0.14"
tiny-skia = "0.11"
usvg = "0.37"
usvg = "0.38"
16 changes: 12 additions & 4 deletions subvt-plotter/src/rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_hash::FxHashMap as HashMap;
use std::path::PathBuf;
use subvt_types::substrate::{Balance, Era};
use subvt_utility::numeric::format_decimal;
use usvg::{TreeParsing, TreeTextToPath};
use usvg::{PostProcessingSteps, TreeParsing, TreePostProc};

fn get_monthly_rewards(rewards: &[(Era, Balance)]) -> anyhow::Result<HashMap<u32, Balance>> {
if rewards.is_empty() {
Expand Down Expand Up @@ -126,12 +126,20 @@ pub fn plot_era_rewards(title: &str, rewards: &[(Era, Balance)]) -> anyhow::Resu
fontdb.set_sans_serif_family(&CONFIG.plotter.font_sans_serif_family);
let svg_data = std::fs::read(&svg_path).unwrap();
let mut rtree = usvg::Tree::from_data(&svg_data, &opt).unwrap();
rtree.convert_text(&fontdb);
rtree.postprocess(
PostProcessingSteps {
convert_text_into_paths: true,
},
&fontdb,
);
//let pixmap_size = rtree.size.to_screen_size();
let pixmap_size = rtree.size.to_int_size();
let mut pixmap = tiny_skia::Pixmap::new(pixmap_size.width(), pixmap_size.height()).unwrap();
let rtree = resvg::Tree::from_usvg(&rtree);
rtree.render(tiny_skia::Transform::default(), &mut pixmap.as_mut());
resvg::render(
&rtree,
tiny_skia::Transform::default(),
&mut pixmap.as_mut(),
);
pixmap.save_png(&png_path)?;
// delete the svg file
std::fs::remove_file(svg_path)?;
Expand Down
2 changes: 1 addition & 1 deletion subvt-proc-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ proc-macro = true

[package]
name = "subvt-proc-macro"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand Down
8 changes: 4 additions & 4 deletions subvt-referendum-updater/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-referendum-updater"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

Expand All @@ -10,13 +10,13 @@ rust-version = "1.67.0"
anyhow = { workspace = true }
async-trait = "0.1"
chrono = { version = "0.4", default-features = true, features = ["serde"] }
enum-iterator = "1.4"
enum-iterator = "1.5"
lazy_static = { workspace = true }
log = { workspace = true }
once_cell = "1"
prometheus = { version = "0.13", features = ["process"] }
rand = "0.8.5"
reqwest = { version = "0.11.11", features = ["blocking", "json", "gzip", "brotli"] }
rand = "0.8"
reqwest = { version = "0.11", features = ["blocking", "json", "gzip", "brotli"] }
subvt-config = { path = "../subvt-config" }
subvt-governance = { path = "../subvt-governance" }
subvt-metrics = { path = "../subvt-metrics" }
Expand Down
4 changes: 2 additions & 2 deletions subvt-report-service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "subvt-report-service"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

[dependencies]
actix-web = "4.3"
actix-web = "4.4"
anyhow = { workspace = true }
async-trait = "0.1"
futures-util = "0.3"
Expand Down
4 changes: 2 additions & 2 deletions subvt-service-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "subvt-service-common"
version = "0.17.15"
version = "0.17.16"
edition = "2021"
rust-version = "1.67.0"

[dependencies]
actix-web = "4.3"
actix-web = "4.4"
anyhow = { workspace = true }
async-trait = "0.1"
log = { workspace = true }
Expand Down
Loading

0 comments on commit 54035fe

Please sign in to comment.