-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document Airgap Process for NPM #15501
Comments
Instructions should be attached to this issue. |
Related: #14857 |
@tsmaeder these are the important informations to setup a npm registry with selfsigned certificate, using devfile at the moment. The next comment is the complete steps to setup a test environment and check that these are actually working. Npm airgap devfileHaving that you have a remote NPM private registry and the npm https://registry.npmjs.org. is not accessible from your network. In your npm project devfile:
|
Setup Test environmentSetup NexusHere, I will describe how I install Nexus to test my configuration. The Nexus will be installed through an operator in Openshift 4.2. Install the operatorFrom the the openshift 4.2 console, as an admin,
Create a proxy repoCreate a nexus repository for NPM. Select proxy to https://registry.npmjs.org. Block outbound connections on the repository for now. (we are going to test that we are really offline) Copy the repo URL that we are going to use just next. Start the test workspaceStart a workspace from this devfile: https://gist.github.com/sunix/00f890965f04620139e616fbcba75444 This devfile will set user.home to /project for the quarkus-backend-dev container. Test offlineRemove the file `postit-app/node-frontend` package-lock.json` (or any lock file that may contain informations about registries where to download a dependency) In the container `node-frontend-dev` open the terminal
Npm build is failling as we blocked internet from nexus (won’t mirror) The file we have changed is:
TODO try: NPM_CONFIG_REGISTRY But doesn’t work if need auth ... Checking Language ServerNothing to do as the plugin is do not download any dependencies. User would have to perform a `npm install` manually from the terminal or task. Checking NPM command lineRe-enable the proxy to connect to internet Retry a build Setup TLS with self signed certificate for NexusConfigure Nexus with TLS and self-signed certificateWe are going to add a new route with tls and a self signed certificate that we create: Create the certificate (adapt the CN with your hostname)
or if openssl version < 1.1.1
Notes:
Create a new route in the project where the nexus operator cluster is deployed:
Configure NPM to use the Secured Nexus (with self-signed certificate)Change the registry url to point to the secured one
Remove node_modules folder and try to rebuild it It fails as expected: we have not uploaded the certificate and told NPM to use it Upload tls.crt and set the env variable:
Npm airgap devfileHaving that you have a remote NPM private registry and the npm https://registry.npmjs.org. is not accessible from your network. In your npm project devfile:
|
@sunix what about authenticated access to the registry? |
@sunix why not use NPM_CONFIG_CAFILE? That would be in keeping with the rest of the documented procedures. |
@tsmaeder not sure ... I think i've tried but it wasn't working ... nodejs/node-gyp#695 (comment) |
Is there anything left to document here? |
Test and document the process of setting up an airgap solution for NPM. In particular, configure a workspace based on our default nodejs devfile to use a npm repository that uses a self-signed certificate.
The text was updated successfully, but these errors were encountered: