Changes for version 0.011 - 2026-12-04

  • Security and Resource Limits:
    • Common to the command-line tools and the server:
      • Sanitize paths derived from upstream package indexes and from distribution archives.
      • Limit the file count, total size, and largest file when unpacking archives (default 40000, 200MB, 30MB). Refused archives are remembered in the dist cache until the limit is raised.
      • Only download from allowed upstreams, by default the public CPAN over https. INCOMPATIBLE: http:// or DarkPAN mirrors now require --allowed-upstreams=+URL.
      • Restrict the characters of paths requested from upstream.
      • Key the dist cache on upstream_backup_url too, so branches can't poison each other's cached distributions.
      • Don't hold downloaded or unpacked files in memory until commit.
      • Fix quadratic POD stripping when scanning source for packages.
      • Make control characters visible when writing to a terminal.
    • cpangit-add:
      • New options --allowed-upstreams, --max-files, --max-total-size, --max-file-size.
      • When unpacking with --local, reject conflicting paths, attempts to write through symlinks, and symlinks outside the repo.
    • cpangit-audit:
      • New option --allowed-upstreams.
      • --assert-no-cve fails for versions it can't compare (like Foo-1.02-RC1) instead of passing them.
    • cpangit-create:
      • New option --allowed-upstreams. --upstream=URL is allowed automatically for this command.
    • cpangit-diff:
      • New option --allowed-upstreams.
    • cpangit-server:
      • Serve only branch heads by default. INCOMPATIBLE: serving tags and commits now require --serve-tags / --serve-commits. --branch-head-only is deprecated. HEAD means the checked-out branch.
      • Browsing and comparing distributions requires --browse-dists.
      • Don't autofetch for mirrors whose upstream isn't allowed by --allowed-upstreams.
      • New options --max-download-size (per file, default 100M) and --max-cache-size (per process, default 10G; beyond it, downloads get 503).
      • New option --tree-cache-limit (default unlimited for branches only, otherwise 20). Commit IDs share an entry regardless of case.
      • New options --max-files, --max-total-size, --max-file-size.
      • Never use the working directory or index of the checked-out branch.
      • Serve downloads as attachments with safely quoted names, and errors as text/plain, all with nosniff.
      • Add ETags from Git object IDs and Cache-Control, for cheap revalidation. Cache the gzipped 02packages.details.txt.gz.
      • Try at most 16 URL components as a friendly branch or tag name.
  • API Changes
    • CPAN::InGit
      • new attributes allowed_upstreams, download_limit, downloaded_bytes
      • new methods is_allowed_upstream, update_allowed_upstreams
      • get_archive_tree new option use_workdir
      • cached_dist_tree remembers refused archives.
    • MutableTree
      • new method import_from_archive (with global %archive_limits)
      • set_path and friends sanitize paths and guard against symlinks in the working directory
      • fix stale 'branch' attribute after a commit, which broke a third commit.
    • ArchiveTree
      • import_dist and index_distribution sanitize author paths
      • add_local_dist uses import_from_archive.
    • MirrorTree
      • fetch_upstream_file enforces the allowed upstreams, path characters and download_limit
      • downloads are added to the tree immediately.
    • DistTree
      • new class method unwrap_tree
      • new_from_archive accepts the options of import_from_archive
    • Advisories
      • affecting returns every advisory for a version it can't parse, with a warning
    • Server
      • new attributes browse_dists, serve_tags, serve_commits, tree_cache_limit
      • branch_head_only is deprecated
      • render_gzipped output is reproducible.

Documentation

import CPAN packages to local CPAN trees
list the distributions of a branch which are outdated or affected by CVEs
create git branches for custom CPAN trees
compare two CPAN distributions, for reviewing an upgrade
serve a CPAN tree from a git branch, or all CPAN trees in the git repo

Modules

Manage custom CPAN trees to pin versions for your projects
Look up security advisories (CVEs) that affect a release of a distribution
An object managing a CPAN file structure in a Git Tree
A MutableTree holding the files of one CPAN distribution
Subclass of ArchiveTree which automatically mirrors files from upstream
Utility object that represents a Git Tree and pending changes
A Mojolicious::Controller that serves the ArchiveTrees from a git repo
PerlIO layer which makes control characters visible on a terminal

Provides

in lib/CPAN/InGit/MutableTree.pm
in lib/CPAN/InGit.pm
in lib/CPAN/InGit/MutableTree.pm