From 2c2bbe19ff6dcfd33a1f9654f96bfb4c834b421a Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 6 Mar 2024 09:37:21 +1100 Subject: [PATCH] chore(relay): add `FIREZONE_NAME` env variable (#3932) Follow-up from #2544. --------- Signed-off-by: Thomas Eizinger Co-authored-by: Jamil --- rust/relay/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rust/relay/src/main.rs b/rust/relay/src/main.rs index 4d7ab1118..3193f33b5 100644 --- a/rust/relay/src/main.rs +++ b/rust/relay/src/main.rs @@ -60,6 +60,10 @@ struct Args { /// If omitted, we won't connect to the portal on startup. #[arg(env = "FIREZONE_TOKEN")] token: Option, + /// Used as the human name for this Relay to display in the portal. If not provided, + /// the system hostname is used by default. + #[arg(env = "FIREZONE_NAME")] + name: Option, /// A seed to use for all randomness operations. /// /// Only available in debug builds. @@ -267,6 +271,9 @@ async fn connect_to_portal( url.query_pairs_mut() .append_pair("ipv6", &public_ip6_addr.to_string()); } + if let Some(name) = args.name.as_ref() { + url.query_pairs_mut().append_pair("name", name); + } let (channel, Init {}) = phoenix_channel::init::<_, Init, _, _>( Secret::from(SecureUrl::from_url(url)),