mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-12-02 19:40:35 +08:00
Commits with large or many files, like a vendored driver with 3,790 files, OOM-killed httpd at its 2 GiB limit. radicle-surf diffs every file twice and its rename detection loads whole blobs, so its output can't be bounded, and httpd now builds the diff itself. Files over 1 MiB or 50,000 lines, or past the per-response budgets, aren't diffed and come back as binary with `"tooLarge": true`. Files after the first 3,000 are left out. The diff is then `"truncated"` and takes its stats from `git diff --numstat`. This also fixes files shrunk from over the limit showing up as empty. `git2` becomes a direct dependency, at the version `radicle` already uses, for the diff types `radicle::git::raw` doesn't re-export. Co-authored-by: Rūdolfs Ošiņš <rudolfs@osins.org>
61 lines
2.2 KiB
TOML
61 lines
2.2 KiB
TOML
[package]
|
|
name = "radicle-httpd"
|
|
description = "Radicle HTTP daemon"
|
|
homepage.workspace = true
|
|
license.workspace = true
|
|
version = "0.30.0"
|
|
authors = ["cloudhead <cloudhead@radicle.xyz>", "sebastinez <me@sebastinez.dev>"]
|
|
edition = "2021"
|
|
default-run = "radicle-httpd"
|
|
build = "build.rs"
|
|
|
|
[features]
|
|
default = ["artifacts"]
|
|
artifacts = [
|
|
"dep:radicle-artifact",
|
|
]
|
|
|
|
[[bin]]
|
|
name = "radicle-httpd"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
axum = { version = "0.8.4", default-features = false, features = ["json", "query", "tokio", "http1"] }
|
|
axum-listener = { version = "0.2.2" }
|
|
base64 = { version = "0.22.1" }
|
|
chrono.workspace = true
|
|
futures-util = { version = "0.3.32", default-features = false }
|
|
hyper = { version = "1.6.0", default-features = false }
|
|
# The same version as `radicle` uses, for the diff types `radicle::git::raw`
|
|
# does not re-export.
|
|
git2 = { version = "0.21.0", default-features = false }
|
|
infer = { version = "0.19.0" }
|
|
lexopt.workspace = true
|
|
lru = { version = "0.18.2" }
|
|
mime_guess = { version = "2.0.5" }
|
|
nonempty = { version = "0.12.0", features = ["serialize"] }
|
|
radicle.workspace = true
|
|
radicle-artifact = { version = "0.23", optional = true }
|
|
radicle-job = { version = "0.6.0" }
|
|
radicle-search = { path = "../radicle-search" }
|
|
radicle-surf = { workspace = true, features = ["serde"] }
|
|
serde.workspace = true
|
|
serde_json = { workspace = true, features = ["preserve_order"] }
|
|
thiserror.workspace = true
|
|
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "signal", "process", "io-util"] }
|
|
tokio-util = { version = "0.7.18", default-features = false, features = ["io"] }
|
|
tower-http = { version = "0.6.6", default-features = false, features = ["trace", "cors", "set-header", "decompression-full"] }
|
|
tracing.workspace = true
|
|
tracing-subscriber = { workspace = true, features = ["env-filter", "json"] }
|
|
url = { version = "2.5.4", features = ["serde"] }
|
|
uuid = { version = "1.13.1", features = ["serde"] }
|
|
|
|
[dev-dependencies]
|
|
hyper = { version = "1.6", default-features = false, features = ["client"] }
|
|
pretty_assertions = { version = "1.4.1" }
|
|
radicle = { workspace = true, features = ["test"] }
|
|
radicle-crypto = { version = "0.19.0", features = ["test"] }
|
|
tempfile = { version = "3.20.0" }
|
|
tower = { version = "0.5.2", features = ["util"] }
|