diff --git a/Dockerfile b/Dockerfile index 67876d05bf57addb564b5e6c48622c12719ef1ab..aca325b24a9453e4d83ab7681c2a44df2922f084 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,14 @@ FROM node:10 as builder ARG BACKEND_URL ENV BACKEND_URL=$BACKEND_URL +ARG USE_LOGO +ENV USE_LOGO=${USE_LOGO:-hbp} + COPY . /iv WORKDIR /iv ENV VERSION=devNext -RUN apt update && apt upgrade -y && apt install brotli - RUN npm i RUN npm run build-aot diff --git a/deploy/app.js b/deploy/app.js index a37dd55b345fff1878b6990e79610161a7a4bee3..0ed432976788a6483304554a9aa909081a44eae5 100644 --- a/deploy/app.js +++ b/deploy/app.js @@ -53,7 +53,12 @@ app.use(session({ /** * configure CSP */ -require('./csp')(app) +if (process.env.DISABLE_CSP && process.env.DISABLE_CSP === 'true') { + console.warn(`DISABLE_CSP is set to true, csp will not be enabled`) +} else { + require('./csp')(app) +} + /** * configure Auth diff --git a/deploy/datasets/query.js b/deploy/datasets/query.js index 0c057bfa8dd4b997ba67f17ba72d636bf7d77b52..2c9d962aa4ca802712048a6941cd9fcb3a69ead0 100644 --- a/deploy/datasets/query.js +++ b/deploy/datasets/query.js @@ -15,7 +15,10 @@ fs.readFile(CACHE_DATASET_FILENAME, 'utf-8', (err, data) => { /** * the file may or may not be present on init */ - if (err) return + if (err) { + console.warn(`read cache failed`, err) + return + } try { cachedData = JSON.parse(data)