From b67e79a4f15bcb8f2e9d525169d9c51611fe6c7e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20M=C3=BCller?= Date: Mon, 10 Sep 2018 16:15:44 +0200 Subject: [PATCH] embed background image in redirect template MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Embed the IPFire background image into the redirect template directly via CSS instead of loading it from somewhere else. This is necessary because of Content Security Policy (CSP). This patch inserts the base64 encoded image during build so nothing needs to be updated twice in case background image changes. It supersedes first to fourth version of this patch and has been successfully tested during a clean build. Fixes #11650 Signed-off-by: Peter Müller Signed-off-by: Michael Tremer --- html/html/redirect-templates/legacy/template.html | 7 ++++++- lfs/web-user-interface | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/html/html/redirect-templates/legacy/template.html b/html/html/redirect-templates/legacy/template.html index b5fb61ebe0..297561e3a7 100644 --- a/html/html/redirect-templates/legacy/template.html +++ b/html/html/redirect-templates/legacy/template.html @@ -3,11 +3,16 @@ ACCESS MESSAGE + -
/images/background.gif"> +  
diff --git a/lfs/web-user-interface b/lfs/web-user-interface index 0c56882523..73aec3a8d4 100644 --- a/lfs/web-user-interface +++ b/lfs/web-user-interface @@ -55,6 +55,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) mkdir -p /var/updatecache/{download,metadata} cp -aR $(DIR_SRC)/html/* /srv/web/ipfire + # Add base64 encoded background image to Squid content access page + basedata="$$( base64 $(DIR_SRC)/html/html/images/background.gif | tr -d '\n' )"; \ + sed -i "s|IMAGEDATAPLACEHOLDER|$${basedata}|g" \ + /srv/web/ipfire/html/redirect-templates/legacy/template.html + # Change CONFIG_ROOT in cgi-scripts for i in /srv/web/ipfire/cgi-bin/{*,logs.cgi/*,vpn.cgi/*}; do \ if [ -f $$i ]; then \ -- 2.39.5