uhop / node-re2

node.js bindings for RE2: fast, safe alternative to backtracking regular expression engines.
Other
489 stars 53 forks source link

Trying to install re2 behind proxy #116

Closed BlueCog closed 2 years ago

BlueCog commented 2 years ago

Context: I'm trying to install re2 via NPM via a docker build on a ubi7/python-38 (RHEL) image.

I'm setting proxy and registry settings via .npmrc:

registry = http://internal.registry/repository/npm/
strict-ssl = false

phantomjs_cdnurl = http://internal.registr:8080/phantomjs
sass_binary_site = http:/internal.registr:8080/node-sass
chromedriver_cdnurl = http://internal.registr:8080/chromedriver
https-proxy=http://internal.proxy:8080
http-proxy=http:/internal.proxy:8080

Installing other NPM packages is going fine

But when i'm getting to re2 i'm seeing that (via the install script?) github.com is being contacted:

> re2@1.16.0 install /opt/app-root/src/node_modules/re2
> install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR || npm run rebuild

Trying https://github.com/uhop/node-re2/releases/download/1.16.0/linux-x64-83.br ...
Trying https://github.com/uhop/node-re2/releases/download/1.16.0/linux-x64-83.gz ...
Building locally ...

I'd like to configure a proxy to reach https://github.com from within the installation but I'm not able to configure this correctly

But i'm still getting timeouts. Is there any other way i could configure a proxy for downloading the files?

_I know about the RE2_DOWNLOAD_MIRROR env var but I like to avoid self hosting the files (and needing to do LCM to them)._

uhop commented 2 years ago

RE2_DOWNLOAD_MIRROR is not an NPM repository. It is a file server. This option is documented here: https://github.com/uhop/install-artifact-from-github/wiki/Installing#command-line-parameters

This option does not support a proxy, unless it is done transparently using mechanisms like VPN. I suggest to continue building locally like it does now.

BlueCog commented 2 years ago

Hi @uhop, thanks for getting back to me.

Following your URL about command-line-parameters: if i understand it correctly i cloud set DEVELOPMENT_SKIP_GETTING_ASSET to skip downloading and start building directly? Our build is a bit slow now because of the timeouts on the downloads...

uhop commented 2 years ago

Yes. It will prevent any attempt of downloading and will go straight to compiling.

uhop commented 2 years ago

You can try to skip downloading a precompiled module by setting DEVELOPMENT_SKIP_GETTING_ASSET to any non-empty value. It is documented here: https://github.com/uhop/install-artifact-from-github/wiki/Installing#environment-variables

It should go straight to compiling the module.