npm installation support for binaries mirror
thiagofigueiro opened this issue · comments
The npm installer hard-codes the download URL to https://dl.bintray.com/elmlang/elm-platform/
:
var filename = operatingSystem + "-" + arch + ".tar.gz";
var url = "https://dl.bintray.com/elmlang/elm-platform/"
+ platform.elmVersion + "/" + filename;
In some environments it's not possible to access external URLs and all dependencies must be fetched from a local mirror.
The only work-around that I can think of is to "hijack" the dl.bintray.com hostname (e.g. via a hosts file entry) and replicate the content structure. I don't know what would be needed to work-around the x509 certificate and I haven't tried it.
It would be most useful if there was a way to specify a mirror for the elmlang binaries during installation.
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
This is a problem for me too. 😔
Why not host the executables on your infrastructure and just download them from there? Seems way easier than mirrors or hijacking or anything. Make a download-elm.sh
and call it when you need to.
If this is unworkable, please discuss with known community members on Slack, and after refining it, open a new issue explaining the particulars that'd make download-elm.sh
not ideal. (Assuming that new issue is justified, please share examples of other npm
packages that do what you suggest in it. Having precedence is useful for making design choices.)
I made a meta thing about it in #223 though.