Browse Source

resolved breaking changes with dependency updates

main
Dash8 1 year ago
parent
commit
d3f92fca94
  1. 1155
      server/Cargo.lock
  2. 34
      server/Cargo.toml
  3. 6
      server/build.rs
  4. 6
      server/lemmy_api_structs/Cargo.toml
  5. 10
      server/lemmy_db/Cargo.toml
  6. 4
      server/lemmy_rate_limit/Cargo.toml
  7. 10
      server/lemmy_utils/Cargo.toml
  8. 2
      server/src/apub/activity_queue.rs
  9. 3
      server/src/apub/extensions/signatures.rs
  10. 19
      server/src/main.rs
  11. 14
      server/src/routes/images.rs
  12. 5
      server/src/version.rs

1155
server/Cargo.lock
File diff suppressed because it is too large
View File

34
server/Cargo.toml

@ -25,53 +25,55 @@ lemmy_rate_limit = { path = "./lemmy_rate_limit" }
activitystreams = "0.7.0-alpha.11"
activitystreams-ext = "0.1.0-alpha.2"
actix = "0.12.0"
actix-cors = "0.5.4"
# The currently published actix-cors version is incompatible with newer actix-web versions
# let's pull from their git for now and monitor the version published on crates.io
actix-cors = { git = "https://github.com/actix/actix-extras.git" }
actix-files = "0.6.0-beta.6"
actix-rt = "2.2.0"
actix-web = { version = "4.0.0-beta.8", features = ["rustls"] }
actix-web-actors = "4.0.0-beta.6"
anyhow = "1.0.41"
async-trait = "0.1.50"
anyhow = "1.0.43"
async-trait = "0.1.51"
awc = "3.0.0-beta.7"
background-jobs = "0.9.0"
base64 = "0.13.0"
bcrypt = "0.10.0"
bcrypt = "0.10.1"
captcha = "0.0.8"
chrono = { version = "0.4.19", features = ["serde"] }
comrak = "0.10.1"
comrak = "0.11.0"
config = { version = "0.11.0", default-features = false, features = ["hjson"] }
diesel = { version = "1.4.7", features = ["postgres","chrono","r2d2","64-column-tables","serde_json","uuidv07"] }
diesel_migrations = "1.4.0"
dotenv = "0.15.0"
enumflags2 = "0.7.1"
env_logger = "0.8.4"
env_logger = "0.9.0"
failure = "0.1.8"
futures = "0.3.15"
futures = "0.3.17"
htmlescape = "0.3.1"
http = "0.2.4"
http-signature-normalization-actix = { version = "0.5.0-beta.6", default-features = false, features = ["sha-2"] }
http-signature-normalization-actix = { version = "0.5.0-beta.7", default-features = false, features = ["sha-2"] }
itertools = "0.10.1"
jsonwebtoken = "7.2.0"
lazy_static = "1.4.0"
lettre = "0.9.6"
lettre_email = "0.9.4"
log = "0.4.14"
openssl = "0.10.35"
openssl = "0.10.36"
percent-encoding = "2.1.0"
rand = "0.8.4"
regex = "1.5.4"
reqwest = { version = "0.11.4", features = ["json"] }
rss = "1.10.0"
serde = { version = "1.0.126", features = ["derive"] }
serde_json = { version = "1.0.64", features = ["preserve_order"] }
sha2 = "0.9.5"
serde = { version = "1.0.130", features = ["derive"] }
serde_json = { version = "1.0.67", features = ["preserve_order"] }
sha2 = "0.9.6"
strum = "0.21.0"
strum_macros = "0.21.1"
thiserror = "1.0.25"
tokio = "1.7.1"
thiserror = "1.0.28"
tokio = "1.10.1"
ttl_cache = "0.5.1"
url = { version = "2.2.2", features = ["serde"] }
uuid = { version = "=0.7.4", features = ["serde", "v4"] }
uuid = { version = "0.8.2", features = ["serde", "v4"] }
[build-dependencies]
vergen = "5.1.11"
vergen = "5.1.15"

6
server/build.rs

@ -1,10 +1,14 @@
use vergen::{Config, vergen};
use vergen::{Config, SemverKind, ShaKind, TimestampKind, vergen};
fn main() {
// Setup the flags, toggling off the 'SEMVER_FROM_CARGO_PKG' flag
let mut config = Config::default();
*config.build_mut().kind_mut() = TimestampKind::All;
*config.build_mut().semver_mut() = false;
*config.git_mut().sha_kind_mut() = ShaKind::Short;
*config.git_mut().semver_kind_mut() = SemverKind::Lightweight;
// Generate the 'cargo:' key output
vergen(config).expect("Unable to generate the cargo keys!");
}

