[package]
name = "cebolla"
version = "0.3.0"
edition = "2024"
readme = "README.md"
authors = ["Zach Shipko <zachshipko@gmail.com>"]
description = "A convenience layer over Arti for building and connecting to Tor hidden services"
repository = "https://codeberg.org/twombly/cebolla"
license = "ISC"

[[bin]]
name = "tor-file-server"
required-features = ["http-server"]

[dependencies]
tokio = { version = "1.48.0", features = ["full"] }
futures-util = "0.3.31"
snafu = "0.8.9"

# Arti-related
arti-client = { version = "0.37", features = ["onion-service-client", "onion-service-service", "rustls"] }
tor-rtcompat = { version = "0.37.0" }
tor-hsservice = { version = "0.37.0" }
tor-cell = { version = "0.37.0" }
tor-proto = { version = "0.37.0" }
tor-dirmgr = { version = "0.37.0", features = ["static"] }
tor-error = "0.37.0"
safelog = { version = "0.7.0" }
tracing = "0.1.41"
hyper = { version = "1.8", features = ["http1", "client"], optional = true }
hyper-util = { version = "0.1", features = ["tokio"], optional = true }
rustls = { version = "0.23.11", features = ["aws-lc-rs"], optional = true }
rustls-native-certs = { version = "0.7.0", optional = true }
tokio-rustls = {version = "0.26.0", default-features=false, features=["logging", "tls12", "aws-lc-rs"], optional = true}
poem = { version = "3.1.12", optional = true, features = ["static-files"] }
http-body-util = { version = "0.1.3", optional = true }

[features]
default = ["http-server", "http-client"]
http-server = ["dep:poem"]
http-client = [
  "dep:hyper",
  "dep:hyper-util",
  "dep:rustls",
  "dep:rustls-native-certs",
  "dep:tokio-rustls",
  "dep:http-body-util"
]
http-body-util = ["dep:http-body-util"]

[[example]]
name = "server"
required-features = ["http-server"]

[[example]]
name = "client"
required-features = ["http-client"]

