Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to proxy a single file with Nexus?

I'm trying to proxy node-sass and other npm libraries through Nexus, but run into problems when a post install step of node-sass tries to pull the file https://github.com/sass/node-sass/releases/download/v3.10.1/linux-x64-48_binding.node from github. I'm behind a corporate firewall, so my only option is having Nexus proxy all the files I need.

Is it possible to add just this individual file to Nexus somehow, so that it's able to proxy that and deliver it whenever a request is sent to https://github.com/sass/node-sass/releases/download/v3.10.1/linux-x64-48_binding.node?

like image 885
A. Duff Avatar asked Oct 21 '16 14:10

A. Duff


People also ask

What is proxy in Nexus?

A proxy repository is a substitute access point and managed cache for remote repositories. These could be the public repositories for open source components or private repositories such as another Nexus Repository for instance.

What are the different types of repository that we can create using Sonatype Nexus?

Nexus Repository Manager provides for three different kinds of repositories: Proxy repositories, Hosted repositories and Virtual repositories.

What is raw repository in Nexus?

A raw proxy repository can be used to proxy any static website. This includes a Maven site hosted in a raw repository in another Nexus Repository Manager server or a plain static website hosted on another web server like Apache httpd.

What is group repository in Nexus?

Repository groups are a powerful feature of Nexus Repository Manager. They allow you to combine multiple repositories and other repository groups of the same repository format in a single repository group.


1 Answers

After some digging the best solution I can think of is to do this:

https://github.com/sass/node-sass/blob/9c6933f4eb5c9572e1cdc577d500469c14411908/lib/extensions.js#L121-L147

You can use the --sass-binary-site argument or environment variable (or value in your .npmrc, lol) to override where it will reach out for these packages, where you could potentially clone the repo internally so that you have them all: https://github.com/sass/node-sass-binaries

More info on this is available on these two issues:

  • https://github.com/sass/node-sass/issues/775
  • https://github.com/sass/node-sass/issues/1443

As well, there is a lot of information on this available here (towards the bottom) from us friendly folks at Sonatype: https://support.sonatype.com/hc/en-us/articles/213465048-Why-does-npm-client-need-access-to-URLs-other-than-my-private-registry-

like image 51
DarthHater Avatar answered Oct 16 '22 13:10

DarthHater