Mirroring OPAM repository

Hi,

I am trying to create a private OPAM 2 repository, with the sources and releases in non-public Github repositories. This of course then fails, because OPAM can’t download the tarballs.

It looks like what I would need is to have opam admin cache create a cache of the tarballs and opam admin index create a tarball of my opam repository and put that on some internal HTTP server, but how can I give opam admin cache the credentials to download tarballs from GitHub?

wget and curl have facilities for being given credentials, so that might work if you scripted that portion yourself.

I was thinking of adding additional options to OPAMCURL but can’t figure out what options to add to make GitHub let me download url (and not some weird api.github.com token trickery), without passing all my login cookies to it.