From 1133f3ab485031df6e107f826b7398e5133f9c4d Mon Sep 17 00:00:00 2001 From: Jean-Marie LEMETAYER Date: Fri, 24 Jan 2020 18:07:32 +0100 Subject: [PATCH] classes/npm: restrict the build to be offline 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 Signed-off-by: Richard Purdie --- meta/classes/npm.bbclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 799b2a3829..cf2c12047e 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass @@ -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 -- 2.40.1