diff --git a/CHANGELOG.md b/CHANGELOG.md index a6bd716..68ecc02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v1.26.1-8] - 2024-09-04 +### Fixed +- Fix problems with content security policies (CSP) caused by whitelabeling + ## [v1.26.1-7] - 2024-08-29 ### Changed - Update warp menu to v2.0.0 (#104) diff --git a/Dockerfile b/Dockerfile index 6fc8d27..a344812 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,11 +60,11 @@ RUN wget --progress=bar:force:noscroll -O /tmp/theme.zip https://github.com/clou FROM registry.cloudogu.com/official/base:3.20.2-1 LABEL maintainer="hello@cloudogu.com" \ NAME="official/nginx" \ - VERSION="1.26.1-7" + VERSION="1.26.1-8" ENV CES_MAINTENANCE_MODE=false \ # Used in template to invalidate caches - do not remove. The release script will auto update this line - VERSION="1.26.1-7" + VERSION="1.26.1-8" RUN set -x -o errexit \ && set -o nounset \ diff --git a/dogu.json b/dogu.json index 863989c..e7ea070 100644 --- a/dogu.json +++ b/dogu.json @@ -1,6 +1,6 @@ { "Name": "official/nginx", - "Version": "1.26.1-7", + "Version": "1.26.1-8", "DisplayName": "Nginx", "Description": "Nginx WebServer.", "Logo": "https://cloudogu.com/images/dogus/nginx.png", diff --git a/resources/etc/ces-confd/templates/app.conf.tpl b/resources/etc/ces-confd/templates/app.conf.tpl index bce0cc7..c6cd879 100644 --- a/resources/etc/ces-confd/templates/app.conf.tpl +++ b/resources/etc/ces-confd/templates/app.conf.tpl @@ -2,6 +2,7 @@ server { include /etc/nginx/include.d/ssl.conf; include /etc/nginx/include.d/errors.conf; include /etc/nginx/include.d/warp.conf; + include /etc/nginx/include.d/whitelabel.conf; include /etc/nginx/include.d/robots.conf; include /etc/nginx/app.conf.d/*.conf; diff --git a/resources/etc/nginx/include.d/subfilters.conf.tpl b/resources/etc/nginx/include.d/subfilters.conf.tpl index 47361b1..fd25dd8 100644 --- a/resources/etc/nginx/include.d/subfilters.conf.tpl +++ b/resources/etc/nginx/include.d/subfilters.conf.tpl @@ -1,5 +1,5 @@ # warp menu -set $scripts ''; +set $scripts ''; # Include google analytics scripts if a tracking id is set {{ if .Config.Exists "google_tracking_id" }} @@ -12,7 +12,7 @@ set $scripts '$scripts '; # html-head filters -set $whitelabelClassScript ''; +set $whitelabelClassScript ''; set $whitelabelStyles ''; # add closing head-tag diff --git a/resources/etc/nginx/include.d/whitelabel.conf b/resources/etc/nginx/include.d/whitelabel.conf new file mode 100644 index 0000000..7b03879 --- /dev/null +++ b/resources/etc/nginx/include.d/whitelabel.conf @@ -0,0 +1,4 @@ +# whitelabel js +location /whitelabeljs { + root /var/www/html; +} \ No newline at end of file diff --git a/resources/var/www/html/warpmenu/add-warp-menu.js.tpl b/resources/var/www/html/warpmenu/add-warp-menu.js.tpl index 6a8b408..136d7a1 100644 --- a/resources/var/www/html/warpmenu/add-warp-menu.js.tpl +++ b/resources/var/www/html/warpmenu/add-warp-menu.js.tpl @@ -4,14 +4,12 @@ const addWarpMenu = function(){ // Update this version whenever warp menu is updated warpScript.src = "/warp/warp.js?nginx={{ .Env.Get "VERSION"}}"; - const urlScript = document.createElement("script"); - // This variable is used inside the warp menu script - // Update this version whenever warp menu is updated - urlScript.innerHTML = 'const cesWarpMenuWarpCssUrl = "/warp/warp.css?nginx={{ .Env.Get "VERSION"}}";'; const firstScriptTag = document.getElementsByTagName("script")[0]; - firstScriptTag.parentNode.insertBefore(urlScript, firstScriptTag); firstScriptTag.parentNode.insertBefore(warpScript, firstScriptTag); } +// This variable is used inside the warp menu script +// Update this version whenever warp menu is updated +const cesWarpMenuWarpCssUrl = "/warp/warp.css?nginx={{ .Env.Get "VERSION"}}"; addWarpMenu(); \ No newline at end of file diff --git a/resources/var/www/html/whitelabeljs/add-whitelabeling.js b/resources/var/www/html/whitelabeljs/add-whitelabeling.js new file mode 100644 index 0000000..70dba86 --- /dev/null +++ b/resources/var/www/html/whitelabeljs/add-whitelabeling.js @@ -0,0 +1 @@ +document.documentElement.classList.add("ces-whitelabel"); \ No newline at end of file