Follow one run through the code.
Aralez is a single Rust binary organized around configuration, execution, filesystem exploration, archive output, resource policy, and destination dispatch.
Module map
main.rsorchestrationconfig.rsschema · embedding · namingreader/device detection · collection treeexplorer/NTFS · ext4 · POSIX nativeexecute.rsinternal · system · external toolsstream.rsfolder · ZIP · TAR.ZST writersupload/folder · SMB · SFTP · S3resource_check.rsmemory · disk · collected sizeresource.rsWindows executable resourcesThe OutputTarget abstraction
Collectors write through a shared enum with Folder, Zip(Mutex<ZipState>), and Tar(Mutex<TarState>) variants. It exposes entry creation, file copy, raw-byte write, directory creation, and finalization so readers and executors do not need separate folder/archive implementations.
pub enum OutputTarget {
Folder,
Zip(Mutex<ZipState>),
Tar(Mutex<TarState>),
}Filesystem explorers
FileSystemExplorer defines initialize and collect. Detection reads on-disk signatures for NTFS, APFS, HFS+, and ext4; the factory then instantiates a platform-supported reader. Linux can fall back to NativeExplorer if an ext4 raw parse encounters known journal/corruption boundaries.
Concurrency
Top-level tasks run sequentially by priority. Entry groups inside an execute task use Rayon par_iter, while archive writers serialize access behind a mutex. This preserves one archive writer while allowing independent tool execution to overlap.
Configuration and resource embedding
Marker-appended YAML
The re-profile command copies the executable, truncates an older appended config if found, then appends data between ===CONFIG_START=== and ===CONFIG_END=== markers.
PE resources
Configuration and dynamic external tools use executable resources. Static supported tools are compiled with include_bytes!.
Extension points
- New artifact coverage: update a platform YAML template; no Rust change is needed for ordinary roots and globs.
- New internal collector: implement the platform branch in
execute::run_internaland expose a stable entry name. - New filesystem: implement
FileSystemExplorer, add signature detection, and route the factory variant. - New output destination: extend
OutputDestination, CLI parsing if needed, feature gating, andupload_to_destination.