6
server/lemmy_api_structs/Cargo.toml

@ -12,6 +12,6 @@ path = "src/lib.rs"
lemmy_db = { path = "../lemmy_db" }
chrono = { version = "0.4.19", features = ["serde"] }
serde = { version = "1.0.126", features = ["derive"] }
thiserror = "1.0.25"
uuid = { version = "=0.7.4", features = ["serde", "v4"] }
serde = { version = "1.0.130", features = ["derive"] }
thiserror = "1.0.28"
uuid = { version = "0.8.2", features = ["serde", "v4"] }

10
server/lemmy_db/Cargo.toml

@ -10,14 +10,14 @@ path = "src/lib.rs"
[dependencies]
diesel = { version = "1.4.7", features = ["postgres","chrono","r2d2","64-column-tables","serde_json","uuidv07"] }
chrono = { version = "0.4.19", features = ["serde"] }
serde = { version = "1.0.126", features = ["derive"] }
serde_json = { version = "1.0.64", features = ["preserve_order"] }
serde = { version = "1.0.130", features = ["derive"] }
serde_json = { version = "1.0.67", features = ["preserve_order"] }
strum = "0.21.0"
strum_macros = "0.21.1"
log = "0.4.14"
sha2 = "0.9.5"
bcrypt = "0.10.0"
sha2 = "0.9.6"
bcrypt = "0.10.1"
url = { version = "2.2.2", features = ["serde"] }
uuid = { version = "=0.7.4", features = ["serde", "v4"] }
uuid = { version = "0.8.2", features = ["serde", "v4"] }
lazy_static = "1.4.0"
regex = "1.5.4"

4
server/lemmy_rate_limit/Cargo.toml

@ -11,9 +11,9 @@ path = "src/lib.rs"
[dependencies]
lemmy_utils = { path = "../lemmy_utils" }
lemmy_api_structs = { path = "../lemmy_api_structs" }
tokio = "1.7.1"
tokio = "1.10.1"
strum = "0.21.0"
strum_macros = "0.21.1"
futures = "0.3.15"
futures = "0.3.17"
actix-web = { version = "4.0.0-beta.8", features = ["rustls"] }
log = "0.4.14"

10
server/lemmy_utils/Cargo.toml

@ -18,11 +18,11 @@ lettre_email = "0.9.4"
log = "0.4.14"
itertools = "0.10.1"
rand = "0.8.4"
serde = { version = "1.0.126", features = ["derive"] }
serde_json = { version = "1.0.64", features = ["preserve_order"] }
comrak = "0.10.1"
serde = { version = "1.0.130", features = ["derive"] }
serde_json = { version = "1.0.67", features = ["preserve_order"] }
comrak = "0.11.0"
lazy_static = "1.4.0"
openssl = "0.10.35"
openssl = "0.10.36"
url = { version = "2.2.2", features = ["serde"] }
actix-web = "4.0.0-beta.8"
anyhow = "1.0.41"
anyhow = "1.0.43"

2
server/src/apub/activity_queue.rs

