fix compilation with no zstd, use correct key, bump 2 deps

Signed-off-by: strawberry <strawberry@pupbrain.dev>
This commit is contained in:
strawberry 2023-11-25 15:46:03 -05:00
parent 0c4604b482
commit 8fffb6ea04
4 changed files with 12 additions and 14 deletions

13
Cargo.lock generated
View file

@ -81,9 +81,9 @@ checksum = "5f093eed78becd229346bf859eec0aa4dd7ddde0757287b2b4107a1f09c80002"
[[package]] [[package]]
name = "async-compression" name = "async-compression"
version = "0.4.3" version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb42b2197bf15ccb092b62c74515dbd8b86d0effd934795f6687c93b6e679a2c" checksum = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"memchr", "memchr",
@ -3555,20 +3555,19 @@ dependencies = [
[[package]] [[package]]
name = "zstd" name = "zstd"
version = "0.12.4" version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110"
dependencies = [ dependencies = [
"zstd-safe", "zstd-safe",
] ]
[[package]] [[package]]
name = "zstd-safe" name = "zstd-safe"
version = "6.0.6" version = "7.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e"
dependencies = [ dependencies = [
"libc",
"zstd-sys", "zstd-sys",
] ]

View file

@ -24,7 +24,7 @@ rust-version = "1.70.0"
axum = { version = "0.6.20", default-features = false, features = ["form", "headers", "http1", "http2", "json", "matched-path"], optional = true } axum = { version = "0.6.20", default-features = false, features = ["form", "headers", "http1", "http2", "json", "matched-path"], optional = true }
axum-server = { version = "0.5.1", features = ["tls-rustls"] } axum-server = { version = "0.5.1", features = ["tls-rustls"] }
tower = { version = "0.4.13", features = ["util"] } tower = { version = "0.4.13", features = ["util"] }
tower-http = { version = "0.4.4", features = ["add-extension", "cors", "sensitive-headers", "trace", "util"] } tower-http = { version = "0.4.4", features = ["add-extension", "cors", "sensitive-headers", "trace", "util", "compression-zstd"] }
# Used for matrix spec type definitions and helpers # Used for matrix spec type definitions and helpers
#ruma = { version = "0.4.0", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] } #ruma = { version = "0.4.0", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] }
@ -84,11 +84,11 @@ lru-cache = "0.1.2"
rusqlite = { version = "0.30.0", optional = true, features = ["bundled"] } rusqlite = { version = "0.30.0", optional = true, features = ["bundled"] }
parking_lot = { version = "0.12.1", optional = true } parking_lot = { version = "0.12.1", optional = true }
crossbeam = { version = "0.8.2", optional = true } crossbeam = { version = "0.8.2", optional = true }
num_cpus = "1.15.0" num_cpus = "1.16.0"
threadpool = "1.8.1" threadpool = "1.8.1"
heed = { git = "https://github.com/timokoesters/heed.git", rev = "f6f825da7fb2c758867e05ad973ef800a6fe1d5d", optional = true } heed = { git = "https://github.com/timokoesters/heed.git", rev = "f6f825da7fb2c758867e05ad973ef800a6fe1d5d", optional = true }
# Used for ruma wrapper # Used for ruma wrapper
serde_html_form = "0.2.0" serde_html_form = "0.2.2"
rocksdb = { git = "https://github.com/girlbossceo/rust-rocksdb", rev = "eaa2beedb1f36466a52ca01ffbf3a2118b2cb41b", default-features = false, features = ["multi-threaded-cf", "snappy", "lz4", "zstd", "io-uring"], optional = true } rocksdb = { git = "https://github.com/girlbossceo/rust-rocksdb", rev = "eaa2beedb1f36466a52ca01ffbf3a2118b2cb41b", default-features = false, features = ["multi-threaded-cf", "snappy", "lz4", "zstd", "io-uring"], optional = true }
@ -128,7 +128,7 @@ sqlite = ["rusqlite", "parking_lot", "tokio/signal"]
conduit_bin = ["axum"] conduit_bin = ["axum"]
systemd = ["sd-notify"] systemd = ["sd-notify"]
#gzip_compression = ["tower-http/compression-gzip"] #gzip_compression = ["tower-http/compression-gzip"]
zstd_compression = ["tower-http/compression-zstd"] zstd_compression = []
#brotli_compression = ["tower-http/compression-br"] #brotli_compression = ["tower-http/compression-br"]
#compression = ["tower-http/compression-full"] #compression = ["tower-http/compression-full"]
sha256_media = [] sha256_media = []

View file

@ -106,7 +106,6 @@ pub struct Config {
#[serde(default = "default_presence_offline_timeout_s")] #[serde(default = "default_presence_offline_timeout_s")]
pub presence_offline_timeout_s: u64, pub presence_offline_timeout_s: u64,
#[cfg(feature = "zstd_compression")]
#[serde(default = "false_fn")] #[serde(default = "false_fn")]
pub zstd_compression: bool, pub zstd_compression: bool,

View file

@ -233,9 +233,9 @@ impl Service {
let path: std::path::PathBuf; let path: std::path::PathBuf;
if cfg!(feature = "sha256_media") { if cfg!(feature = "sha256_media") {
path = services().globals.get_media_file_new(&key); path = services().globals.get_media_file_new(&thumbnail_key);
} else { } else {
path = services().globals.get_media_file(&key); path = services().globals.get_media_file(&thumbnail_key);
} }
let mut f = File::create(path).await?; let mut f = File::create(path).await?;
f.write_all(&thumbnail_bytes).await?; f.write_all(&thumbnail_bytes).await?;