-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
192 lines (164 loc) · 8.79 KB
/
Cargo.toml
File metadata and controls
192 lines (164 loc) · 8.79 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
[package]
name = "rustchan"
version = "1.1.4"
edition = "2021"
# axum 0.8 requires Rust 1.75; arti-client 0.41 bumps the effective floor to
# 1.90 — keep both fields in sync.
rust-version = "1.90"
license = "MIT"
description = "Self-contained imageboard — single binary, zero runtime dependencies"
repository = "https://github.com/csd113/RustChan"
keywords = ["imageboard", "forum", "rust"]
categories = ["web-programming", "multimedia::images"]
# cargo-msrv <0.16 reads package.metadata.msrv instead of the Cargo-standard
# rust-version field; keep both in sync so `cargo msrv verify` works regardless
# of which version of cargo-msrv is installed.
[package.metadata]
# FIX[MSRV]: was "1.75" — updated to match rust-version above.
msrv = "1.90"
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 1
strip = true
panic = "abort"
[[bin]]
name = "rustchan-cli"
path = "src/main.rs"
[lib]
name = "chan"
path = "src/lib.rs"
[dependencies]
axum = { version = "0.8", features = ["multipart"] }
axum-extra = { version = "0.12", features = ["cookie"] }
tower = "0.5"
tower-http = { version = "0.6", features = ["fs", "set-header", "compression-full", "trace"] }
tokio = { version = "1", features = ["full"] }
tokio-util = "0.7"
rusqlite = { version = "0.38", features = ["bundled", "backup"] }
r2d2 = "0.8"
r2d2_sqlite = "0.32"
time = "0.3"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# toml 1.0: serde parsing is built-in, no feature flag needed.
toml = "1.0"
argon2 = "0.5"
sha2 = "0.10"
subtle = "2"
hex = "0.4"
# rand_core 0.6 replaces rand = "0.8" entirely.
# We only need OsRng + RngCore, both of which live in rand_core.
# rand_core 0.6 that argon2 0.5 / password-hash 0.5 depends on, causing
# OsRng type mismatches at compile time. Using rand_core 0.6 directly
# shares the exact same crate instance as argon2's transitive dep.
rand_core = { version = "0.6", features = ["getrandom"] }
image = { version = "0.25", default-features = false, features = ["jpeg", "png", "gif", "webp", "bmp", "tiff", "ico"] }
# EXIF orientation correction: read Orientation tag from JPEG uploads and
# apply the corresponding rotation before thumbnailing so that photos taken
# on phones display upright (4.1).
kamadak-exif = "0.5"
clap = { version = "4", features = ["derive"] }
uuid = { version = "1", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
dashmap = "6"
parking_lot = "0.12"
anyhow = "1"
once_cell = "1"
regex = "1"
ipnet = "2"
# zip 8: SimpleFileOptions and core ZipWriter/ZipArchive API unchanged.
# by_index(), start_file(), add_directory(), finish() all stable.
# Use file_names() iterator for name-only pre-flight scans (cleaner than
# by_index_raw which is now by_index_without_decompression in zip 8).
zip = { version = "8", default-features = false, features = ["deflate"] }
# ── HTTP client ────────────────────────────────────────────────────────────────
# reqwest for federation push (chan_refresh) and pull (chan_poll).
# default-features = false → prevents the default "native-tls" backend from
# being compiled in.
# rustls-no-provider keeps the build on the pure-Rust TLS stack and avoids
# pulling in native-tls/OpenSSL.
# Verify: cargo tree --edges features | grep -iE "openssl|native.tls"
reqwest = { version = "0.13", default-features = false, features = ["multipart", "json", "rustls-no-provider"] }
# Pin to patched version — fixes RUSTSEC-2026-0049 (CRL distribution point
# matching bug). Transitive dep via reqwest / arti-client.
rustls-webpki = "0.103.10"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt", "json"] }
tracing-appender = "0.2"
thiserror = "2"
tempfile = "3"
libc = "0.2"
# ── Tor / onion-service stack ──────────────────────────────────────────────────
# F-09: Use rustls throughout — native-tls would pull in OpenSSL as a
# transitive dep, causing a dynamic link against libssl/libcrypto and breaking
# cross-compilation to aarch64-unknown-linux-gnu.
#
# CRITICAL: `default-features = false` is REQUIRED on every arti crate.
# Cargo features are purely additive — without it, `arti-client`'s default
# feature set enables `native-tls` IN ADDITION TO `rustls`, pulling in
# openssl-sys even though rustls is also listed. The `rustls` feature alone
# does not prevent the native-tls default from activating.
#
# Post-change verification:
# cargo tree --edges features | grep -iE "openssl|native.tls" # expect nothing
# cargo tree -i openssl-sys # expect error: not found
arti-client = { version = "0.41", default-features = false, features = ["tokio", "rustls", "onion-service-service"] }
# tor-hsservice / tor-cell: also part of the arti workspace. Their `full`
# default feature bundle can activate the native-tls TLS backend through
# tor-rtcompat. Disable defaults; add back only what the build requires.
# If compilation fails with "feature X not found", re-add that feature here.
tor-hsservice = { version = "0.41", default-features = false }
tor-cell = { version = "0.41", default-features = false }
futures = "0.3"
sha3 = "0.10"
data-encoding = "2"
# ── TLS ───────────────────────────────────────────────────────────────────────
# rustls-pki-types: standalone PKI types crate split out of rustls 0.23+.
# Required directly by src/tls/mod.rs (CertificateDer, PrivateKeyDer, PemObject).
rustls-pki-types = "1.9"
tokio-rustls = "0.26"
rustls = { version = "0.23", features = ["ring"] }
# Optional — gated by Cargo features
rustls-acme = { version = "0.15", features = ["tokio"], optional = true }
rcgen = { version = "0.13", optional = true }
pem-rfc7468 = { version = "0.7", optional = true }
x509-cert = { version = "0.2", optional = true }
# HTTPS listen integration for Axum (handles Static cert path)
axum-server = { version = "0.8", features = ["tls-rustls-no-provider"] }
hyper = { version = "1", features = ["http1", "http2", "server"] }
hyper-util = { version = "0.1", features = ["tokio", "server"] }
# ── Terminal UI ───────────────────────────────────────────────────────────────
# crossterm: required by src/server/console/ (wizard.rs, input.rs, mod.rs).
# Provides cross-platform terminal control (cursor, events, raw mode).
crossterm = "0.28"
[features]
default = ["tls-self-signed"]
tls-self-signed = ["dep:rcgen", "dep:pem-rfc7468", "dep:x509-cert"]
tls-acme = ["dep:rustls-acme"]
[target.'cfg(windows)'.dependencies]
# AllocConsole — used by the double-click / no-TTY re-launch guard in main.rs
# to attach a visible console window when the binary is started from Explorer.
windows-sys = { version = "0.61", features = ["Win32_System_Console"] }
# ── Safety net ────────────────────────────────────────────────────────────────
# If a future dependency version change re-introduces openssl-sys as a
# transitive dep, the build will fail here with a clear error rather than
# silently linking a dynamic libssl. Uncomment and point at a stub crate if
# `cargo tree -i openssl-sys` ever returns a result:
#
# [patch.crates-io]
# openssl-sys = { path = "patches/openssl-sys-stub" }
[lints.clippy]
too_many_arguments = "allow"
manual_pattern_char_comparison = "allow"
# Deny the most dangerous footguns
unwrap_used = "warn" # force .expect("reason") or proper handling
expect_used = "allow" # allow in tests; use with a message in production
indexing_slicing = "warn" # prefer .get() with bounds check
arithmetic_side_effects = "allow" # too noisy for general arithmetic
missing_errors_doc = "allow" # pedantic docs lint, too noisy for all Results
doc_markdown = "allow" # allow non-backticked identifiers in docs
doc_lazy_continuation = "allow" # don't require strict indentation for doc lists
items_after_statements = "allow" # permit helper items inside functions
wildcard_imports = "allow" # crate-level style choice for imports
uninlined_format_args = "allow" # allow older-style format! calls