[package]
name = "kitsune2_bootstrap_srv"
version.workspace = true
description = "p2p / dht communication WAN discovery bootstrapping server"
license.workspace = true
homepage.workspace = true
repository.workspace = true
documentation = "https://docs.rs/kitsune2_bootstrap_srv"
authors.workspace = true
keywords.workspace = true
categories.workspace = true
edition.workspace = true

[dependencies]
async-channel = { workspace = true }
axum = { workspace = true, default-features = false, features = [
  "http1",
  "json",
  "tokio",
  "ws",
] }
axum-server = { workspace = true, features = ["tls-rustls-no-provider"] }
tower-http = { workspace = true, features = ["cors"] }
http = { workspace = true }
rustls = { workspace = true, features = ["ring"] }
base64 = { workspace = true }
bytes = { workspace = true }
clap = { workspace = true, features = ["derive", "wrap_help"] }
ctrlc = { workspace = true }
ed25519-dalek = { workspace = true }
futures = { workspace = true }
num_cpus = { workspace = true }
rand = { workspace = true }
serde = { workspace = true }
ureq = { workspace = true }
serde_json = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true, features = [
  "time",
  "rt",
  "rt-multi-thread",
  "io-util",
] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter", "json"] }

sbd-server = { workspace = true, features = ["tungstenite"], optional = true }
opentelemetry = { workspace = true }
# iroh relay server-related dependencies
# NOTE: these are currently unused (iroh-relay feature disabled) because
# the relay code was written against iroh-relay 0.97 private APIs.
iroh = { workspace = true, optional = true }
iroh-base = { workspace = true, optional = true }
iroh-relay = { workspace = true, features = ["server"], optional = true }
rustls-pemfile = { workspace = true, optional = true }
rcgen = { workspace = true, optional = true }

[features]
# iroh-relay disabled: the relay module uses iroh-relay 0.97 private APIs
# that aren't available in 0.95.1. Will be re-enabled when iroh stabilises.
default = []

# enable axum http2 support
http2 = ["axum/http2"]

# use sbd as signaling and relay server
sbd = ["dep:sbd-server", "dep:rcgen"]

# use iroh relay server
iroh-relay = [
  "dep:iroh",
  "dep:iroh-base",
  "dep:iroh-relay",
  "dep:rustls-pemfile",
  "dep:rcgen",
]
