From 34f443ce1820857166f6a333bb1453b0b7778866 Mon Sep 17 00:00:00 2001 From: Elias Dalbeck Date: Mon, 16 Dec 2024 14:12:16 +0100 Subject: [PATCH 1/3] check env var for transit relay server --- cli/Cargo.toml | 2 +- cli/src/main.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 19947599..3f7b080f 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -28,7 +28,7 @@ rand = { workspace = true } # CLI specific dependencies magic-wormhole = { path = "..", version = "0.7", features = ["all", "entropy"] } -clap = { workspace = true, features = ["cargo", "derive", "help"] } +clap = { workspace = true, features = ["cargo", "derive", "help", "env"] } clap_complete = { workspace = true } env_logger = { workspace = true } console = { workspace = true } diff --git a/cli/src/main.rs b/cli/src/main.rs index c15aeba7..3388721d 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -120,6 +120,7 @@ struct CommonArgs { action = clap::ArgAction::Append, value_name = "tcp://HOSTNAME:PORT", value_hint = clap::ValueHint::Url, + env = "WORMHOLE_RELAY_SERVER", )] relay_server: Vec, /// Use a custom rendezvous server. Both sides need to use the same value in order to find each other. From 4c6dfb9de355712d91efaca215a3e5158e8b970f Mon Sep 17 00:00:00 2001 From: Elias Dalbeck Date: Mon, 16 Dec 2024 21:43:52 +0100 Subject: [PATCH 2/3] env name compatibility with python impl --- cli/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index 3388721d..d62df670 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -120,11 +120,11 @@ struct CommonArgs { action = clap::ArgAction::Append, value_name = "tcp://HOSTNAME:PORT", value_hint = clap::ValueHint::Url, - env = "WORMHOLE_RELAY_SERVER", + env = "WORMHOLE_RELAY_URL", )] relay_server: Vec, /// Use a custom rendezvous server. Both sides need to use the same value in order to find each other. - #[arg(long, value_name = "ws://example.org", value_hint = clap::ValueHint::Url)] + #[arg(long, value_name = "ws://example.org", value_hint = clap::ValueHint::Url, env = "WORMHOLE_TRANSIT_HELPER")] rendezvous_server: Option, /// Disable the relay server support and force a direct connection. #[arg(long)] From 6f5adf056224a69d3d90ad8b3530f23e625f4c0e Mon Sep 17 00:00:00 2001 From: Elias Dalbeck Date: Tue, 17 Dec 2024 13:38:10 +0100 Subject: [PATCH 3/3] mailbox url env --- cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index d62df670..7653e33f 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -124,7 +124,7 @@ struct CommonArgs { )] relay_server: Vec, /// Use a custom rendezvous server. Both sides need to use the same value in order to find each other. - #[arg(long, value_name = "ws://example.org", value_hint = clap::ValueHint::Url, env = "WORMHOLE_TRANSIT_HELPER")] + #[arg(long, value_name = "ws://example.org", value_hint = clap::ValueHint::Url, env = "WORMHOLE_MAILBOX_URL")] rendezvous_server: Option, /// Disable the relay server support and force a direct connection. #[arg(long)]