mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-28 02:18:50 +00:00
## Changelog - Updates connlib parameter API_URL (formerly known under different names as `CONTROL_PLANE_URL`, `PORTAL_URL`, `PORTAL_WS_URL`, and friends) to be configured as an "advanced" or "hidden" feature at runtime so that we can test production builds on both staging and production. - Makes `AUTH_BASE_URL` configurable at runtime too - Moves `CONNLIB_LOG_FILTER_STRING` to be configured like this as well and simplifies its naming - Fixes a timing attack bug on Android when comparing the `csrf` token - Adds proper account ID validation to Android to prevent invalid URL parameter strings from being saved and used - Cleans up a number of UI / view issues on Android regarding typos, consistency, etc - Hides vars from from the `relay` CLI we may not want to expose just yet - `get_device_id()` is flawed for connlib components -- SMBios is rarely available. Data plane components now require a `FIREZONE_ID` now instead to use for upserting. Fixes #2482 Fixes #2471 --------- Signed-off-by: Jamil <jamilbk@users.noreply.github.com> Co-authored-by: Gabi <gabrielalejandro7@gmail.com>
42 lines
1.3 KiB
Rust
42 lines
1.3 KiB
Rust
use clap::Args;
|
|
use tracing_subscriber::{
|
|
fmt, prelude::__tracing_subscriber_SubscriberExt, EnvFilter, Layer, Registry,
|
|
};
|
|
use url::Url;
|
|
|
|
pub fn block_on_ctrl_c() {
|
|
let (tx, rx) = std::sync::mpsc::channel();
|
|
ctrlc::set_handler(move || tx.send(()).expect("Could not send stop signal on channel."))
|
|
.expect("Error setting Ctrl-C handler");
|
|
rx.recv().expect("Could not receive ctrl-c signal");
|
|
}
|
|
|
|
pub fn setup_global_subscriber<L>(additional_layer: L)
|
|
where
|
|
L: Layer<Registry> + Send + Sync,
|
|
{
|
|
let subscriber = Registry::default()
|
|
.with(additional_layer.with_filter(EnvFilter::from_default_env()))
|
|
.with(fmt::layer().with_filter(EnvFilter::from_default_env()));
|
|
tracing::subscriber::set_global_default(subscriber).expect("Could not set global default");
|
|
}
|
|
|
|
/// Arguments common to all Firezone CLI components.
|
|
#[derive(Args, Clone)]
|
|
pub struct CommonArgs {
|
|
#[arg(
|
|
short = 'u',
|
|
long,
|
|
hide = true,
|
|
env = "FIREZONE_API_URL",
|
|
default_value = "wss://api.firezone.dev"
|
|
)]
|
|
pub api_url: Url,
|
|
/// Identifier generated by the portal to identify and display the device.
|
|
#[arg(short = 'i', long, env = "FIREZONE_ID")]
|
|
pub firezone_id: String,
|
|
/// Token generated by the portal to authorize websocket connection.
|
|
#[arg(env = "FIREZONE_TOKEN")]
|
|
pub token: String,
|
|
}
|