chore(relay): add FIREZONE_NAME env variable (#3932)

Follow-up from #2544.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
This commit is contained in:
Thomas Eizinger
2024-03-06 09:37:21 +11:00
committed by GitHub
parent b94eb4d4c7
commit 2c2bbe19ff

View File

@@ -60,6 +60,10 @@ struct Args {
/// If omitted, we won't connect to the portal on startup.
#[arg(env = "FIREZONE_TOKEN")]
token: Option<SecretString>,
/// 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<String>,
/// 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)),