mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
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:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user