Merge remote-tracking branch 'origin/main'

This commit is contained in:
Samuel Philipp 2021-10-28 18:31:02 +02:00
commit c3b96e18e9
3 changed files with 9 additions and 7 deletions

View file

@ -1,10 +1,6 @@
ARG ARCH
FROM alpine:3.14.2@sha256:e1c082e3d3c45cccac829840a25941e679c25d438cc8412c2fa221cf1a824e6a AS base-amd64
FROM arm32v7/alpine:3.14.2@sha256:e12ff876f0075740ed3d7bdf788107ae84c1b3dd6dc98b3baea41088aba5236f AS base-arm
FROM arm64v8/alpine:3.14.2@sha256:b06a5cf61b2956088722c4f1b9a6f71dfe95f0b1fe285d44195452b8a1627de7 AS base-arm64
FROM base-${ARCH}
FROM alpine:3.14.2@sha256:e1c082e3d3c45cccac829840a25941e679c25d438cc8412c2fa221cf1a824e6a
RUN apk --no-cache add nodejs="12.22.6-r0"
RUN apk --no-cache add nodejs="14.18.1-r0"
COPY dist/universal-statuspage /universal-statuspage

View file

@ -30,7 +30,7 @@
"@nguniversal/express-engine": "^12.1.0",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@types/node-cron": "^2.0.4",
"@types/node-cron": "^2.0.5",
"bootstrap": "^4.6.0",
"cron": "^1.8.2",
"dayjs": "^1.10.7",

View file

@ -79,6 +79,12 @@ api.post('/update/health', (req, res) => {
return res.status(401).send('invalid token');
}
const serviceId = req.query.service as string;
if (!config.groups
.map(g => g.services).reduce((x, y) => x.concat(y), [])
.map(s => s.id).includes(serviceId)) {
// TODO remove old caches
return res.send('OK');
}
let services: { id: string, state: string }[] = [];
if (serviceId) {
services = [{id: serviceId, state: JSONPath({path: serviceStatePaths[serviceId], json: req.body, wrap: false})}];