From 61bff3b1edd45bac3015c17330e71bd4c75f2cdc Mon Sep 17 00:00:00 2001 From: Reactor Scram Date: Tue, 19 Dec 2023 19:43:58 -0600 Subject: [PATCH] fix(windows): copy default debug and release settings from Android (#2963) and fix a couple other settings. --- .../tunnel/src/device_channel/tun_windows.rs | 3 ++- rust/windows-client/docs/manual_testing.md | 1 + .../src-tauri/src/client/settings.rs | 14 +++++++++++++- rust/windows-client/src-tauri/tauri.conf.json | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/rust/connlib/tunnel/src/device_channel/tun_windows.rs b/rust/connlib/tunnel/src/device_channel/tun_windows.rs index 93d836145..94a49d15e 100644 --- a/rust/connlib/tunnel/src/device_channel/tun_windows.rs +++ b/rust/connlib/tunnel/src/device_channel/tun_windows.rs @@ -20,7 +20,8 @@ pub struct Tun { impl Tun { pub fn new(config: &InterfaceConfig) -> Result { const TUNNEL_UUID: &str = "e9245bc1-b8c1-44ca-ab1d-c6aad4f13b9c"; - const TUNNEL_NAME: &str = "Firezone Tunnel"; + // wintun automatically appends " Tunnel" to this + const TUNNEL_NAME: &str = "Firezone"; // The unsafe is here because we're loading a DLL from disk and it has arbitrary C code in it. // The Windows client, in `wintun_install` hashes the DLL at startup, before calling connlib, so it's unlikely for the DLL to be accidentally corrupted by the time we get here. diff --git a/rust/windows-client/docs/manual_testing.md b/rust/windows-client/docs/manual_testing.md index e61f41e8b..71d555202 100755 --- a/rust/windows-client/docs/manual_testing.md +++ b/rust/windows-client/docs/manual_testing.md @@ -59,6 +59,7 @@ If the client stops running while signed in, then the token may be stored in Win # Diagnostic logs +- [ ] Given the client was built in release mode, when you first start the client, then it will use the release mode default settings - [ ] Given the client app is signed out, when you change the log filter in the Advanced Settings tab, then the log filter for both the GUI and connlib will change immediately - [ ] Given the Diagnostic Logs tabs is not displayed, when you open the Diagnostic Logs tab, then the log directory size is computed in a worker task (not blocking the GUI) and displayed - [ ] Given the client app is computing the log directory size, when you click "Clear Logs", then the computation will be canceled. diff --git a/rust/windows-client/src-tauri/src/client/settings.rs b/rust/windows-client/src-tauri/src/client/settings.rs index 9db376832..286468733 100755 --- a/rust/windows-client/src-tauri/src/client/settings.rs +++ b/rust/windows-client/src-tauri/src/client/settings.rs @@ -15,12 +15,24 @@ pub(crate) struct AdvancedSettings { pub log_filter: String, } +#[cfg(debug_assertions)] +impl Default for AdvancedSettings { + fn default() -> Self { + Self { + auth_base_url: Url::parse("https://app.firez.one").unwrap(), + api_url: Url::parse("wss://api.firez.one").unwrap(), + log_filter: "firezone_windows_client=debug,firezone_tunnel=trace,connlib_shared=debug,connlib_client_shared=debug,warn".to_string(), + } + } +} + +#[cfg(not(debug_assertions))] impl Default for AdvancedSettings { fn default() -> Self { Self { auth_base_url: Url::parse("https://app.firezone.dev").unwrap(), api_url: Url::parse("wss://api.firezone.dev").unwrap(), - log_filter: "info".to_string(), + log_filter: "firezone_windows_client=info,firezone_tunnel=trace,connlib_shared=info,connlib_client_shared=info,webrtc=error,warn".to_string(), } } } diff --git a/rust/windows-client/src-tauri/tauri.conf.json b/rust/windows-client/src-tauri/tauri.conf.json index b1d0800df..a8e5d5c71 100755 --- a/rust/windows-client/src-tauri/tauri.conf.json +++ b/rust/windows-client/src-tauri/tauri.conf.json @@ -44,7 +44,7 @@ "resizable": true, "width": 640, "height": 480, - "visible": true + "visible": false }, { "label": "settings",