Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Commit

Permalink
Use node12 for dashboard build
Browse files Browse the repository at this point in the history
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) <[email protected]>
  • Loading branch information
alexellis committed Mar 3, 2020
1 parent df9c040 commit b2bc106
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dashboard/Makefile
Original file line number Diff line number Diff line change
@@ -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")
7 changes: 3 additions & 4 deletions dashboard/of-cloud-dashboard/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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');
}
}
Expand Down
2 changes: 1 addition & 1 deletion dashboard/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2bc106

Please sign in to comment.