From b2bc106f09753179f63d8e7ebb7a43ddead5d44d Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Tue, 3 Mar 2020 14:40:41 +0000 Subject: [PATCH] Use node12 for dashboard build Node12 is the current LTS version, so the build is now being done with that version. Namespace set to functions/ for the dashboard. Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- dashboard/Makefile | 2 +- dashboard/of-cloud-dashboard/handler.js | 7 +++---- dashboard/stack.yml | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dashboard/Makefile b/dashboard/Makefile index 5b5d7d450..e35608943 100644 --- a/dashboard/Makefile +++ b/dashboard/Makefile @@ -1,4 +1,4 @@ .PHONY: build build: - ( docker run -v $(shell pwd):/dashboard node:10.16.3-alpine /bin/sh -c "cd dashboard/client && yarn && yarn build") + ( docker run -v $(shell pwd):/dashboard node:12-alpine /bin/sh -c "cd dashboard/client && yarn && yarn build") diff --git a/dashboard/of-cloud-dashboard/handler.js b/dashboard/of-cloud-dashboard/handler.js index 4f8fad3ee..2c26f0ffb 100644 --- a/dashboard/of-cloud-dashboard/handler.js +++ b/dashboard/of-cloud-dashboard/handler.js @@ -24,7 +24,7 @@ module.exports = async (event, context) => { // See if a user is trying to query functions they do not have permissions to view if (!isResourceInTokenClaims(path, query, decodedCookie, organizations)) { - console.log("the user '" + decodedCookie["sub"] + "' tried to access a resource they are not entitled to") + console.log("The user '" + decodedCookie["sub"] + "' tried to access a resource they are not entitled to") return context.status(403).succeed('Forbidden'); } @@ -50,15 +50,14 @@ module.exports = async (event, context) => { let res = await axios(opts) let ctx = context; - // Print to stderr to match the of-watchdog output - console.error(`${method} ${upstreamURL} - ${res.status}`); + console.log(`${method} ${upstreamURL} - ${res.status}`); return ctx.status(res.status) .headers(res.headers) .succeed(res.data); } catch(err) { - console.error(`${method} ${upstreamURL} - 500, error: ${err}`); + console.log(`${method} ${upstreamURL} - 500, error: ${err}`); return context.status(500).fail('Proxy request failed'); } } diff --git a/dashboard/stack.yml b/dashboard/stack.yml index d08935302..cf72ee8ef 100644 --- a/dashboard/stack.yml +++ b/dashboard/stack.yml @@ -6,7 +6,7 @@ functions: system-dashboard: lang: node12 handler: ./of-cloud-dashboard - image: alexellis2/of-cloud-dashboard:0.7.18 + image: functions/of-cloud-dashboard:0.8.0 labels: openfaas-cloud: "1" role: openfaas-system