-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
78 lines (71 loc) · 3.72 KB
/
Copy pathCargo.toml
File metadata and controls
78 lines (71 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
[package]
name = "sermonindex-node"
version = "0.3.1"
edition = "2021"
description = "SermonIndex headless seed node — download, hold, and seed the sermon archive with an optional built-in dashboard."
authors = ["SermonIndex"]
rust-version = "1.85"
[[bin]]
name = "sermonindex-node"
path = "src/main.rs"
[features]
default = ["seed"]
# BitTorrent seeding via librqbit. Turn OFF (--no-default-features) for a
# download-and-hold node, or for a fast build on constrained machines.
seed = ["dep:librqbit"]
[dependencies]
tokio = { version = "1", features = ["rt-multi-thread", "macros", "fs", "time", "io-util", "signal", "sync"] }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "stream", "json"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
ed25519-dalek = "2"
base64 = "0.22"
hex = "0.4"
dirs = "5"
anyhow = "1"
sysinfo = "0.32"
# NAT-PMP / PCP port mapping. Same crate and version the desktop app uses, so
# the two implementations cannot drift in behaviour.
crab_nat = "0.2"
futures-util = "0.3"
chrono = { version = "0.4", default-features = false, features = ["clock"] }
# BitTorrent engine — same one the desktop app uses (optional, feature "seed").
librqbit = { version = "9.0.0-rc.0", optional = true }
# ── Static OpenSSL, musl targets only ────────────────────────────────────────
# We ask reqwest for rustls with no default features, but librqbit pulls reqwest
# WITH its defaults (native-tls) and also depends on crypto-hash — and Cargo
# unifies features across the whole graph, so openssl-sys lands in the build
# whether we want it or not. On a musl target there is no system OpenSSL to link
# against, so the build fails unless we bring our own.
#
# "vendored" compiles OpenSSL from source and links it statically. That is what
# makes the published Linux binaries genuinely self-contained: no libssl, no
# libc, nothing to install on a NAS. It costs a few minutes of build time, which
# is CI's problem and not a user's. Gated to musl so everyday macOS/glibc dev
# builds stay fast and keep using the system library.
[target.'cfg(target_env = "musl")'.dependencies]
openssl = { version = "0.10", features = ["vendored"] }
# Vendored librqbit with TWO changes. BOTH must be re-applied on any upgrade,
# and both were found the same way — a node operator reporting something the
# upstream crate does not consider a bug:
#
# 1. torrent_state/live/peers/mod.rs — the per-torrent discovered-peer map is
# bounded. Upstream never caps or prunes it, which makes a 25,000-torrent
# seed run out of memory.
#
# 2. session.rs, task_listener() — the `futs.next()` select arm matches
# `Some(res)` rather than `Some(Ok(..))`, plus an `else` arm. Upstream's
# pattern disables its own branch the moment a handshake check FAILS; if
# `futs` is full at that instant the accept branch is disabled too, and
# `select!` with every branch disabled and no else is a panic. The task
# dies, the process lives, and the node silently stops accepting peers.
# Reliable on a 2-core VM under cgroup memory pressure; invisible on a
# big box. See NODE-CHANGES-0.3.0.md.
[patch.crates-io]
librqbit = { path = "vendor/librqbit" }
# ── statvfs, Unix only ───────────────────────────────────────────────────────
# Free space on the mount the LIBRARY lives on. sysinfo reports per-disk totals,
# which is the wrong granularity: the library is usually on /mnt/library or an
# external drive, and how much room / has is irrelevant to a node writing there.
[target.'cfg(unix)'.dependencies]
libc = "0.2"