Skip to content

Commit

Permalink
fix: ignore config-json in pr- deployments (#2550)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwwinter authored Aug 30, 2024
1 parent 03d854c commit b81c25b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 4 additions & 5 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ COPY ./build/default.conf /etc/nginx/templates/default.conf
COPY --from=dist /dist/ /usr/share/nginx/html

# The port on which the app will run in the Docker container
ENV PORT=80
ENV PORT=8080
# The url to the CouchDB database
ENV COUCHDB_URL="http://localhost"
# The url to the query backend, see https://github.com/Aam-Digital/query-backend
Expand All @@ -137,10 +137,9 @@ ENV CSP_REPORT_URI="https://o167951.ingest.sentry.io/api/1242399/security/"
# overwrite the Content-Security-Policy rules (report-uri is added automatically)
# default includes all required whitelists for production server
# to disable any CSP blocking, set to "default-src * data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval'"
ENV CSP="default-src 'self' 'unsafe-eval' data: blob: https://*.tile.openstreetmap.org/ https://matomo.aam-digital.org https://*.aam-digital.com https://api.github.com/repos/Aam-Digital/ https://sentry.io $CSP_REPORT_URI; style-src 'self' 'unsafe-inline'"
ENV CSP="default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: https://*.tile.openstreetmap.org/ https://matomo.aam-digital.org https://*.aam-digital.com https://*.aam-digital.net https://*.aam-digital.app https://api.github.com/repos/Aam-Digital/ https://sentry.io $CSP_REPORT_URI; style-src 'self' 'unsafe-inline'"
# 'unsafe-eval' required for pouchdb https://github.com/pouchdb/pouchdb/issues/7853#issuecomment-535020600

# variables are inserted into the nginx config
RUN envsubst '$$PORT $$COUCHDB_URL $$QUERY_URL $$NOMINATIM_URL $$CSP $$CSP_REPORT_URI' < /etc/nginx/templates/default.conf > /etc/nginx/conf.d/default.conf

CMD ["nginx", "-g", "daemon off;"]
CMD envsubst '$$PORT $$COUCHDB_URL $$QUERY_URL $$NOMINATIM_URL $$CSP $$CSP_REPORT_URI' < /etc/nginx/templates/default.conf > /etc/nginx/conf.d/default.conf &&\

Check warning on line 144 in build/Dockerfile

View workflow job for this annotation

GitHub Actions / build (linux/amd64, ubuntu-latest)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 144 in build/Dockerfile

View workflow job for this annotation

GitHub Actions / build (linux/arm64, self-hosted, Linux, ARM64)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 144 in build/Dockerfile

View workflow job for this annotation

GitHub Actions / build (linux/amd64, ubuntu-latest)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 144 in build/Dockerfile

View workflow job for this annotation

GitHub Actions / build (linux/arm64, self-hosted, Linux, ARM64)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
nginx -g 'daemon off;'
1 change: 1 addition & 0 deletions src/bootstrap-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export async function initEnvironmentConfig() {
} catch (err) {
if (
!environment.production ||
environment.appVersion?.startsWith("pr-") ||
environment.appVersion === "UNKNOWN" ||
environment.appVersion === "0.0.0"
) {
Expand Down

0 comments on commit b81c25b

Please sign in to comment.