chore: bump deps

This commit is contained in:
trisua 2025-05-07 21:59:10 -04:00
parent aca1a8236c
commit a1c6beb664
5 changed files with 20 additions and 210 deletions

View file

@ -15,9 +15,9 @@ serde = { version = "1.0.219", features = ["derive"] }
tera = "1.20.0"
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
tower-http = { version = "0.6.2", features = ["trace", "fs", "catch-panic"] }
axum = { version = "0.8.3", features = ["macros", "ws"] }
tokio = { version = "1.44.2", features = ["macros", "rt-multi-thread"] }
tower-http = { version = "0.6.3", features = ["trace", "fs", "catch-panic"] }
axum = { version = "0.8.4", features = ["macros", "ws"] }
tokio = { version = "1.45.0", features = ["macros", "rt-multi-thread"] }
axum-extra = { version = "0.10.1", features = ["cookie", "multipart"] }
ammonia = "4.1.0"
tetratto-shared = { path = "../shared" }
@ -39,7 +39,6 @@ redis = { version = "0.30.0", features = [
"aio",
"tokio-comp",
], optional = true }
tower_governor = "0.7.0"
async-stripe = { version = "0.41.0", features = [
"events",
"checkout",

View file

@ -15,10 +15,9 @@ use tower_http::{
trace::{self, TraceLayer},
catch_panic::CatchPanicLayer,
};
use tower_governor::{GovernorLayer, governor::GovernorConfigBuilder};
use tracing::{Level, info};
use std::{collections::HashMap, env::var, net::SocketAddr, process::exit, sync::Arc, time::Duration};
use std::{collections::HashMap, env::var, net::SocketAddr, process::exit, sync::Arc};
use tokio::sync::RwLock;
pub(crate) type State = Arc<RwLock<(DataManager, Tera, Client)>>;
@ -56,26 +55,6 @@ async fn main() {
init_dirs(&config).await;
let html_path = write_assets(&config).await;
// governor
let governor_config = Arc::new(
GovernorConfigBuilder::default()
.per_millisecond(64)
.burst_size(128)
.finish()
.unwrap(),
);
let governor_limiter = governor_config.limiter().clone();
let governor_interval = Duration::from_secs(60);
std::thread::spawn(move || {
loop {
std::thread::sleep(governor_interval);
tracing::info!("rate limiting storage size: {}", governor_limiter.len());
governor_limiter.retain_recent();
}
});
// ...
let database = DataManager::new(config.clone()).await.unwrap();
database.init().await.unwrap();
@ -108,10 +87,7 @@ async fn main() {
.make_span_with(trace::DefaultMakeSpan::new().level(Level::INFO))
.on_response(trace::DefaultOnResponse::new().level(Level::INFO)),
)
.layer(CatchPanicLayer::new())
.layer(GovernorLayer {
config: governor_config,
});
.layer(CatchPanicLayer::new());
let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", config.port))
.await

View file

@ -9,10 +9,10 @@ license.workspace = true
[dependencies]
ammonia = "4.1.0"
chrono = "0.4.41"
comrak = "0.38.0"
comrak = "0.39.0"
hex_fmt = "0.3.0"
rand = "0.9.1"
serde = "1.0.219"
sha2 = "0.10.8"
sha2 = "0.10.9"
snowflaked = "1.0.3"
uuid = { version = "1.16.0", features = ["v4"] }