Skip to content

Commit

Permalink
fix: enabling npm artifacts repo process update (rhdevdocs-5035) (#2640)
Browse files Browse the repository at this point in the history
Co-authored-by: Nick Boldt <nboldt@redhat.com>
  • Loading branch information
deerskindoll and nickboldt authored Oct 20, 2023
1 parent a534a2b commit a545c82
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ apiVersion: v1
metadata:
name: tls-cer
annotations:
controller.devfile.io/mount-path: /home/user/certs
controller.devfile.io/mount-path: /public-certs
controller.devfile.io/mount-as: file
labels:
controller.devfile.io/mount-to-devworkspace: 'true'
controller.devfile.io/watch-secret: 'true'
data:
tls.cer: >-
__<Base64_encoded_content_of_public_cert>__ <1>
nexus.cer: >-
<Base64_encoded_content_of_public_cert>__ <1>
----
<1> Base64 encoding with disabled line wrapping.

Expand All @@ -51,7 +51,9 @@ metadata:
controller.devfile.io/mount-to-devworkspace: 'true'
controller.devfile.io/watch-configmap: 'true'
data:
NODE_EXTRA_CA_CERTS: /home/user/certs/tls.cer
NPM_CONFIG_REGISTRY: >-
https://__<npm_artifact_repository_route>__/repository/npm-all/
----

include::partial$proc_disabling-self-signed-certificate-validation.adoc[leveloffset=+1]
include::partial$proc_restoring-node-extra-ca-certs-variable-value.adoc[leveloffset=+1]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[id="disabling-self-signed-certificate-validation"]
= Disabling self-signed certificate validation

Run the command below to disable SSL/TLS, bypassing the validation of your self-signed certificates. Note that this is a potential security risk. For a better solution, configure a self-signed certificate you trust with `NODE_EXTRA_CA_CERTS`.

.Procedure

* Run the following command in the terminal:
+
[source, yaml]
----
npm config set strict-ssl false
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[id="restoring-node-extra-ca-certs-variable-value"]
= Configuring NODE_EXTRA_CA_CERTS to use a certificate

Use the command below to set NODE_EXTRA_CA_CERTS to point to where you have your SSL/TLS certificate.

.Procedure

* Run the following command in the terminal:
+
[source, bash]
----
`export NODE_EXTRA_CA_CERTS=/public-certs/nexus.cer` <1>
`npm install`
----
<1> `/public-certs/nexus.cer` is the path to self-signed SSL/TLS certificate of Nexus artifactory.

0 comments on commit a545c82

Please sign in to comment.