mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
refactor(rust): move uptime to bin-shared (#9027)
The `uptime` module from `firezone-headless-client` is also used in the GUI client. In order to decouple this dependency, we move the module to `bin-shared`, next to the other cross-plaform modules.
This commit is contained in:
@@ -23,6 +23,8 @@ pub mod macos;
|
||||
#[cfg(target_os = "macos")]
|
||||
pub use macos as platform;
|
||||
|
||||
pub mod uptime;
|
||||
|
||||
pub const TOKEN_ENV_KEY: &str = "FIREZONE_TOKEN";
|
||||
|
||||
// wintun automatically append " Tunnel" to this
|
||||
|
||||
@@ -177,7 +177,7 @@ fn show_error_dialog(msg: &str) -> Result<()> {
|
||||
/// Don't drop the log handle or logging will stop.
|
||||
fn start_logging(directives: &str) -> Result<common::logging::Handles> {
|
||||
let logging_handles = common::logging::setup(directives)?;
|
||||
let system_uptime_seconds = firezone_headless_client::uptime::get().map(|dur| dur.as_secs());
|
||||
let system_uptime_seconds = firezone_bin_shared::uptime::get().map(|dur| dur.as_secs());
|
||||
tracing::info!(
|
||||
arch = std::env::consts::ARCH,
|
||||
os = std::env::consts::OS,
|
||||
|
||||
@@ -167,7 +167,7 @@ fn run_debug_ipc_service(cli: Cli) -> Result<()> {
|
||||
tracing::info!(
|
||||
arch = std::env::consts::ARCH,
|
||||
// version = env!("CARGO_PKG_VERSION"), TODO: Fix once `ipc_service` is moved to `gui-client`.
|
||||
system_uptime_seconds = crate::uptime::get().map(|dur| dur.as_secs()),
|
||||
system_uptime_seconds = firezone_bin_shared::uptime::get().map(|dur| dur.as_secs()),
|
||||
);
|
||||
if !platform::elevation_check()? {
|
||||
bail!("IPC service failed its elevation check, try running as admin / root");
|
||||
@@ -668,7 +668,7 @@ fn setup_logging(
|
||||
tracing::info!(
|
||||
arch = std::env::consts::ARCH,
|
||||
// version = env!("CARGO_PKG_VERSION"), TODO: Fix once `ipc_service` is moved to `gui-client`.
|
||||
system_uptime_seconds = crate::uptime::get().map(|dur| dur.as_secs()),
|
||||
system_uptime_seconds = firezone_bin_shared::uptime::get().map(|dur| dur.as_secs()),
|
||||
%directives
|
||||
);
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ mod ipc_service;
|
||||
pub mod known_dirs;
|
||||
// TODO: Move to `bin-shared`?
|
||||
pub mod signals;
|
||||
pub mod uptime;
|
||||
|
||||
pub use clear_logs::clear_logs;
|
||||
pub use dns_control::DnsController;
|
||||
|
||||
Reference in New Issue
Block a user