Aralez Docs
v0.11.0 Download
Develop/Architecture internals
Source map

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.rsorchestration
config.rsschema · embedding · naming
reader/device detection · collection tree
explorer/NTFS · ext4 · POSIX native
execute.rsinternal · system · external tools
stream.rsfolder · ZIP · TAR.ZST writers
upload/folder · SMB · SFTP · S3
resource_check.rsmemory · disk · collected size
resource.rsWindows executable resources

The 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.

conceptual Rust
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

Linux / macOS

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.

Windows

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_internal and 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, and upload_to_destination.