uhop/install-artifact-from-github

download fails from http mirror

japj opened this issue · 5 comments

japj commented

I am trying to setup a local mirror for the RE2 1.6.0 binary artifacts.
It took me a bit to figure out the mirror directory structure (it was not entire clear upfront from the documentation that the structure was //releases/download/).

After that I ran into an actual issue with downloading files from the mirror.

It seems that although the logging states that it is trying to download from http, the implementation seems to be hardcoded to use https (and thus it fails to actually download the files).

> install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR || npm run rebuild

  Trying http://mymirror/uhop/node-re2/releases/download/1.16.0/win32-x64-83.br ...
  Trying http://mymirror/uhop/node-re2/releases/download/1.16.0/win32-x64-83.gz ...
  Building locally ...

the node built-in https api is used at https://github.com/uhop/install-artifact-from-github/blob/master/bin/install-from-cache.js#L112

Is it intended that only https servers can be used as a mirror?

uhop commented

Yes, it was intentional to secure an artifact. The logging is incorrect.

uhop commented

The "http://" part is ignored (yet printed) because https module is used. I will update the documentation with more information on how to make a mirror.

japj commented

Yes, it was intentional to secure an artifact. The logging is incorrect.

ok, good to know.

I’ll need to look into how to arrange for this through our IT department (a previous colleague already setup an http mirror for other node binary packages, so I was hoping I could use the existing server setup).

uhop commented

I implemented both http and https as well as copying from a local file system. The documentation is updated accordingly.

Were you able to solve your setup problem? Should I look into adding proxy support? TBH, I have no idea how to test it — I don’t use proxies.

uhop commented

Please reopen if needed.