diff --git a/Earthfile b/Earthfile index 5d720d17..aaa60d87 100644 --- a/Earthfile +++ b/Earthfile @@ -474,10 +474,11 @@ tauri-build: # Binaries SAVE ARTIFACT --if-exists --keep-ts "target/${target}/release/portmaster" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/portmaster" SAVE ARTIFACT --if-exists --keep-ts "target/${target}/release/portmaster.exe" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/portmaster.exe" - # SAVE ARTIFACT --if-exists --keep-ts "target/${target}/release/WebView2Loader.dll" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/WebView2Loader.dll" + SAVE ARTIFACT --if-exists --keep-ts "target/${target}/release/WebView2Loader.dll" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/WebView2Loader.dll" SAVE ARTIFACT --if-exists --keep-ts "target/${target}/release/portmaster" ./output/portmaster SAVE ARTIFACT --if-exists --keep-ts "target/${target}/release/portmaster.exe" ./output/portmaster.exe + SAVE ARTIFACT --if-exists --keep-ts "target/${target}/release/WebView2Loader.dll" ./output/WebView2Loader.dll tauri-release: @@ -517,9 +518,11 @@ release-prep: # Windows specific COPY (+tauri-build/output/portmaster.exe --target="x86_64-pc-windows-gnu") ./output/binary/windows_amd64/portmaster.exe + COPY (+tauri-build/output/WebView2Loader.dll --target="x86_64-pc-windows-gnu") ./output/binary/windows_amd64/WebView2Loader.dll COPY (+go-build/output/portmaster-core.exe --GOARCH=amd64 --GOOS=windows --CMDS=portmaster-core) ./output/binary/windows_amd64/portmaster-core.exe - # TODO(vladimir): figure out a way to get the lastest release of the kext. - RUN touch ./output/binary/windows_amd64/portmaster-kext.sys + # TODO(vladimir): figure out a way to get the lastest release of the kext and dll. + RUN wget -O ./output/binary/windows_amd64/portmaster-kext.sys https://updates.safing.io/windows_amd64/kext/portmaster-kext_v2-0-4.sys + RUN touch ./output/binary/windows_amd64/portmaster-core.dll # All platforms COPY (+assets/assets.zip) ./output/binary/all/assets.zip diff --git a/desktop/tauri/src-tauri/src/cli.rs b/desktop/tauri/src-tauri/src/cli.rs index d11c2aed..61a7462e 100644 --- a/desktop/tauri/src-tauri/src/cli.rs +++ b/desktop/tauri/src-tauri/src/cli.rs @@ -1,9 +1,9 @@ use log::LevelFilter; -#[cfg(not(debug_assertions))] -const DEFAULT_LOG_LEVEL: log::LevelFilter = log::LevelFilter::Warn; +// #[cfg(not(debug_assertions))] +// const DEFAULT_LOG_LEVEL: log::LevelFilter = log::LevelFilter::Warn; -#[cfg(debug_assertions)] +// #[cfg(debug_assertions)] const DEFAULT_LOG_LEVEL: log::LevelFilter = log::LevelFilter::Debug; #[derive(Debug)] @@ -43,8 +43,8 @@ pub fn parse(raw: impl IntoIterator>) -> Cl data: None, log_level: DEFAULT_LOG_LEVEL, background: false, - with_prompts: false, - with_notifications: false, + with_prompts: true, + with_notifications: true, }; let raw = clap_lex::RawArgs::new(raw); @@ -67,11 +67,11 @@ pub fn parse(raw: impl IntoIterator>) -> Cl Ok("background") => { cli.background = true; } - Ok("with_prompts") => { - cli.with_prompts = true; + Ok("no-prompts") => { + cli.with_prompts = false; } - Ok("with_notifications") => { - cli.with_notifications = true; + Ok("no-notifications") => { + cli.with_notifications = false; } _ => { // Ignore unexpected flags diff --git a/desktop/tauri/src-tauri/src/main.rs b/desktop/tauri/src-tauri/src/main.rs index cce1b266..411d4579 100644 --- a/desktop/tauri/src-tauri/src/main.rs +++ b/desktop/tauri/src-tauri/src/main.rs @@ -127,14 +127,14 @@ fn main() { let cli_args = cli::parse(std::env::args()); #[cfg(target_os = "linux")] - let log_target = if let Some(data_dir) = cli_args.data { - tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Folder { - path: Path::new(&format!("{}/logs/app2", data_dir)).into(), - file_name: None, - }) - } else { - tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Stdout) - }; + let log_target = tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Stdout); + // let log_target = if let Some(data_dir) = cli_args.data { + // tauri_plugin_log::Target::new(tauri_plugin_log::TargetKind::Folder { + // path: Path::new(&format!("{}/logs/app2", data_dir)).into(), + // file_name: None, + // }) + // } else { + // }; // TODO(vladimir): Permission for logs/app2 folder are not guaranteed. Use the default location for now. #[cfg(target_os = "windows")] diff --git a/desktop/tauri/src-tauri/src/portmaster/notifications.rs b/desktop/tauri/src-tauri/src/portmaster/notifications.rs index 452db996..7128eda0 100644 --- a/desktop/tauri/src-tauri/src/portmaster/notifications.rs +++ b/desktop/tauri/src-tauri/src/portmaster/notifications.rs @@ -2,6 +2,7 @@ use crate::portapi::client::*; use crate::portapi::message::*; use crate::portapi::models::notification::*; use crate::portapi::types::*; +use log::debug; use log::error; use serde_json::json; use tauri::async_runtime; @@ -25,12 +26,12 @@ pub async fn notification_handler(cli: PortAPI) { Ok(n) => { // Skip if this one should not be shown using the system notifications if !n.show_on_system { - return; + continue; } // Skip if this action has already been acted on - if n.selected_action_id.is_empty() { - return; + if !n.selected_action_id.is_empty() { + continue; } show_notification(&cli, key, n).await; } diff --git a/desktop/tauri/src-tauri/tauri.conf.json5 b/desktop/tauri/src-tauri/tauri.conf.json5 index 464b1071..00a9cced 100644 --- a/desktop/tauri/src-tauri/tauri.conf.json5 +++ b/desktop/tauri/src-tauri/tauri.conf.json5 @@ -28,12 +28,12 @@ "takesValue": true }, { - "name": "with-notifications", - "description": "Enable experimental notifications via Tauri. Replaces the notifier app." + "name": "no-notifications", + "description": "Disable notifications via Tauri." }, { - "name": "with-prompts", - "description": "Enable experimental prompt support via Tauri. Replaces the notifier app." + "name": "no-prompts", + "description": "Disable prompt support via Tauri." }, ] } diff --git a/service/integration/integration_windows.go b/service/integration/integration_windows.go index cfb0cd9b..40d063f4 100644 --- a/service/integration/integration_windows.go +++ b/service/integration/integration_windows.go @@ -37,7 +37,7 @@ func (i *OSIntegration) Initialize() error { return nil } -// CleanUp releases any resourses allocated during initializaion. +// CleanUp releases any resources allocated during initialization. func (i *OSIntegration) CleanUp() error { if i.os.dll != nil { return i.os.dll.Release() diff --git a/service/intel/filterlists/index.go b/service/intel/filterlists/index.go index 9ba0ec17..15055e3b 100644 --- a/service/intel/filterlists/index.go +++ b/service/intel/filterlists/index.go @@ -238,14 +238,14 @@ func updateListIndex() error { func ResolveListIDs(ids []string) ([]string, error) { index, err := getListIndexFromCache() if err != nil { - if errors.Is(err, database.ErrNotFound) { - if err := updateListIndex(); err != nil { - return nil, err - } + // if errors.Is(err, database.ErrNotFound) { + // if err := updateListIndex(); err != nil { + // return nil, err + // } - // retry resolving IDs - return ResolveListIDs(ids) - } + // // retry resolving IDs + // return ResolveListIDs(ids) + // } log.Errorf("failed to resolved ids %v: %s", ids, err) return nil, err