From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: development@lists.ipfire.org Subject: Re: [PATCH v3] embed background image in redirect template Date: Mon, 27 Aug 2018 17:46:44 +0200 Message-ID: <221742c1-9f16-e510-56a8-f6a1260b3e3a@link38.eu> In-Reply-To: <53963aa7a6dd33e84c3fbeef9e0cf7a38703a959.camel@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1777394144205620798==" List-Id: --===============1777394144205620798== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, > Hi, >=20 > On Sun, 2018-08-26 at 21:15 +0200, Peter M=C3=BCller wrote: >> 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). >=20 >> This patch inserts the base64 encoded image during build so >> nothing needs to be updated twice in case background image >> changes. >=20 >> It supersedes first and second version of this patch and has >> been successfully tested during a clean build. >=20 >> Fixes #11650 >=20 >> 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(-) >=20 >> diff --git a/html/html/redirect-templates/legacy/template.html >> b/html/html/redirect-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 @@ >> >> > 8">=20 >> ACCESS MESSAGE >> + >> >> >> >> >> - >> >>
> align=3D"center" background=3D"/images/backgrou= nd.gif"> >> + > align=3D"center" class=3D"image"> 
>> > width=3D'80%'> >> 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 >> + >=20 > ${DIR_SRC} should be $(DIR_SRC) in order to be expanded from the Makefile a= nd > not from the shell environment. Sorry about this - fixed in v4, although it worked. >=20 > I am not even sure if DIR_SRC is guaranteed to be set. I must say, using shell commands in LFS files is somewhat tricky... Best regards, Peter M=C3=BCller >=20 >> # Change CONFIG_ROOT in cgi-scripts >> for i in /srv/web/ipfire/cgi-bin/{*,logs.cgi/*,vpn.cgi/*}; do \ >> if [ -f $$i ]; then \ >=20 --=20 Microsoft DNS service terminates abnormally when it recieves a response to a DNS query that was never made. Fix Information: Run your DNS service on a different platform. -- bugtraq --===============1777394144205620798==--