YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat(sentry): attach non-sensitive CLI/app settings as context on all events
Louis Beaumonte4269425591d
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rsindex e6794be58..ff8c4df67 100755--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs@@ -732,6 +732,25 @@ async fn main() {"https://da4edafe2c8e5e8682505945695ecad7@o4505591122886656.ingest.us.sentry.io/4510761355116544",sentry::ClientOptions {release: sentry::release_name!(),+ send_default_pii: false,+ server_name: Some("screenpipe-app".into()),+ before_send: Some(std::sync::Arc::new(|mut event| {+ fn strip_user_paths(s: &str) -> String {+ let re_unix = regex::Regex::new(r"/Users/[^/\s]+").unwrap();+ let re_win = regex::Regex::new(r"(?i)C:\\Users\\[^\\\s]+").unwrap();+ let s = re_unix.replace_all(s, "~").to_string();+ re_win.replace_all(&s, "~").to_string()+ }+ if let Some(ref mut msg) = event.message {+ *msg = strip_user_paths(msg);+ }+ for val in event.exception.values.iter_mut() {+ if let Some(ref mut v) = val.value {+ *v = strip_user_paths(v);+ }+ }+ Some(event)+ })),..Default::default()},)))diff --git a/crates/screenpipe-server/src/bin/screenpipe-server.rs b/crates/screenpipe-server/src/bin/screenpipe-server.rsindex 9e15891f7..b70ad393a 100644--- a/crates/screenpipe-server/src/bin/screenpipe-server.rs+++ b/crates/screenpipe-server/src/bin/screenpipe-server.rs@@ -262,6 +262,26 @@ async fn main() -> anyhow::Result<()> {sentry::ClientOptions {release: Some(release_name.into()),traces_sample_rate: 0.1,+ send_default_pii: false,+ server_name: Some("screenpipe-cli".into()),+ before_send: Some(std::sync::Arc::new(|mut event| {+ // Strip file paths containing usernames from error messages+ fn strip_user_paths(s: &str) -> String {+ let re_unix = regex::Regex::new(r"/Users/[^/\s]+").unwrap();+ let re_win = regex::Regex::new(r"(?i)C:\\Users\\[^\\\s]+").unwrap();+ let s = re_unix.replace_all(s, "~").to_string();+ re_win.replace_all(&s, "~").to_string()+ }+ if let Some(ref mut msg) = event.message {+ *msg = strip_user_paths(msg);+ }+ for val in event.exception.values.iter_mut() {+ if let Some(ref mut v) = val.value {+ *v = strip_user_paths(v);+ }+ }+ Some(event)+ })),..Default::default()}));