You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ls
total 0
$ oras blob fetch "ghcr.io/pkgforge/bincache/curl/stunnel/trurl@sha256:ff70f40b3add6dcccb91de8b42f6678ae3ff8f38fc046da8e42337e5d0501bc5" --output "trurl"#pulls only a single artifact (file)#oras enforce we MUST supply an --output file as the blob contains no info on filename, maybe we can just use the value before `@`#or enforce the same requirement?
$ $ ls
total 7.8M
-rw-rw-r-- 1 runner runner 7.8M Jan 5 07:53 trurl
$ file curl
trurl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
Proposal: Introduce --ghcr (also detect if input starts with ghcr.io) , allow --output (Use CWD by default) [Detect pkg or blob based on if input contains @sha256]
The path before the digest is used as default filename for the blob download. Output path can be either the filename or a directory name for blob downloads, but any output path is treated as a directory for package downloads.
With the new metadata now ready at: https://docs.pkgforge.dev/repositories/bincache/metadata
It's time we introduce initial support for pulling OCI images or just their blob
There exists no better library than oras: https://github.com/oras-project/rust-oci-client
I have already tested their CLI: https://github.com/oras-project/oras & and we use it in production for all our ghcr related ops.
Based on the metadata, we have two fields
.ghcr_pkg
&.ghcr_blob
.ghcr_pkg
(Contains the registry_url + tag).ghcr_blob
(Contains the registry_url + tag + blobdigest)Authentication & Headers
GitHub container registry don't allow for anonymous access, but they don't strictly enforce it either, so we can just use arbitrary
Authorization: ${HEADER}
Homebrew & our api uses: https://github.com/pkgforge-dev/reverse-proxies/blob/main/api.ghcr.pkgforge.dev/worker.js#L154
"Authorization: Bearer QQ=="
There are also some other headers that need to be passed, but maybe the library does it automatically?
If not, set: https://github.com/pkgforge-dev/reverse-proxies/blob/main/api.ghcr.pkgforge.dev/worker.js#L155
"Accept: application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, application/vnd.oci.artifact.manifest.v1+json"
The text was updated successfully, but these errors were encountered: