]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/npm: restrict the build to be offline
authorJean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Fri, 24 Jan 2020 17:07:32 +0000 (18:07 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Jan 2020 16:38:54 +0000 (16:38 +0000)
After the do_fetch task, every other tasks must not access the network.
In order to ensure this point every npm command must use the offline
configuration. In addition setting an invalid proxy is used as a safety.

Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/npm.bbclass

index 799b2a3829956ecff922b2e4e98a12113ac66509..cf2c12047ed291c59fa8ecb29c6429ce510f8b99 100644 (file)
@@ -44,6 +44,9 @@ NPM_BUILD = "${WORKDIR}/npm-build"
 def npm_global_configs(d):
     """Get the npm global configuration"""
     configs = []
+    # Ensure no network access is done
+    configs.append(("offline", "true"))
+    configs.append(("proxy", "http://invalid"))
     # Configure the cache directory
     configs.append(("cache", d.getVar("NPM_CACHE")))
     return configs