diff --git a/docker/images/Dockerfile.frontend b/docker/images/Dockerfile.frontend index a134f15f27..6565e519c1 100644 --- a/docker/images/Dockerfile.frontend +++ b/docker/images/Dockerfile.frontend @@ -27,7 +27,7 @@ COPY ./files/nginx.conf.template /tmp/nginx.conf.template COPY ./files/nginx-resolvers.conf.template /tmp/resolvers.conf.template COPY ./files/nginx-admin-console-locations.conf.template /tmp/nginx-admin-console-locations.conf.template COPY ./files/nginx-mcp-locations.conf.template /tmp/nginx-mcp-locations.conf.template -COPY ./files/nginx-security-headers.conf /etc/nginx/nginx-security-headers.conf +COPY ./files/nginx-security-headers.conf.template /tmp/nginx-security-headers.conf.template COPY ./files/nginx-mime.types /etc/nginx/mime.types COPY ./files/nginx-external-locations.conf /etc/nginx/overrides/location.d/external-locations.conf COPY ./files/nginx-entrypoint.sh /entrypoint.sh diff --git a/docker/images/files/nginx-entrypoint.sh b/docker/images/files/nginx-entrypoint.sh index 47a8a5544b..336f8f397e 100644 --- a/docker/images/files/nginx-entrypoint.sh +++ b/docker/images/files/nginx-entrypoint.sh @@ -84,4 +84,59 @@ export PENPOT_INTERNAL_RESOLVER=${PENPOT_INTERNAL_RESOLVER:-$PENPOT_DEFAULT_INTE envsubst "\$PENPOT_INTERNAL_RESOLVER" \ < /tmp/resolvers.conf.template > /etc/nginx/overrides/http.d/resolvers.conf +######################################### +## Security Headers Config +######################################### + +# The default policy describes what a stock Penpot deployment actually +# needs: 'wasm-unsafe-eval' for the render engine, 'unsafe-inline' styles +# for the inline style attributes emitted by the UI, and blob:/data: for +# thumbnails, exports and font handling. Everything else is same-origin, +# because the Google Fonts and GitHub templates endpoints are reverse +# proxied by this very server. +# +# It ships in report-only mode: the inline