Changes:
- project-wide: Reworked structure so proot-distro can have a stable Python API. Now you can build own programs with proot-distro functionality for managing containers, no need to rely on command line interface and parsing shell output. Look samples directory.
- reset: Prevent containers from substituting their stored image reference with a host path or URL that would be extracted into the container on the next reset; only registry references are now accepted.
- backup: Fix tar archive misalignment during backup and
RUN-step layer packing when a running session shrinks a file mid-archive, which previously caused missing files or allowed containers to inject fake entries. - build RUN step: Ensure traced processes are terminated before
prootexits on a Ctrl-C or killed build so they cannot continue running as unconfined host processes and write to bind-mounted paths. - input checks: Anchor validation patterns strictly to the end of the string rather than
$to prevent trailing newlines in imageEnventries from executing as shell commands or corruptingPD_IMAGE_ID. - terminal escapes: Escape C1 controls, Unicode format characters, HTTP reason phrases, lock-holder command lines, detached-session summaries, and
--get-proot-cmdoutput before printing to the terminal. - push: Handle tampered
mediaTypevalues in cached manifests without crashing or sending invalidContent-Typeheaders, and compute the pushed digest locally instead of trusting the unvalidatedDocker-Content-Digestheader. - shared cache: Prevent builds from storing images with missing layers when
remove --imageorclear-cacheruns concurrently, when multiple data directories share a cache, or when a corrupt blob is deleted while being rewritten. - install: Build and restore containers in a staging directory before renaming them into place so interrupted operations do not leave behind broken installations or merge into future installs.
- reset and restore: Avoid leaving half-replaced containers on failed restores, preserve recovery options when a reset's reinstall fails, and stop misreporting disk-full write errors as corrupted archives.
- build scratch space: Clean up leftover scratch directories from killed or interrupted builds (including
/tmpfallbacks) during subsequent builds andclear-cache. - build: Handle Ctrl-C, full disks, and truncated
COPYsources during layer packing cleanly instead of crashing with a rawValueErrortraceback, and handle failures when no scratch directory can be created. - Ctrl-C and Ctrl-\: Prevent
tarfileextraction from silently swallowing interrupt signals so extractions abort as expected. - wording: Fix the
build --install-ashelp/error message to no longer instruct users to pass the nonexistent--nameoption.