Skip to content

Commit

Permalink
Reduce clone usage (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
puffyCid authored Dec 26, 2024
1 parent e431ca3 commit 7c3ee74
Show file tree
Hide file tree
Showing 44 changed files with 443 additions and 505 deletions.
3 changes: 3 additions & 0 deletions .changes/unreleased/Added-20241223-233127.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Added
body: Timelining support
time: 2024-12-23T23:31:27.461106316-05:00
3 changes: 3 additions & 0 deletions .changes/unreleased/Added-20241223-233222.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Added
body: Apollo project (Tauri GUI application)
time: 2024-12-23T23:32:22.697519535-05:00
3 changes: 3 additions & 0 deletions .changes/unreleased/Added-20241224-020123.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Added
body: GZIP compression option to CLI
time: 2024-12-24T02:01:23.13589441-05:00
3 changes: 3 additions & 0 deletions .changes/unreleased/ArtemisApi-20241226-001253.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: ArtemisApi
body: Support for parsing GNOME Application usage
time: 2024-12-26T00:12:53.188439439-05:00
3 changes: 3 additions & 0 deletions .changes/unreleased/ArtemisApi-20241226-001316.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: ArtemisApi
body: Support for parsing GNOME Extensions
time: 2024-12-26T00:13:16.083925929-05:00
3 changes: 3 additions & 0 deletions .changes/unreleased/ArtemisApi-20241226-001330.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: ArtemisApi
body: Support for parsing gedit recently opened files
time: 2024-12-26T00:13:30.904411422-05:00
3 changes: 3 additions & 0 deletions .changes/unreleased/Changed-20241224-020021.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Changed
body: Lowered memory usage by reducing clones and streamlining output workflow
time: 2024-12-24T02:00:21.231924144-05:00
43 changes: 43 additions & 0 deletions cli/src/collector/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ pub(crate) enum Commands {
/// Optional output directory for storing results
#[arg(long, default_value_t = String::from("./tmp"))]
output_dir: String,
/// GZIP Compress results
#[arg(long)]
compress: bool,
},
}

Expand All @@ -58,6 +61,7 @@ pub(crate) fn run_collector(command: &Commands, output: Output) {
artifact,
format,
output_dir,
compress,
} => {
if artifact.is_none() {
println!("No artifact provided");
Expand All @@ -66,6 +70,7 @@ pub(crate) fn run_collector(command: &Commands, output: Output) {

let arti = artifact.as_ref().unwrap();
collector.artifacts.push(setup_artifact(arti));
collector.output.compress = *compress;

if !format.is_empty() {
collector.output.format = format.to_string().to_lowercase();
Expand Down Expand Up @@ -535,6 +540,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -555,6 +561,7 @@ mod tests {
yara_rule: None,
}),
format: String::from("json"),
compress: false,
output_dir: String::from("./tmp"),
};

Expand All @@ -568,6 +575,7 @@ mod tests {
artifact: Some(Chromiumdownloads {}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -577,6 +585,7 @@ mod tests {
artifact: Some(Chromiumhistory {}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -586,6 +595,7 @@ mod tests {
artifact: Some(Firefoxdownloads {}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -595,6 +605,7 @@ mod tests {
artifact: Some(Firefoxhistory {}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -604,6 +615,7 @@ mod tests {
artifact: Some(Launchd { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: true,
};

let out = output();
Expand All @@ -613,6 +625,7 @@ mod tests {
artifact: Some(UsersMacos { alt_path: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -624,6 +637,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -633,6 +647,7 @@ mod tests {
artifact: Some(Cron {}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -642,6 +657,7 @@ mod tests {
artifact: Some(Systeminfo {}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -651,6 +667,7 @@ mod tests {
artifact: Some(GroupsMacos { alt_path: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -660,6 +677,7 @@ mod tests {
artifact: Some(Execpolicy { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -669,6 +687,7 @@ mod tests {
artifact: Some(Shellhistory {}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -678,6 +697,7 @@ mod tests {
artifact: Some(Fsevents { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -687,6 +707,7 @@ mod tests {
artifact: Some(Emond { alt_path: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -696,6 +717,7 @@ mod tests {
artifact: Some(SafariDownloads {}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -705,6 +727,7 @@ mod tests {
artifact: Some(SafariHistory {}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -720,6 +743,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -735,6 +759,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -753,6 +778,7 @@ mod tests {
artifact: Some(Logons { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -764,6 +790,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -772,6 +799,7 @@ mod tests {
let command = Commands::Acquire {
artifact: Some(SudologsLinux { alt_path: None }),
format: String::from("json"),
compress: false,
output_dir: String::from("./tmp"),
};

Expand All @@ -789,6 +817,8 @@ mod tests {
path_regex: None,
}),
format: String::from("json"),
compress: false,

output_dir: String::from("./tmp"),
};

Expand All @@ -809,6 +839,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -821,6 +852,7 @@ mod tests {
artifact: Some(Prefetch { alt_dir: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -833,6 +865,7 @@ mod tests {
artifact: Some(Services { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -842,6 +875,7 @@ mod tests {
artifact: Some(Shimcache { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -851,6 +885,7 @@ mod tests {
artifact: Some(Shimdb { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -860,6 +895,7 @@ mod tests {
artifact: Some(Recyclebin { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -869,6 +905,7 @@ mod tests {
artifact: Some(UsersWindows { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -878,6 +915,7 @@ mod tests {
artifact: Some(Tasks { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -887,6 +925,7 @@ mod tests {
artifact: Some(Amcache { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -902,6 +941,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -914,6 +954,7 @@ mod tests {
artifact: Some(Srum { alt_file: None }),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -929,6 +970,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand All @@ -952,6 +994,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
};

let out = output();
Expand Down
3 changes: 3 additions & 0 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
}),
};

Expand All @@ -232,6 +233,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
}),
};

Expand All @@ -257,6 +259,7 @@ mod tests {
}),
format: String::from("json"),
output_dir: String::from("./tmp"),
compress: false,
}),
};

Expand Down
Loading

0 comments on commit 7c3ee74

Please sign in to comment.