From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH v4] embed background image in redirect template Date: Mon, 27 Aug 2018 17:24:37 +0200 Message-ID: <1673e2ac-3f2d-8e4e-1932-3475100e5519@link38.eu> In-Reply-To: <53963aa7a6dd33e84c3fbeef9e0cf7a38703a959.camel@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1200675706736083917==" List-Id: --===============1200675706736083917== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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, second and third version of this patch and has been successfully tested during a clean build. Fixes #11650 Signed-off-by: Peter M=C3=BCller --- 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/re= direct-templates/legacy/template.html index b5fb61ebe..297561e3a 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 0c5688252..f3367713a 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 =20 + # Add base64 encoded background image to Squid content access page + basedata=3D"$$( 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 \ --=20 2.16.4 --===============1200675706736083917== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUVCQ2dBZEZpRUV2UDRTaUdoRVlE SnlyUkxrMlVqeUQzMTduMmdGQWx1RUY3MEFDZ2tRMlVqeUQzMTcKbjJpVDN4QUFyUi9oUE5oOG50 TlRTZTRJMFMxRjNxOTMzdzdsdXVoMmZaVjM4TEVLVHRiM3pXak5ubHMrTlpUUApxb0E0QUs0b3lV QVdIZ1ZKMWdTbEV3eVpFVzBudm15ZHpUcGZaVXBaRDd3MnN2OEgrWEY4NE5vL3dBMzVOcnkzCnd1 eFBKejlob2pkaUUzQTVIZ2c5eTVORE1rcnNsaXRGR255RVU0QXNmdDB3MXRDTTVISEtOMTM0VDMw a29FeDAKdkpwRDNNTjlZZGtGS1dJbFZNSVd4b0NCaDFkUHpIRzFvV1VHUm5mOHZmTlFUdmVXWEk3 WExZb2pFZkRoTGx6RwpuU2FPMFBQdit0a2dWZlhUVzRCaGwrTk9LS0Vna2wvOFV2M0dmY2xMQnVV UmVvc1RKWWhTZmE4RStTYUZvTjBTClFFVTlxUWE0ekZ4NzI3YUJCcElmOWNybDJSKzgvUXM3NGFS QittQzR3MFlMUC9wQTJtMmFBWTg1bytkQ0c2Z3cKbmxwVDBjZ3grM3pWQy9WM3gvbU1pYUtQVjRL VExhcVk1VFZNNllpRjBySmFwL3NPQno3U0VUMnVJSnJJaEc0eQpyYzVaVmdRLzJJYzZ3WkZjYi93 WmloQm80Z3lHOVRzU09BeGtKR2R3aHFrQnowdVB2TFo5Z3I5cFY0MUdMWGdOCkwzQ0wybXZ0UGlD bk5FUHNOZC9IdkVldkplZmdmaHVvVmR2MTFkOWZkY1c3bzBOZTVtTnJjeGIwVVVZOWZBdGsKL2VU aFJHQjlZSFpGbkZzU3dSQVd0MllFUGdhZUxjaXdablRNVkFRMnZucWVzMlVGL2Z2ZDdTV05OcXJ3 bEI2UQpscWNJbVN2ZWVzVnJCU1pTMWNPWCtxYkJoOTNZNWNCRTQ0bkNUMFNTUHpMY085RlZwZzA9 Cj1ieXNuCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQo= --===============1200675706736083917==--