Skip to main content

Module remote

Module remote 

Source
Expand description

HTTPS fetch with SHA256 verification and TTL-based local caching (wgex-inspired).

Structs§

FetchOpts

Constants§

DEFAULT_MAX_BYTES
Default max download size for a single object (20 MiB).
DEFAULT_TIMEOUT_SECS
Default HTTP timeout.
DEFAULT_TTL_SECS
Default TTL for cached remote objects (24 hours).

Functions§

cache_root
Cache root: $JAN_CACHE_DIR or $XDG_CACHE_HOME/jan (or platform equivalent).
fetch_and_install_bundle
Download a jan bundle zip, verify the zip SHA256, verify manifest members, unpack under ~/.cache/jan/trees/<sha256>/, and return (tree_dir, root_yaml).
fetch_verified
Fetch url, verify against expected_sha256, and return the cached file path.
fetch_verified_text
Read verified remote content as a UTF-8 string (for YAML includes).
looks_like_remote_url
Whether a string looks like an http(s) URL suitable for jan use.
objects_dir
trees_dir