From: Peter Müller Date: Mon, 10 Sep 2018 14:15:44 +0000 (+0200) Subject: embed background image in redirect template X-Git-Tag: v2.21-core124~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b67e79a4f15bcb8f2e9d525169d9c51611fe6c7e;p=ipfire-2.x.git embed background image in redirect template 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 --- 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 \