From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH v3] embed background image in redirect template Date: Mon, 27 Aug 2018 07:37:12 +0100 Message-ID: <53963aa7a6dd33e84c3fbeef9e0cf7a38703a959.camel@ipfire.org> In-Reply-To: <40ee64c6-91d2-802d-8f2d-61c345f0a2c3@link38.eu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7821700452575801387==" List-Id: --===============7821700452575801387== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi, On Sun, 2018-08-26 at 21:15 +0200, Peter Müller 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). > > This patch inserts the base64 encoded image during build so > nothing needs to be updated twice in case background image > changes. > > It supersedes first and second version of this patch and has > been successfully tested during a clean build. > > Fixes #11650 > > Signed-off-by: Peter Müller > --- > 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 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 > + > > > > > - > >
align="center" background="/images/background.gif"> > + align="center" class="image"> 
> width='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 > > + # 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 > + ${DIR_SRC} should be $(DIR_SRC) in order to be expanded from the Makefile and not from the shell environment. I am not even sure if DIR_SRC is guaranteed to be set. > # Change CONFIG_ROOT in cgi-scripts > for i in /srv/web/ipfire/cgi-bin/{*,logs.cgi/*,vpn.cgi/*}; do \ > if [ -f $$i ]; then \ -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE5/rW5l3GGe2ypktxgHnw/2+QCQcFAluDnBgACgkQgHnw/2+Q CQc3iw/6A0zu4FLjp8XmNBgjZYxz3jfR6Js2wUQHkIRmuPqt6+RACNOsyHdeC58P NPlIQpxwcPqXLzRlFRThGCBIXyER3ezs+4xWIFPQ/60yFYZwLGevKGYLtynCYPFv Lmg+hc/zEnDsj0e+faocMr3yh1QtbVC8tNB/Q61kVRvMT3a4qIc0zAc01zLg15Hn +av8SbW90p6cyzdd1AAYlql98vkh0K/S94TW5pBzN/NEADjvZXLQn+Ch89ibZfR3 VDDOsO0ETCPCvOO6us2YzuTvdCGvN1CCfaFgLZZ++lr4LMUW33T829Ssp6vEupLT eJnUEE+J0NhTTACqeNUxbJ2Tv2K6H/5LsiYWwlZUiznXBaYiPBWbXeNucn2M+w7Y nnfu/p3XISkQdXQHozsCVjkNtrFJF6YDex4HIx5RDdgNPz6K+0IfaEcxqqMFIVvg dYajrnl18iP/Zlc5mzIzAaFIvVygK3LJmDUEGyeHXcYX00LmtzoWqiCd8WQnsFCW 8LXraT7Fekg5pDibrMWVCXOYSxce+++eDVzet7HKwM97SJeTkBw2F0cQ3dDnpE5C cbrf93xHdoMdDoxu1RYoVQ9ZZLOCf8owOwvagesQXL6R/y4Ihm9Cqg0qDwFv+aFc c7tBHuKmkE16WI4WI5uAWVISh/gAj/hjRLBF6+qHivqn20mvCbI= =2yOA -----END PGP SIGNATURE----- --===============7821700452575801387==--