Author: manuel Date: 2005-07-22 05:50:14 -0600 (Fri, 22 Jul 2005) New Revision: 6568
Added: trunk/BOOK/obfuscate.sh Modified: trunk/BOOK/Makefile trunk/BOOK/chapter01/changelog.xml trunk/BOOK/general.ent Log: Added obfuscate.sh to test it in production mode. Modified: trunk/BOOK/Makefile =================================================================== --- trunk/BOOK/Makefile 2005-07-21 20:33:42 UTC (rev 6567) +++ trunk/BOOK/Makefile 2005-07-22 11:50:14 UTC (rev 6568) @@ -25,6 +25,10 @@ *.html for filename in `find $(BASEDIR) -name "*.html"`; do \ + sh obfuscate.sh $$filename; \ + done; + + for filename in `find $(BASEDIR) -name "*.html"`; do \ tidy -config tidy.conf $$filename; \ true; \ done; @@ -56,6 +60,8 @@ --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \ stylesheets/lfs-nochunks.xsl index.xml + sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT) + tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true sed -i -e "[EMAIL PROTECTED]/[EMAIL PROTECTED]/[EMAIL PROTECTED]" \ Modified: trunk/BOOK/chapter01/changelog.xml =================================================================== --- trunk/BOOK/chapter01/changelog.xml 2005-07-21 20:33:42 UTC (rev 6567) +++ trunk/BOOK/chapter01/changelog.xml 2005-07-22 11:50:14 UTC (rev 6568) @@ -94,7 +94,7 @@ <listitem><para>&perl-libc-patch;</para></listitem> </itemizedlist> </listitem> - + <listitem><para>Removed:</para> <itemizedlist> <listitem><para>gcc-3.4.3-linkonce-1.patch</para></listitem> @@ -107,6 +107,9 @@ </itemizedlist> </listitem> +<listitem><para>July 22th, 2005 [manuel]: Added obfuscate.sh and modified the +Makefile to obfuscate e-mail addresses in XHTML output.</para></listitem> + <listitem><para>July 19th, 2005 [matt]: Removed flex++ from the list of installed files, as it is no longer present (Randy McMurchy)</para></listitem> <listitem><para>July 15th, 2005 [matt]: Updated to Linux-2.6.12.3.</para></listitem> @@ -601,7 +604,7 @@ <listitem><para>December 22, 2004 [manuel]: Readded to chapter09/reboot.xml a para lost from version 5.1.</para></listitem> -<listitem><para>December 20, 2004 [manuel]: Made grub's configuration location +<listitem><para>December 20, 2004 [manuel]: Made grub's configuration location FHS compliant.</para></listitem> <listitem><para>December 19, 2004 [manuel]: Added the irc.lfs-matrix.de IRC server.</para></listitem> Modified: trunk/BOOK/general.ent =================================================================== --- trunk/BOOK/general.ent 2005-07-21 20:33:42 UTC (rev 6567) +++ trunk/BOOK/general.ent 2005-07-22 11:50:14 UTC (rev 6568) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<!ENTITY version "SVN-20050721"> -<!ENTITY releasedate "July 21, 2005"> +<!ENTITY version "SVN-20050722"> +<!ENTITY releasedate "July 22, 2005"> <!ENTITY milestone "6.2"> <!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" --> Added: trunk/BOOK/obfuscate.sh =================================================================== --- trunk/BOOK/obfuscate.sh 2005-07-21 20:33:42 UTC (rev 6567) +++ trunk/BOOK/obfuscate.sh 2005-07-22 11:50:14 UTC (rev 6568) @@ -0,0 +1,35 @@ +#!/bin/bash + +# obfuscate.sh +# obfuscate email addresses in XML/HTML +# Script written (and slight perl modification) by Archaic <archaic AT linuxfromscratch D0T org> +# Original Perl expression by Anderson Lizardo <lizardo AT linuxfromscratch D0T org> +# Released under the GNU General Public License +# +# This script currently only seeks out mailto: addresses. If those same +# addresses also appear in plaintext, we need to obfuscate those as well. +# +# This script was made for a very specific purpose so I was a bit lazy in +# writing the regex's. +# +# Please send comments, enhancements, etc. to the above address + +#set -e # Bail on all errors + +# First, ensure that we are given a file to process +# if [ $# -lt 1 ]; then +# echo -e "\nYou must provide an input file." +# exit 1 +# fi + +# Nothing like a backup plan! +#cp "$1" "$1".bak + +for i in `grep -o '"mailto:[EMAIL PROTECTED]"' "$1" |sed -e 's|^"mailto:||' -e 's|"$||'`; do + link=`echo $i | perl -pe 's/[^\n]/"\\\&#".ord($&)."\;"/ge'` + plaintext=`echo $i | sed -e 's|@| AT |' -e 's|\.| D0T |g'` + sed -i "s|mailto:$i|mailto:$link|" "$1" + sed -i "s|$i|$plaintext|" "$1" +done + +#exit 0 Property changes on: trunk/BOOK/obfuscate.sh ___________________________________________________________________ Name: svn:keywords + "Author Date Revision Id" -- http://linuxfromscratch.org/mailman/listinfo/lfs-book FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page