mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-04 13:56:23 +01:00
Clear Yaak Proxy traffic at launch and follow the real system proxy
Captured traffic is now cleared as the app launches by default, with a "Keep between launches" choice that brings the size limit with it. An install that had a size limit set keeps its traffic. The Proxy settings tab is regrouped into Proxy, Decryption, Traffic and Terminal, and the per-body limit row is gone. The app now watches macOS proxy settings and follows them: when another app or the user points the system proxy elsewhere, the override shows as off and the settings saved for restoring are dropped, so quitting puts back nothing the app didn't set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
13ef9c60f1
commit
4fc95d264c
15 files changed
+726
-76
No files matched your search
@@ -324,6 +324,27 @@ pub fn clear(db: &ProxyQueryManager) -> Result<usize, String> {
|
||||
.map_err(|e| format!("Failed to clear flows: {e}"))
|
||||
}
|
||||
|
||||
/// Deletes every flow and message from `proxy.db` in one transaction, with what was left of a
|
||||
/// clear or sweep, for a launch that starts empty. Saved searches and gRPC schemas stay. Only
|
||||
/// before anything else writes: unlike [`clear`], flows being written are not spared. Their
|
||||
/// bodies are in `blobs.sqlite`, which goes whole ([`crate::db::remove_blobs`]).
|
||||
pub fn delete_all(db: &ProxyQueryManager) -> Result<(), String> {
|
||||
db.with_tx(|c| {
|
||||
let conn = c.conn().resolve();
|
||||
// Unconditional, so SQLite drops each table's pages whole rather than row by row.
|
||||
for table in [
|
||||
"flow_messages",
|
||||
"flows",
|
||||
"flow_clear_mark",
|
||||
"flow_sweep_pending",
|
||||
] {
|
||||
conn.execute(&format!("DELETE FROM {table}"), [])?;
|
||||
}
|
||||
Ok::<_, yaak_database::Error>(())
|
||||
})
|
||||
.map_err(|e| format!("Failed to delete captured traffic: {e}"))
|
||||
}
|
||||
|
||||
/// Flows deleted per transaction while deleting cleared ones, so a flow being written never
|
||||
/// waits long behind it.
|
||||
pub const DELETE_BATCH: usize = 500;
|
||||
|
||||
Reference in new issue
Block a user