huddle-core 1.1.4

Protocol, networking, crypto, and storage layer for huddle — a decentralized terminal chat app.
Documentation
[package]
name = "huddle-core"
version = "1.1.4"
edition = "2021"
description = "Protocol, networking, crypto, and storage layer for huddle — a decentralized terminal chat app."
license = "MIT OR Apache-2.0"
repository = "https://github.com/richer-richard/huddle"
homepage = "https://github.com/richer-richard/huddle"
readme = "README.md"
keywords = ["chat", "p2p", "libp2p", "mdns", "encryption"]
categories = ["network-programming", "cryptography"]

[features]
default = []
# huddle 1.0: in-process Tor via Arti — the `onion-arti` transport door.
# Heavy (~150 transitive crates, minutes of cold build, ~10-15 MB binary),
# so it's strictly opt-in. The default build never pulls arti.
arti = ["dep:arti-client", "dep:tor-rtcompat"]

[dependencies]
libp2p = { version = "0.56", features = [
    "mdns", "identify", "ping", "request-response",
    "tcp", "noise", "yamux", "tokio", "ed25519", "macros", "gossipsub",
    # Phase D — internet reach. relay-client lets us register with a
    # public relay so peers behind NAT can dial us through it; autonat
    # tells us whether we're NAT'd; dcutr (Direct Connection Upgrade
    # through Relay) attempts to hole-punch to a direct connection
    # once a relayed connection forms, dropping the relay hop when it
    # succeeds.
    "relay", "autonat", "dcutr",
] }
# huddle 0.8: client connector to the centralized huddle-server. The
# server is reachable only as a Tor v3 onion, so we dial it through Tor's
# local SOCKS5 proxy (tokio-socks) and speak WebSocket over that stream
# (tokio-tungstenite, version-matched to the server crate).
# huddle 1.0: `rustls-tls-native-roots` enables `wss://` to a clearnet
# relay using the system trust store (real certs via Caddy / Let's Encrypt /
# Cloudflare) — the TLS "door" alongside the onion ones.
tokio-tungstenite = { version = "0.24", features = ["rustls-tls-native-roots"] }
# rustls 0.23 refuses to pick a TLS CryptoProvider implicitly unless exactly
# one of its `ring`/`aws-lc-rs` features is enabled in the FINAL binary's
# dependency closure. tokio-tungstenite (our `wss://` clearnet door) pulls
# rustls but no provider feature, and only the TUI happens to enable `ring`
# transitively (via ureq) — so huddle-gui's wss worker thread panicked at
# startup ("Could not automatically determine the process-level
# CryptoProvider"). Depend on `ring` directly so the provider is always
# linked, and install it explicitly (see `install_default_crypto_provider`).
# `ring` (not aws-lc-rs) keeps the build C-toolchain-free and matches the
# provider already in our tree. default-features=false avoids pulling
# aws-lc-rs (rustls' default), which would re-introduce the ambiguity.
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12", "logging"] }
tokio-socks = "0.5"
vodozemac = "0.10"
ed25519-dalek = { version = "2", features = ["rand_core"] }
rusqlite = { version = "0.39", features = ["bundled-sqlcipher-vendored-openssl"] }
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
tracing = "0.1"
sha2 = "0.11"
hkdf = "0.13"
hex = "0.4"
dirs = "6"
rand = "0.8"
futures = "0.3"
async-trait = "0.1"
argon2 = "0.5"
chacha20poly1305 = "0.10"
base64 = "0.22"
x25519-dalek = { version = "2", features = ["static_secrets"] }
# huddle 0.7.11: zeroize key material on drop. Used to wrap the
# passphrase-derived 32-byte key, the DM HKDF output, the SAS shared
# secret, and the master-passphrase-derived DB key — anywhere a secret
# byte slice would otherwise linger on the heap until the next alloc.
zeroize = { version = "1", features = ["derive"] }
# huddle 1.0: in-process Tor (Arti) for the `onion-arti` door. Optional;
# only compiled under `--features arti`. rustls matches our existing TLS
# stack; onion-service-client lets the client dial `.onion` services.
arti-client = { version = "0.42", optional = true, default-features = false, features = [
    "tokio",
    "rustls",
    "onion-service-client",
    "compression",
] }
tor-rtcompat = { version = "0.42", optional = true, default-features = false, features = [
    "tokio",
    "rustls",
] }

[dev-dependencies]
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tempfile = "3"