@ -71,7 +71,7 @@ impl ActixJob for SendActivityTask {
let request = state
.client
.post(to_url.as_str())
.header("Content-Type", "application/json");
.insert_header(("Content-Type", "application/json"));
// TODO: i believe we have to do the signing in here because it is only valid for a few seconds
let signed = sign(

3
server/src/apub/extensions/signatures.rs

@ -1,7 +1,8 @@
use crate::apub::ActorType;
use activitystreams::unparsed::UnparsedMutExt;
use activitystreams_ext::UnparsedExtension;
use actix_web::{client::ClientRequest, HttpRequest};
use actix_web::HttpRequest;
use awc::ClientRequest;
use anyhow::{anyhow, Context};
use http_signature_normalization_actix::{
digest::{DigestClient, SignExt},

19
server/src/main.rs

@ -5,19 +5,15 @@ pub extern crate lazy_static;
use actix::prelude::*;
use actix_cors::Cors;
use actix_web::{
body::Body,
dev::{Service, ServiceRequest, ServiceResponse},
http::{
use actix_web::{*, body::Body, dev::{Service, ServiceRequest, ServiceResponse}, http::{
header::{CACHE_CONTROL, CONTENT_TYPE},
HeaderValue,
},
*,
};
}, web::Data};
use diesel::{
r2d2::{ConnectionManager, Pool},
PgConnection,
};
use futures::Future;
use lemmy_db::get_database_url_from_env;
use lemmy_rate_limit::{rate_limiter::RateLimiter, RateLimit};
use lemmy_server::{
@ -28,8 +24,7 @@ use lemmy_utils::{
settings::Settings, LemmyError, CACHE_CONTROL_APPLICATION_REGEX, CACHE_CONTROL_IMAGE_REGEX,
};
use reqwest::Client;
use std::sync::Arc;
use tokio::sync::Mutex;
use std::sync::{Arc, Mutex};
lazy_static! {
// static ref CACHE_CONTROL_VALUE: String = format!("public, max-age={}", 365 * 24 * 60 * 60);
@ -109,7 +104,7 @@ async fn main() -> Result<(), LemmyError> {
.wrap_fn(add_cache_headers)
.wrap(cors)
.wrap(middleware::Logger::default())
.data(context)
.app_data(Data::new(context))
// The routes
.configure(|cfg| api::config(cfg, &rate_limiter))
.configure(federation::config)
@ -138,10 +133,10 @@ async fn main() -> Result<(), LemmyError> {
fn add_cache_headers<S>(
req: ServiceRequest,
srv: &mut S,
srv: &S,
) -> impl Future<Output = Result<ServiceResponse, Error>>
where
S: Service<Request = ServiceRequest, Response = ServiceResponse<Body>, Error = Error>,
S: Service<ServiceRequest, Response = ServiceResponse<Body>, Error = Error>
{
let fut = srv.call(req);
async move {

14
server/src/routes/images.rs

@ -1,6 +1,6 @@
use crate::api::claims::Claims;
use actix::clock::Duration;
use actix_web::{body::BodyStream, http::StatusCode, *};
use std::time::Duration;
use actix_web::{*, body::BodyStream, http::StatusCode, web::Data};
use awc::Client;
use lemmy_rate_limit::RateLimit;
use lemmy_utils::settings::Settings;
@ -13,7 +13,7 @@ pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimit) {
.finish();
cfg
.data(client)
.app_data(Data::new(client))
.service(
web::resource("/pictrs/image")
.wrap(rate_limit.image())
@ -61,9 +61,9 @@ async fn upload(
client_req = client_req.append_header(("X-Forwarded-For", addr.to_string()))
};
let mut res = client_req.send_stream(body).await?;
let mut res = client_req.send_stream(body).await.map_err(|e| error::ErrorBadRequest(e))?;
let images = res.json::<Images>().await?;
let images = res.json::<Images>().await.map_err(|e| error::ErrorBadRequest(e))?;
Ok(HttpResponse::build(res.status()).json(images))
}
@ -110,7 +110,7 @@ async fn image(
client_req = client_req.append_header(("X-Forwarded-For", addr.to_string()))
};
let res = client_req.no_decompress().send().await.map_err::<Error, _>(|e| e.into())?;
let res = client_req.no_decompress().send().await.map_err(|e| error::ErrorBadRequest(e))?;
if res.status() == StatusCode::NOT_FOUND {
return Ok(HttpResponse::NotFound().finish());
@ -145,7 +145,7 @@ async fn delete(
client_req = client_req.append_header(("X-Forwarded-For", addr.to_string()))
};
let res = client_req.no_decompress().send().await?;
let res = client_req.no_decompress().send().await.map_err(|e| error::ErrorBadRequest(e))?;
Ok(HttpResponse::build(res.status()).body(BodyStream::new(res)))
}

5
server/src/version.rs

@ -1,6 +1,5 @@
pub const VERSION: &str = "v0.7.57";
pub const GIT_SHA: &str = env!("VERGEN_SHA");
pub const GIT_SHA_SHORT: &str = env!("VERGEN_SHA_SHORT");
pub const SEMVER_LIGHTWEIGHT: &str = env!("VERGEN_SEMVER_LIGHTWEIGHT");
pub const GIT_SHA_SHORT: &str = env!("VERGEN_GIT_SHA_SHORT");
pub const SEMVER_LIGHTWEIGHT: &str = env!("VERGEN_GIT_SEMVER_LIGHTWEIGHT");
pub const BUILD_TIMESTAMP: &str = env!("VERGEN_BUILD_TIMESTAMP");
pub const BUILD_DATE: &str = env!("VERGEN_BUILD_DATE");
Loading…
Cancel
Save