diff --git a/iroh-one/Cargo.toml b/iroh-one/Cargo.toml index 0afc9fab61..0c95c729d8 100644 --- a/iroh-one/Cargo.toml +++ b/iroh-one/Cargo.toml @@ -27,9 +27,9 @@ iroh-rpc-types = {path = "../iroh-rpc-types", default-features = false} iroh-store = {path = "../iroh-store", default-features = false, features = ["rpc-mem"]} iroh-util = {path = "../iroh-util"} serde = {version = "1.0", features = ["derive"]} +tempdir = "0.3.7" tokio = {version = "1", features = ["macros", "rt-multi-thread", "process"]} tracing = "0.1.33" -tempdir = "0.3.7" [dev-dependencies] axum-macros = "0.2.0" # use #[axum_macros::debug_handler] for better error messages on handlers @@ -39,4 +39,6 @@ http = "0.2" default = ["rpc-mem", "rpc-grpc"] rpc-grpc = ["iroh-rpc-types/grpc", "iroh-rpc-client/grpc", "iroh-metrics/rpc-grpc"] rpc-mem = ["iroh-rpc-types/mem", "iroh-rpc-client/mem"] -uds-gateway = [] \ No newline at end of file +# uds-gateway controls whether http over uds is enabled. This is independent of the +# rpc-grpc control endpoint. +uds-gateway = [] diff --git a/iroh-one/README.md b/iroh-one/README.md index f9525fe448..86d62958ef 100644 --- a/iroh-one/README.md +++ b/iroh-one/README.md @@ -15,7 +15,7 @@ Single binary of iroh services (gateway, p2p, store) communicating via mem chann ### Features -- `uds-gateway` - enables the usage and binding of the gateway over UDS. +- `uds-gateway` - enables the usage and binding of the http gateway over UDS. ### Reference diff --git a/iroh-one/src/main.rs b/iroh-one/src/main.rs index fded91f5ee..7793b8481b 100644 --- a/iroh-one/src/main.rs +++ b/iroh-one/src/main.rs @@ -55,13 +55,6 @@ async fn main() -> Result<()> { (store_rpc, p2p_rpc) }; - #[cfg(not(feature = "uds-gateway"))] - let (rpc_addr, gw_sender) = Addr::new_mem(); - #[cfg(not(feature = "uds-gateway"))] - { - config.rpc_client.gateway_addr = Some(gw_sender); - } - config.synchronize_subconfigs(); config.metrics = metrics::metrics_config_with_compile_time_info(config.metrics); @@ -69,8 +62,7 @@ async fn main() -> Result<()> { let metrics_config = config.metrics.clone(); - #[cfg(feature = "uds-gateway")] - let rpc_addr = config + let gateway_rpc_addr = config .gateway .server_rpc_addr()? .ok_or_else(|| anyhow!("missing gateway rpc addr"))?; @@ -91,7 +83,7 @@ async fn main() -> Result<()> { ) .await?; - let handler = Core::new_with_state(rpc_addr, Arc::clone(&shared_state)).await?; + let handler = Core::new_with_state(gateway_rpc_addr, Arc::clone(&shared_state)).await?; let metrics_handle = iroh_metrics::MetricsHandle::new(metrics_config) .await diff --git a/iroh-p2p/Cargo.toml b/iroh-p2p/Cargo.toml index 8c905a3372..f95c2b93b0 100644 --- a/iroh-p2p/Cargo.toml +++ b/iroh-p2p/Cargo.toml @@ -21,7 +21,7 @@ lazy_static = "1.4" iroh-bitswap = { path = "../iroh-bitswap" } iroh-rpc-types = { path = "../iroh-rpc-types", default-features = false } iroh-rpc-client = { path = "../iroh-rpc-client", default-features = false } -tokio = { version = "1", features = ["time", "sync", "macros"] } +tokio = { version = "1", features = ["fs", "time", "sync", "macros"] } ahash = "0.7.6" tracing = "0.1.34" clap = { version = "3.1.14", features = ["derive"] }