1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
3 File : $Source: /cvsroot/ijbswa/current/doc/source/user-manual.sgml,v $
7 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
9 $Id: user-manual.sgml,v 1.44 2002/03/09 17:08:48 hal9 Exp $
11 Written by and Copyright (C) 2001 the SourceForge
12 IJBSWA team. http://ijbswa.sourceforge.net
14 Based on the Internet Junkbuster originally written
15 by and Copyright (C) 1997 Anonymous Coders and
16 Junkbusters Corporation. http://www.junkbusters.com
20 Sat 03/02/02 04:53:47 PM
22 This should be ready for BETA release.
24 Hal Burgiss <hal@foobox.net>
29 <title>Junkbuster User Manual</title>
31 <pubdate>$Id: user-manual.sgml,v 1.44 2002/03/09 17:08:48 hal9 Exp $</pubdate>
36 <orgname>By: Junkbuster Developers</orgname>
43 The user manual gives users information on how to install, configure
44 and use <application>Internet Junkbuster</application>.
45 <application>Internet Junkbuster</application> is an application that
46 provides privacy and security to users of the World Wide Web.
49 You can find the latest version of the user manual at <ulink url="http://ijbswa.sourceforge.net/user-manual/">http://ijbswa.sourceforge.net/user-manual/</ulink>.
53 Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>.
60 <!-- ~~~~~ New section ~~~~~ -->
62 <sect1 id="introduction"><title>Introduction</title>
64 <application>Internet Junkbuster</application> is a web proxy with advanced
65 filtering capabilities for protecting privacy, filtering and modifying web
66 page content, managing cookies, controlling access, and removing ads,
67 banners, pop-ups and other obnoxious Internet Junk.
68 <application>Junkbuster</application> has a very flexible configuration and
69 can be customized to suit individual needs and tastes. <application>Internet
70 Junkbuster</application> has application for both stand-alone systems and
75 This documentation is included with the current BETA version of
76 <application>Internet Junkbuster</application> and is mostly complete at this
77 point. The most up to date reference for the time being is still the comments
78 in the source files and in the individual configuration files. Development
79 of version 3.0 is currently nearing completion, and includes many significant
80 changes and enhancements over earlier versions. The target release date for
81 stable v3.0 is <quote>soon</quote> ;-)
85 Since this is a BETA version, not all new features are well tested. This
86 documentation may be slightly out of sync as a result (especially with
87 CVS sources). And there <emphasis>may be</emphasis> bugs, though hopefully
92 <!-- ~~~~~ New section ~~~~~ -->
94 <title>New Features</title>
96 In addition to <application>Junkbuster's</application> traditional features
97 of ad and banner blocking and cookie management, this is a list of new
98 features currently under development:
106 Integrated browser based configuration and control utility (<ulink
107 url="http://i.j.b">http://i.j.b</ulink>). Browser-based tracing of rule
114 Modularized configuration that will allow for system wide settings, and
115 individual user settings. (not implemented yet, probably a 3.1 feature)
121 Blocking of annoying pop-up browser windows.
127 HTTP/1.1 compliant (most, but not all 1.1 features are supported).
133 Support for Perl Compatible Regular Expressions in the configuration files, and
134 generally a more sophisticated and flexible configuration syntax over
147 Web page content filtering (removes banners based on size,
148 invisible <quote>web-bugs</quote>, JavaScript, pop-ups, status bar abuse,
155 Bypass many click-tracking scripts (avoids script redirection).
162 Multi-threaded (POSIX and native threads).
168 Auto-detection and re-reading of config file changes.
174 User-customizable HTML templates (e.g. 404 error page).
180 Improved cookie management features (e.g. session based cookies).
186 Builds from source on most UNIX-like systems. Packages available for: Linux
187 (RedHat, SuSE, or Debian), Windows, Sun Solaris, Mac OSX, OS/2, HP-UX 11 and AmigaOS.
194 In addition, the configuration is much more powerful and versatile over-all.
205 <!-- ~ End section ~ -->
208 <!-- ~~~~~ New section ~~~~~ -->
209 <sect1 id="installation"><title>Installation</title>
211 <application>Junkbuster</application> is available as raw source code, or
212 pre-compiled binaries. See the <ulink
213 url="http://sourceforge.net/projects/ijbswa/">Junkbuster Home Page</ulink>
214 for binaries and current release info. <application>Junkbuster</application>
215 is also available via <ulink
216 url="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ijbswa/current/">CVS</ulink>.
217 This is the recommended approach at this time. But please be aware that CVS
218 is constantly changing, and it may break in mysterious ways.
221 <!-- ~~~~~ New section ~~~~~ -->
222 <sect2 id="installation-source"><title>Source</title>
224 For gzipped tar archives, unpack the source:
229 tar xzvf ijb_source_* [.tgz or .tar.gz]
230 cd ijb_source_2.9.11_beta
235 For retrieving the current CVS sources, you'll need the CVS
236 package installed first. To download CVS source:
241 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
242 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co current
248 This will create a directory named <filename>current/</filename>, which will
249 contain the source tree.
253 Then, in either case, to build from tarball/CVS source:
258 ./configure (--help to see options)
259 make (the make from gnu, gmake for *BSD)
261 make -n install (to see where all the files will go)
262 make install (to really install)
267 For Redhat and SuSE Linux RPM packages, see below.
273 <!-- ~~~~~ New section ~~~~~ -->
274 <sect2 id="installation-rh"><title>Red Hat</title>
276 To build Redhat RPM packages, install source as above. Then:
281 autoheader [suggested for CVS source]
282 autoconf [suggested for CVS source]
289 This will create both binary and src RPMs in the usual places. Example:
293 /usr/src/redhat/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
296 /usr/src/redhat/SRPMS/junkbuster-2.9.11-1.src.rpm
300 To install, of course:
305 rpm -Uvv /usr/src/redhat/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
310 This will place the <application>Junkbuster</application> configuration
311 files in <filename>/etc/junkbuster/</filename>, and log files in
312 <filename>/var/log/junkbuster/</filename>.
317 <!-- ~~~~~ New section ~~~~~ -->
318 <sect2 id="installation-suse"><title>SuSE</title>
320 To build SuSE RPM packages, install source as above. Then:
325 autoheader [suggested for CVS source]
326 autoconf [suggested for CVS source]
333 This will create both binary and src RPMs in the usual places. Example:
337 /usr/src/packages/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
340 /usr/src/packages/SRPMS/junkbuster-2.9.11-1.src.rpm
344 To install, of course:
349 rpm -Uvv /usr/src/packages/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
354 This will place the <application>Junkbuster</application> configuration
355 files in <filename>/etc/junkbuster/</filename>, and log files in
356 <filename>/var/log/junkbuster/</filename>.
362 <!-- ~~~~~ New section ~~~~~ -->
363 <sect2 id="installation-os2"><title>OS/2</title>
370 <application>Junkbuster</application> is packaged in a WarpIN self-
371 installing archive. The self-installing program will be named depending
372 on the release version, something like:
373 <filename>ijbos2_setup_1.2.3.exe</filename>. In order to install it, simply
374 run this executable or double-click on its icon and follow the WarpIN
375 installation panels. A shadow of the <application>Junkbuster</application>
376 executable will be placed in your startup folder so it will start
377 automatically whenever OS/2 starts.
381 The directory you choose to install <application>Junkbuster</application>
382 into will contain all of the configuration files.
386 If you would like to build binary images on OS/2 yourself, you will need
387 a few Unix-like tools: autoconf, autoheader and sh. These tools will be
388 used to create the required config.h file, which is not part of the
389 source distribution because it differs based on platform. You will also
391 The distribution has been created using IBM VisualAge compilers, but you
392 can use any compiler you like. GCC/EMX has the disadvantage of needing
393 to be single-threaded due to a limitation of EMX's implementation of the
394 select() socket call.
398 In addition to needing the source code distribution as outlined earlier,
399 you will want to extract the <filename>os2seutp</filename> directory from CVS:
401 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
402 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co os2setup
404 This will create a directory named os2setup/, which will contain the
405 <filename>Makefile.vac</filename> makefile and <filename>os2build.cmd</filename>
406 which is used to completely create the binary distribution. The sequence
407 of events for building the executable for yourself goes something like this:
414 nmake -f Makefile.vac
416 You will see this sequence laid out in <filename>os2build.cmd</filename>.
422 <!-- ~~~~~ New section ~~~~~ -->
423 <sect2 id="installation-win"><title>Windows</title>
424 <para>Click-click. (I need help on this. Not a clue here. Also for
425 configuration section below. HB.)
429 <!-- ~~~~~ New section ~~~~~ -->
430 <sect2 id="installation-other"><title>Other</title>
432 Some quick notes on other Operating Systems.
436 For FreeBSD (and other *BSDs?), the build will require <command>gmake</command>
437 instead of the included <command>make</command>. <command>gmake</command> is
438 available from <ulink url="http://www.gnu.org">http://www.gnu.org</ulink>.
439 The rest should be the same as above for Linux/Unix.
446 <!-- ~ End section ~ -->
449 <!-- ~~~~~ New section ~~~~~ -->
450 <sect1 id="configuration"><title>JunkBuster Configuration</title>
452 All <application>JunkBuster</application> configuration is kept
453 in text files. These files can be edited with a text editor.
454 Many important aspects of <application>JunkBuster</application> can
455 also be controlled easily with a web browser.
460 <!-- ~~~~~ New section ~~~~~ -->
463 <title>Controlling Junkbuster with Your Web Browser</title>
465 <application>JunkBuster</application> can be reached by the special
466 URL <ulink url="http://i.j.b/">http://i.j.b/</ulink> (or alternately
467 <ulink url="http://ijbswa.sourceforge.net/config/">http://ijbswa.sourceforge.net/config/</ulink>,
468 which is an internal page. You will see the following section:
475 Please choose from the following options:
477 * Show information about the current configuration
478 * Show the source code version numbers
479 * Show the client's request headers.
480 * Show which actions apply to a URL and why
481 * Toggle JunkBuster on or off
482 * Edit the actions list
488 This should be self-explanatory. Note the last item is an editor for the
489 <quote>actions list</quote>, which is where much of the ad, banner, cookie,
490 and URL blocking magic is configured as well as other advanced features of
491 <application>Junkbuster</application>. This is an easy way to adjust various
492 aspects of <application>Junkbuster</application> configuration. The actions
493 file, and other configuration files, are explained in detail below.
494 <application>Junkbuster</application> will automatically detect any changes
499 <quote>Toggle JunkBuster On or Off</quote> is handy for sites that might
500 have problems with your current actions and filters, or just to test if
501 a site misbehaves, whether it is <application>JunkBuster</application>
502 causing the problem or not. <application>Junkbuster</application> continues
503 to run as a proxy in this case, but all filtering is disabled.
509 <!-- ~ End section ~ -->
514 <!-- ~~~~~ New section ~~~~~ -->
517 <title>Configuration Files Overview</title>
519 For Unix, *BSD and Linux, all configuration files are located in
520 <filename>/etc/junkbuster/</filename> by default. For MS Windows, OS/2, and
521 AmigaOS these are all in the same directory as the
522 <application>Junkbuster</application> executable. The name and number of
523 configuration files has changed from previous versions, and is subject to
524 change as development progresses.
528 The installed defaults provide a reasonable starting point, though possibly
529 aggressive by some standards. For the time being, there are only three
530 default configuration files (this will change in time):
538 The main configuration file is named <filename>config</filename>
539 on Linux, Unix, BSD, OS/2, and AmigaOS and <filename>config.txt</filename>
546 The <filename>ijb.action</filename> file is used to define various
547 <quote>actions</quote> relating to images, banners, pop-ups, access
548 restrictions, banners and cookies. There is a CGI based editor for this
549 file that can be accessed via <ulink
550 url="http://i.j.b">http://i.j.b</ulink>. (Other actions
551 files are included as well with differing levels of filtering
552 and blocking, e.g. <filename>ijb-basic.action</filename>.)
558 The <filename>re_filterfile</filename> file can be used to rewrite the raw
559 page content, including text as well as embedded HTML and JavaScript.
567 <filename>ijb.action</filename> and <filename>re_filterfile</filename>
568 can use Perl style regular expressions for maximum flexibility. All files use
569 the <quote><literal>#</literal></quote> character to denote a comment. Such
570 lines are not processed by <application>Junkbuster</application>. After
571 making any changes, there is no need to restart
572 <application>Junkbuster</application> in order for the changes to take
573 effect. <application>Junkbuster</application> should detect such changes
578 While under development, the configuration content is subject to change.
579 The below documentation may not be accurate by the time you read this.
580 Also, what constitutes a <quote>default</quote> setting, may change, so
581 please check all your configuration files on important issues.
586 <!-- ~~~~~ New section ~~~~~ -->
589 <title>The Main Configuration File</title>
591 Again, the main configuration file is named <filename>config</filename> on
592 Linux/Unix/BSD and OS/2, and <filename>config.txt</filename> on Windows.
593 Configuration lines consist of an initial keyword followed by a list of
594 values, all separated by whitespace (any number of spaces or tabs). For
602 <emphasis>blockfile blocklist.ini</emphasis>
609 Indicates that the blockfile is named <quote>blocklist.ini</quote>.
613 A <quote><literal>#</literal></quote> indicates a comment. Any part of a
614 line following a <quote><literal>#</literal></quote> is ignored, except if
615 the <quote><literal>#</literal></quote> is preceded by a
616 <quote><literal>\</literal></quote>.
620 Thus, by placing a <quote><literal>#</literal></quote> at the start of an
621 existing configuration line, you can make it a comment and it will be treated
622 as if it weren't there. This is called <quote>commenting out</quote> an
623 option and can be useful to turn off features: If you comment out the
624 <quote>logfile</quote> line, <application>junkbuster</application> will not
625 log to a file at all. Watch for the <quote>default:</quote> section in each
626 explanation to see what happens if the option is left unset (or commented
631 Long lines can be continued on the next line by using a
632 <quote><literal>\</literal></quote> as the very last character.
636 There are various aspects of <application>Junkbuster</application> behavior
641 <!-- ~~~~~ New section ~~~~~ -->
644 <title>Defining Other Configuration Files</title>
647 <application>Junkbuster</application> can use a number of other files to tell it
648 what ads to block, what cookies to accept, etc. This section of the
649 configuration file tells <application>Junkbuster</application> where to find
650 all those other files.
654 On <application>Windows</application> and <application>AmigaOS</application>,
655 <application>Junkbuster</application> looks for these files in the same
656 directory as the executable. On Unix and OS/2,
657 <application>Junkbuster</application> looks for these files in the current
658 working directory. In either case, an absolute path name can be used to
663 When development goes modular and multi-user, the blocker, filter, and
664 per-user config will be stored in subdirectories of <quote>confdir</quote>.
665 For now, only <filename>confdir/templates</filename> is used for storing HTML
666 templates for CGI results.
670 The location of the configuration files:
677 <emphasis>confdir /etc/junkbuster</emphasis> # No trailing /, please.
684 The directory where all logging (i.e. <filename>logfile</filename> and
685 <filename>jarfile</filename>) takes place. No trailing
686 <quote><literal>/</literal></quote>, please:
693 <emphasis>logdir /var/log/junkbuster</emphasis>
700 Note that all file specifications below are relative to
701 the above two directories!
705 The <quote>ijb.action</quote> file contains patterns to specify the actions to
706 apply to requests for each site. Default: Cookies to and from all
707 destinations are kept only during the current browser session (i.e. they
708 are not saved to disk). Pop-ups are disabled for all sites. All sites are
709 filtered if <quote>re_filterfile</quote> specified according to the
710 contents of <quote>re_filterfile</quote>. No sites are blocked. The
711 JunkBuster logo is displayed for filtered ads and other images . The syntax
712 of this file is explained in detail <link
713 linkend="actionsfile">below</link>.
720 <emphasis>actionsfile ijb.action</emphasis>
727 The <quote>re_filterfile</quote> file contains content modification rules.
728 These rules permit powerful changes on the content of Web pages, e.g., you
729 could disable your favorite JavaScript annoyances, rewrite the actual
730 content, or just have some fun replacing <quote>Microsoft</quote> with
731 <quote>MicroSuck</quote> wherever it appears on a Web page. Default: No
732 content modification, or whatever the developers are playing with :-/
736 Filtering requires buffering the page content, which may appear to slow down
737 page rendering since nothing is displayed until all content has passed
738 the filters. (It does not really take longer, but seems that way since
739 the page is not incrementally displayed.) This effect will be more noticeable
740 on slower connections.
748 <emphasis>re_filterfile re_filterfile</emphasis>
755 The logfile is where all logging and error messages are written. The logfile
756 can be useful for tracking down a problem with
757 <application>Junkbuster</application> (e.g., it's not blocking an ad you
758 think it should block) but in most cases you probably will never look at it.
762 Your logfile will grow indefinitely, and you will probably want to
763 periodically remove it. On Unix systems, you can do this with a cron job
764 (see <quote>man cron</quote>). For Redhat, a <command>logrotate</command>
765 script has been included.
769 On SuSE Linux systems, you can place a line like <quote>/var/log/junkbuster.*
770 +1024k 644 nobody.nogroup</quote> in <filename>/etc/logfiles</filename>, with
771 the effect that cron.daily will automatically archive, gzip, and empty the
772 log, when it exceeds 1M size.
776 Default: Log to the a file named <filename>logfile</filename>.
777 Comment out to disable logging.
784 <emphasis>logfile logfile</emphasis>
791 The <quote>jarfile</quote> defines where
792 <application>Junkbuster</application> stores the cookies it intercepts. Note
793 that if you use a <quote>jarfile</quote>, it may grow quite large. Default:
794 Don't store intercepted cookies.
801 <emphasis>#jarfile jarfile</emphasis>
808 If you specify a <quote>trustfile</quote>,
809 <application>Junkbuster</application> will only allow access to sites that
810 are named in the trustfile. You can also mark sites as trusted referrers,
811 with the effect that access to untrusted sites will be granted, if a link
812 from a trusted referrer was used. The link target will then be added to the
813 <quote>trustfile</quote>. This is a very restrictive feature that typical
814 users most probably want to leave disabled. Default: Disabled, don't use the
822 <emphasis>#trustfile trust</emphasis>
829 If you use the trust mechanism, it is a good idea to write up some on-line
830 documentation about your blocking policy and to specify the URL(s) here. They
831 will appear on the page that your users receive when they try to access
832 untrusted content. Use multiple times for multiple URLs. Default: Don't
833 display links on the <quote>untrusted</quote> info page.
840 <emphasis>trust-info-url http://www.your-site.com/why_we_block.html</emphasis>
841 <emphasis>trust-info-url http://www.your-site.com/what_we_allow.html</emphasis>
849 <!-- ~ End section ~ -->
853 <!-- ~~~~~ New section ~~~~~ -->
856 <title>Other Configuration Options</title>
859 This part of the configuration file contains options that control how
860 <application>Junkbuster</application> operates.
864 <quote>Admin-address</quote> should be set to the email address of the proxy
865 administrator. It is used in many of the proxy-generated pages. Default:
873 <emphasis>#admin-address fill@me.in.please</emphasis>
880 <quote>Proxy-info-url</quote> can be set to a URL that contains more info
881 about this <application>Junkbuster</application> installation, it's
882 configuration and policies. It is used in many of the proxy-generated pages
883 and its use is highly recommended in multi-user installations, since your
884 users will want to know why certain content is blocked or modified. Default:
885 Don't show a link to on-line documentation.
892 <emphasis>proxy-info-url http://www.your-site.com/proxy.html</emphasis>
899 <quote>Listen-address</quote> specifies the address and port where
900 <application>Junkbuster</application> will listen for connections from your
901 Web browser. The default is to listen on the localhost port 8118, and
902 this is suitable for most users. (In your web browser, under proxy
903 configuration, list the proxy server as <quote>localhost</quote> and the
904 port as <quote>8118</quote>).
908 If you already have another service running on port 8118, or if you want to
909 serve requests from other machines (e.g. on your local network) as well, you
910 will need to override the default. The syntax is
911 <quote>listen-address [<ip-address>]:<port></quote>. If you leave
912 out the IP address, <application>junkbuster</application> will bind to all
913 interfaces (addresses) on your machine and may become reachable from the
914 Internet. In that case, consider using access control lists (acl's) (see
915 <quote>aclfile</quote> above), or a firewall.
919 For example, suppose you are running <application>Junkbuster</application> on
920 a machine which has the address 192.168.0.1 on your local private network
921 (192.168.0.0) and has another outside connection with a different address.
922 You want it to serve requests from inside only:
929 <emphasis>listen-address 192.168.0.1:8118</emphasis>
936 If you want it to listen on all addresses (including the outside
944 <emphasis>listen-address :8118</emphasis>
951 If you do this, consider using ACLs (see <quote>aclfile</quote> above). Note:
952 you will need to point your browser(s) to the address and port that you have
953 configured here. Default: localhost:8118 (127.0.0.1:8118).
957 The debug option sets the level of debugging information to log in the
958 logfile (and to the console in the Windows version). A debug level of 1 is
959 informative because it will show you each request as it happens. Higher
960 levels of debug are probably only of interest to developers.
967 debug 1 # GPC = show each GET/POST/CONNECT request
968 debug 2 # CONN = show each connection status
969 debug 4 # IO = show I/O status
970 debug 8 # HDR = show header parsing
971 debug 16 # LOG = log all data into the logfile
972 debug 32 # FRC = debug force feature
973 debug 64 # REF = debug regular expression filter
974 debug 128 # = debug fast redirects
975 debug 256 # = debug GIF de-animation
976 debug 512 # CLF = Common Log Format
977 debug 1024 # = debug kill pop-ups
978 debug 4096 # INFO = Startup banner and warnings.
979 debug 8192 # ERROR = Non-fatal errors
986 It is <emphasis>highly recommended</emphasis> that you enable ERROR
987 reporting (debug 8192), at least until the next stable release.
991 The reporting of FATAL errors (i.e. ones which crash
992 <application>JunkBuster</application>) is always on and cannot be disabled.
996 If you want to use CLF (Common Log Format), you should set <quote>debug
997 512</quote> ONLY, do not enable anything else.
1001 Multiple <quote>debug</quote> directives, are OK - they're logical-OR'd
1009 <emphasis>debug 15 # same as setting the first 4 listed above</emphasis>
1023 <emphasis>debug 1 # URLs</emphasis>
1024 <emphasis>debug 4096 # Info</emphasis>
1025 <emphasis>debug 8192 # Errors - *we highly recommended enabling this*</emphasis>
1032 <application>Junkbuster</application> normally uses
1033 <quote>multi-threading</quote>, a software technique that permits it to
1034 handle many different requests simultaneously. In some cases you may wish to
1035 disable this -- particularly if you're trying to debug a problem. The
1036 <quote>single-threaded</quote> option forces
1037 <application>Junkbuster</application> to handle requests sequentially.
1038 Default: Multi-threaded mode.
1045 <emphasis>#single-threaded</emphasis>
1052 <quote>toggle</quote> allows you to temporarily disable all
1053 <application>Junkbuster's</application> filtering. Just set <quote>toggle
1058 The Windows version of <application>Junkbuster</application> puts an icon in
1059 the system tray, which also allows you to change this option. If you
1060 right-click on that icon (or select the <quote>Options</quote> menu), one
1061 choice is <quote>Enable</quote>. Clicking on enable toggles
1062 <application>Junkbuster</application> on and off. This is useful if you want
1063 to temporarily disable <application>Junkbuster</application>, e.g., to access
1064 a site that requires cookies which you would otherwise have blocked. This can also
1065 be toggled via a web browser at the <application>Junkbuster</application>
1066 internal address of <ulink url="http://i.j.b">http://i.j.b</ulink> on
1071 <quote>toggle 1</quote> means <application>Junkbuster</application> runs
1072 normally, <quote>toggle 0</quote> means that
1073 <application>Junkbuster</application> becomes a non-anonymizing non-blocking
1074 proxy. Default: 1 (on).
1081 <emphasis>toggle 1</emphasis>
1088 For content filtering, i.e. the <quote>+filter</quote> and
1089 <quote>+deanimate-gif</quote> actions, it is necessary that
1090 <application>Junkbuster</application> buffers the entire document body.
1091 This can be potentially dangerous, since a server could just keep sending
1092 data indefinitely and wait for your RAM to exhaust. With nasty consequences.
1096 The <application>buffer-limit</application> option lets you set the maximum
1097 size in Kbytes that each buffer may use. When the documents buffer exceeds
1098 this size, it is flushed to the client unfiltered and no further attempt to
1099 filter the rest of it is made. Remember that there may multiple threads
1100 running, which might require increasing the <quote>buffer-limit</quote>
1101 Kbytes <emphasis>each</emphasis>, unless you have enabled
1102 <quote>single-threaded</quote> above.
1109 <emphasis>buffer-limit 4069</emphasis>
1116 To enable the web-based <filename>ijb.action</filename> file editor set
1117 <application>enable-edit-actions</application> to 1, or 0 to disable. Note
1118 that you must have compiled <application>JunkBuster</application> with
1119 support for this feature, otherwise this option has no effect. This
1120 internal page can be reached at <ulink
1121 url="http://i.j.b">http://i.j.b</ulink>.
1125 Security note: If this is enabled, anyone who can use the proxy
1126 can edit the actions file, and their changes will affect all users.
1127 For shared proxies, you probably want to disable this. Default: enabled.
1134 <emphasis>enable-edit-actions 1</emphasis>
1141 Allow <application>JunkBuster</application> to be toggled on and off
1142 remotely, using your web browser. Set <quote>enable-remote-toggle</quote>to
1143 1 to enable, and 0 to disable. Note that you must have compiled
1144 <application>JunkBuster</application> with support for this feature,
1145 otherwise this option has no effect.
1149 Security note: If this is enabled, anyone who can use the proxy can toggle
1150 it on or off (see <ulink url="http://i.j.b">http://i.j.b</ulink>), and
1151 their changes will affect all users. For shared proxies, you probably want to
1152 disable this. Default: enabled.
1159 <emphasis>enable-remote-toggle 1</emphasis>
1167 <!-- ~ End section ~ -->
1170 <!-- ~~~~~ New section ~~~~~ -->
1173 <title>Access Control List (ACL)</title>
1175 Access controls are included at the request of some ISPs and systems
1176 administrators, and are not usually needed by individual users. Please note
1177 the warnings in the FAQ that this proxy is not intended to be a substitute
1178 for a firewall or to encourage anyone to defer addressing basic security
1183 If no access settings are specified, the proxy talks to anyone that
1184 connects. If any access settings file are specified, then the proxy
1185 talks only to IP addresses permitted somewhere in this file and not
1186 denied later in this file.
1190 Summary -- if using an ACL:
1195 Client must have permission to receive service.
1200 LAST match in ACL wins.
1205 Default behavior is to deny service.
1210 The syntax for an entry in the Access Control List is:
1217 ACTION SRC_ADDR[/SRC_MASKLEN] [ DST_ADDR[/DST_MASKLEN] ]
1224 Where the individual fields are:
1231 <emphasis>ACTION</emphasis> = <quote>permit-access</quote> or <quote>deny-access</quote>
1233 <emphasis>SRC_ADDR</emphasis> = client hostname or dotted IP address
1234 <emphasis>SRC_MASKLEN</emphasis> = number of bits in the subnet mask for the source
1236 <emphasis>DST_ADDR</emphasis> = server or forwarder hostname or dotted IP address
1237 <emphasis>DST_MASKLEN</emphasis> = number of bits in the subnet mask for the target
1245 The field separator (FS) is whitespace (space or tab).
1249 IMPORTANT NOTE: If the <application>junkbuster</application> is using a
1250 forwarder (see below) or a gateway for a particular destination URL, the
1251 <literal>DST_ADDR</literal> that is examined is the address of the forwarder
1252 or the gateway and <emphasis>NOT</emphasis> the address of the ultimate
1253 target. This is necessary because it may be impossible for the local
1254 <application>Junkbuster</application> to determine the address of the
1255 ultimate target (that's often what gateways are used for).
1259 Here are a few examples to show how the ACL features work:
1263 <quote>localhost</quote> is OK -- no DST_ADDR implies that
1264 <emphasis>ALL</emphasis> destination addresses are OK:
1271 <emphasis>permit-access localhost</emphasis>
1278 A silly example to illustrate permitting any host on the class-C subnet with
1279 <application>Junkbuster</application> to go anywhere:
1286 <emphasis>permit-access www.junkbusters.com/24</emphasis>
1293 Except deny one particular IP address from using it at all:
1300 <emphasis>deny-access ident.junkbusters.com</emphasis>
1307 You can also specify an explicit network address and subnet mask.
1308 Explicit addresses do not have to be resolved to be used.
1315 <emphasis>permit-access 207.153.200.0/24</emphasis>
1322 A subnet mask of 0 matches anything, so the next line permits everyone.
1329 <emphasis>permit-access 0.0.0.0/0</emphasis>
1336 Note, you <emphasis>cannot</emphasis> say:
1343 <emphasis>permit-access .org</emphasis>
1350 to allow all *.org domains. Every IP address listed must resolve fully.
1354 An ISP may want to provide a <application>Junkbuster</application> that is
1355 accessible by <quote>the world</quote> and yet restrict use of some of their
1356 private content to hosts on its internal network (i.e. its own subscribers).
1357 Say, for instance the ISP owns the Class-B IP address block 123.124.0.0 (a 16
1358 bit netmask). This is how they could do it:
1365 <emphasis>permit-access 0.0.0.0/0 0.0.0.0/0</emphasis> # other clients can go anywhere
1366 # with the following exceptions:
1368 <emphasis>deny-access</emphasis> 0.0.0.0/0 123.124.0.0/16 # block all external requests for
1369 # sites on the ISP's network
1371 <emphasis>permit 0.0.0.0/0 www.my_isp.com</emphasis> # except for the ISP's main
1374 <emphasis>permit 123.124.0.0/16 0.0.0.0/0</emphasis> # the ISP's clients can go
1382 Note that if some hostnames are listed with multiple IP addresses,
1383 the primary value returned by DNS (via gethostbyname()) is used. Default:
1384 Anyone can access the proxy.
1389 <!-- ~ End section ~ -->
1392 <!-- ~~~~~ New section ~~~~~ -->
1395 <title>Forwarding</title>
1398 This feature allows chaining of HTTP requests via multiple proxies.
1399 It can be used to better protect privacy and confidentiality when
1400 accessing specific domains by routing requests to those domains
1401 to a special purpose filtering proxy such as lpwa.com. Or to use
1402 a caching proxy to speed up browsing.
1406 It can also be used in an environment with multiple networks to route
1407 requests via multiple gateways allowing transparent access to multiple
1408 networks without having to modify browser configurations.
1412 Also specified here are SOCKS proxies. <application>Junkbuster</application>
1413 SOCKS 4 and SOCKS 4A. The difference is that SOCKS 4A will resolve the target
1414 hostname using DNS on the SOCKS server, not our local DNS client.
1418 The syntax of each line is:
1425 <emphasis>forward target_domain[:port] http_proxy_host[:port]</emphasis>
1426 <emphasis>forward-socks4 target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]</emphasis>
1427 <emphasis>forward-socks4a target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]</emphasis>
1434 If http_proxy_host is <quote>.</quote>, then requests are not forwarded to a
1435 HTTP proxy but are made directly to the web servers.
1439 Lines are checked in sequence, and the last match wins.
1443 There is an implicit line equivalent to the following, which specifies that
1444 anything not finding a match on the list is to go out without forwarding
1445 or gateway protocol, like so:
1452 <emphasis>forward .* . </emphasis># implicit
1459 In the following common configuration, everything goes to Lucent's LPWA,
1460 except SSL on port 443 (which it doesn't handle):
1467 <emphasis>forward .* lpwa.com:8000</emphasis>
1468 <emphasis>forward :443 .</emphasis>
1475 See the FAQ for instructions on how to automate the login procedure for LPWA.
1476 Some users have reported difficulties related to LPWA's use of
1477 <quote>.</quote> as the last element of the domain, and have said that this
1478 can be fixed with this:
1485 <emphasis>forward lpwa. lpwa.com:8000</emphasis>
1492 (NOTE: the syntax for specifying target_domain has changed since the
1493 previous paragraph was written -- it will not work now. More information
1498 In this fictitious example, everything goes via an ISP's caching proxy,
1499 except requests to that ISP:
1506 <emphasis>forward .* caching.myisp.net:8000</emphasis>
1507 <emphasis>forward myisp.net .</emphasis>
1514 For the @home network, we're told the forwarding configuration is this:
1522 <emphasis>forward .* proxy:8080</emphasis>
1529 Also, we're told they insist on getting cookies and JavaScript, so you should
1530 add home.com to the cookie file. We consider JavaScript a security risk.
1531 Java need not be enabled.
1535 In this example direct connections are made to all <quote>internal</quote>
1536 domains, but everything else goes through Lucent's LPWA by way of the
1537 company's SOCKS gateway to the Internet.
1544 <emphasis>forward-socks4 .* lpwa.com:8000 firewall.my_company.com:1080</emphasis>
1545 <emphasis>forward my_company.com .</emphasis>
1552 This is how you could set up a site that always uses SOCKS but no forwarders:
1559 <emphasis>forward-socks4a .* . firewall.my_company.com:1080</emphasis>
1566 An advanced example for network administrators:
1570 If you have links to multiple ISPs that provide various special content to
1571 their subscribers, you can configure forwarding to pass requests to the
1572 specific host that's connected to that ISP so that everybody can see all
1573 of the content on all of the ISPs.
1577 This is a bit tricky, but here's an example:
1582 host-a has a PPP connection to isp-a.com. And host-b has a PPP connection to
1583 isp-b.com. host-a can run a <application>Junkbuster</application> proxy with
1584 forwarding like this:
1591 <emphasis>forward .* .</emphasis>
1592 <emphasis>forward isp-b.com host-b:8118</emphasis>
1599 host-b can run a <application>Junkbuster</application> proxy with forwarding
1607 <emphasis>forward .* .</emphasis>
1608 <emphasis>forward isp-a.com host-a:8118</emphasis>
1615 Now, <emphasis>anyone</emphasis> on the Internet (including users on host-a
1616 and host-b) can set their browser's proxy to <emphasis>either</emphasis>
1617 host-a or host-b and be able to browse the content on isp-a or isp-b.
1621 Here's another practical example, for University of Kent at
1622 Canterbury students with a network connection in their room, who
1623 need to use the University's Squid web cache.
1630 <emphasis>forward *. ssbcache.ukc.ac.uk:3128</emphasis> # Use the proxy, except for:
1631 <emphasis>forward .ukc.ac.uk . </emphasis> # Anything on the same domain as us
1632 <emphasis>forward * . </emphasis> # Host with no domain specified
1633 <emphasis>forward 129.12.*.* . </emphasis> # A dotted IP on our /16 network.
1634 <emphasis>forward 127.*.*.* . </emphasis> # Loopback address
1635 <emphasis>forward localhost.localdomain . </emphasis> # Loopback address
1636 <emphasis>forward www.ukc.mirror.ac.uk . </emphasis> # Specific host
1643 If you intend to chain <application>Junkbuster</application> and
1644 <application>squid</application> locally, then chain as
1645 <literal>browser -> squid -> junkbuster</literal> is the recommended way.
1649 Your squid configuration could then look like this:
1656 # Define junkbuster as parent cache
1657 <!-- per feedback from user...
1658 cache_peer 127.0.0.1 8118 parent 0 no-query
1660 cache_peer 127.0.0.1 parent 8118 0 no-query
1662 # Define ACL for protocol FTP
1665 # Do not forward ACL FTP to junkbuster
1666 always_direct allow FTP
1668 # Do not forward ACL CONNECT (https) to junkbuster
1669 always_direct allow CONNECT
1671 # Forward the rest to junkbuster
1672 never_direct allow all
1680 <!-- ~ End section ~ -->
1683 <!-- ~~~~~ New section ~~~~~ -->
1686 <title>Windows GUI Options</title>
1688 Removed references to Win32. HB 09/23/01
1691 <application>Junkbuster</application> has a number of options specific to the
1692 Windows GUI interface:
1696 If <quote>activity-animation</quote> is set to 1, the
1697 <application>Junkbuster</application> icon will animate when
1698 <quote>Junkbuster</quote> is active. To turn off, set to 0.
1705 <emphasis>activity-animation 1</emphasis>
1712 If <quote>log-messages</quote> is set to 1,
1713 <application>Junkbuster</application> will log messages to the console
1721 <emphasis>log-messages 1</emphasis>
1728 If <quote>log-buffer-size</quote> is set to 1, the size of the log buffer,
1729 i.e. the amount of memory used for the log messages displayed in the
1730 console window, will be limited to <quote>log-max-lines</quote> (see below).
1734 Warning: Setting this to 0 will result in the buffer to grow infinitely and
1735 eat up all your memory!
1742 <emphasis>log-buffer-size 1</emphasis>
1749 <application>log-max-lines</application> is the maximum number of lines held
1750 in the log buffer. See above.
1757 <emphasis>log-max-lines 200</emphasis>
1764 If <quote>log-highlight-messages</quote> is set to 1,
1765 <application>Junkbuster</application> will highlight portions of the log
1766 messages with a bold-faced font:
1773 <emphasis>log-highlight-messages 1</emphasis>
1780 The font used in the console window:
1787 <emphasis>log-font-name Comic Sans MS</emphasis>
1794 Font size used in the console window:
1801 <emphasis>log-font-size 8</emphasis>
1808 <quote>show-on-task-bar</quote> controls whether or not
1809 <application>Junkbuster</application> will appear as a button on the Task bar
1817 <emphasis>show-on-task-bar 0</emphasis>
1824 If <quote>close-button-minimizes</quote> is set to 1, the Windows close
1825 button will minimize <application>Junkbuster</application> instead of closing
1826 the program (close with the exit option on the File menu).
1833 <emphasis>close-button-minimizes 1</emphasis>
1840 The <quote>hide-console</quote> option is specific to the MS-Win console
1841 version of <application>JunkBuster</application>. If this option is used,
1842 <application>Junkbuster</application> will disconnect from and hide the
1859 <!-- ~ End section ~ -->
1862 <!-- ~~~~~ New section ~~~~~ -->
1863 <sect2 id="actionsfile">
1864 <title>The Actions File</title>
1867 The <quote>ijb.action</quote> file (formerly
1868 <filename>actionsfile</filename>) is used to define what actions
1869 <application>Junkbuster</application> takes, and thus determines how images,
1870 cookies and various other aspects of HTTP content and transactions are
1871 handled. Images can be anything you want, including ads, banners, or just
1872 some obnoxious image that you would rather not see. Cookies can be accepted
1873 or rejected, or accepted only during the current browser session (i.e.
1874 not written to disk). Changes to <filename>ijb.action</filename> should
1875 be immediately visible to <application>Junkbuster</application> without
1876 the need to restart.
1880 To determine which actions apply to a request, the URL of the request is
1881 compared to all patterns in this file. Every time it matches, the list of
1882 applicable actions for the URL is incrementally updated. You can trace
1883 this process by visiting <ulink
1884 url="http://i.j.b/show-url-info">http://i.j.b/show-url-info</ulink>.
1888 The actions file can be edited with a browser by loading
1889 <ulink url="http://i.j.b/">http://i.j.b/</ulink>, and then select
1890 <quote>Edit Actions</quote>.
1894 There are four types of lines in this file: comments (begin with a
1895 <quote>#</quote> character), actions, aliases and patterns, all of which are
1896 explained below, as well as the configuration file syntax that
1897 <application>Junkbuster</application> understands.
1902 <!-- ~~~~~ New section ~~~~~ -->
1904 <title>URL Domain and Path Syntax</title>
1906 Generally, a pattern has the form <domain>/<path>, where both the
1907 <domain> and <path> part are optional. If you only specify a
1908 domain part, the <quote>/</quote> can be left out:
1912 <emphasis>www.example.com</emphasis> - is a domain only pattern and will match any request to
1913 <quote>www.example.com</quote>.
1917 <emphasis>www.example.com/</emphasis> - means exactly the same.
1921 <emphasis>www.example.com/index.html</emphasis> - matches only the single
1922 document <quote>/index.html</quote> on <quote>www.example.com</quote>.
1926 <emphasis>/index.html</emphasis> - matches the document <quote>/index.html</quote>, regardless of
1931 <emphasis>index.html</emphasis> - matches nothing, since it would be
1932 interpreted as a domain name and there is no top-level domain called
1933 <quote>.html</quote>.
1937 The matching of the domain part offers some flexible options: if the
1938 domain starts or ends with a dot, it becomes unanchored at that end.
1943 <emphasis>.example.com</emphasis> - matches any domain that <emphasis>ENDS</emphasis> in
1944 <quote>.example.com</quote>.
1948 <emphasis>www.</emphasis> - matches any domain that <emphasis>STARTS</emphasis> with
1953 Additionally, there are wild-cards that you can use in the domain names
1954 themselves. They work pretty similar to shell wild-cards: <quote>*</quote>
1955 stands for zero or more arbitrary characters, <quote>?</quote> stands for
1956 any single character. And you can define character classes in square
1957 brackets and they can be freely mixed:
1961 <emphasis>ad*.example.com</emphasis> - matches <quote>adserver.example.com</quote>,
1962 <quote>ads.example.com</quote>, etc but not <quote>sfads.example.com</quote>.
1966 <emphasis>*ad*.example.com</emphasis> - matches all of the above, and then some.
1970 <emphasis>.?pix.com</emphasis> - matches <quote>www.ipix.com</quote>,
1971 <quote>pictures.epix.com</quote>, <quote>a.b.c.d.e.upix.com</quote>, etc.
1975 <emphasis>www[1-9a-ez].example.com</emphasis> - matches <quote>www1.example.com</quote>,
1976 <quote>www4.example.com</quote>, <quote>wwwd.example.com</quote>,
1977 <quote>wwwz.example.com</quote>, etc., but <emphasis>not</emphasis>
1978 <quote>wwww.example.com</quote>.
1982 If <application>Junkbuster</application> was compiled with
1983 <quote>pcre</quote> support (default), Perl compatible regular expressions
1984 can be used. See the <filename>pcre/docs/</filename> directory or <quote>man
1985 perlre</quote> (also available on <ulink
1986 url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>)
1987 for details. A brief discussion of regular expressions is in the
1988 <link linkend="regex">Appendix</link>. For instance:
1992 <emphasis>/.*/advert[0-9]+\.jpe?g</emphasis> - would match a URL from any
1993 domain, with any path that includes <quote>advert</quote> followed
1994 immediately by one or more digits, then a <quote>.</quote> and ending in
1995 either <quote>jpeg</quote> or <quote>jpg</quote>. So we match
1996 <quote>example.com/ads/advert2.jpg</quote>, and
1997 <quote>www.example.com/ads/banners/advert39.jpeg</quote>, but not
1998 <quote>www.example.com/ads/banners/advert39.gif</quote> (no gifs in the
2003 Please note that matching in the path is case
2004 <emphasis>INSENSITIVE</emphasis> by default, but you can switch to case
2005 sensitive at any point in the pattern by using the
2006 <quote>(?-i)</quote> switch:
2010 <emphasis>www.example.com/(?-i)PaTtErN.*</emphasis> - will match only
2011 documents whose path starts with <quote>PaTtErN</quote> in
2012 <emphasis>exactly</emphasis> this capitalization.
2017 <!-- ~ End section ~ -->
2021 <!-- ~~~~~ New section ~~~~~ -->
2024 <title>Actions</title>
2026 Actions are enabled if preceded with a <quote>+</quote>, and disabled if
2027 preceded with a <quote>-</quote>. Actions are invoked by enclosing the
2028 action name in curly braces (e.g. {+some_action}), followed by a list of
2029 URLs to which the action applies. There are three classes of actions:
2037 Boolean (e.g. <quote>+/-block</quote>):
2043 <emphasis>{+name}</emphasis> # enable this action
2044 <emphasis>{-name}</emphasis> # disable this action
2054 parameterized (e.g. <quote>+/-hide-user-agent</quote>):
2060 <emphasis>{+name{param}}</emphasis> # enable action and set parameter to <quote>param</quote>
2061 <emphasis>{-name}</emphasis> # disable action
2070 Multi-value (e.g. <quote>{+/-add-header{Name: value}}</quote>, <quote>{+/-wafer{name=value}}</quote>):
2076 <emphasis>{+name{param}}</emphasis> # enable action and add parameter <quote>param</quote>
2077 <emphasis>{-name{param}}</emphasis> # remove the parameter <quote>param</quote>
2078 <emphasis>{-name}</emphasis> # disable this action totally
2089 If nothing is specified in this file, no <quote>actions</quote> are taken.
2090 So in this case <application>JunkBuster</application> would just be a
2091 normal, non-blocking, non-anonymizing proxy. You must specifically
2092 enable the privacy and blocking features you need (although the
2093 provided default <filename>ijb.action</filename> file will
2094 give a good starting point).
2098 Later defined actions always over-ride earlier ones. For multi-valued
2099 actions, the actions are applied in the order they are specified.
2103 The list of valid <application>Junkbuster</application> <quote>actions</quote> are:
2111 Add the specified HTTP header, which is not checked for validity.
2112 You may specify this many times to specify many different headers:
2118 <emphasis>+add-header{Name: value}</emphasis>
2128 Block this URL totally.
2134 <emphasis>+block</emphasis>
2144 De-animate all animated GIF images, i.e. reduce them to their last frame.
2145 This will also shrink the images considerably (in bytes, not pixels!). If
2146 the option <quote>first</quote> is given, the first frame of the animation
2147 is used as the replacement. If <quote>last</quote> is given, the last frame
2148 of the animation is used instead, which probably makes more sense for most
2149 banner animations, but also has the risk of not showing the entire last
2150 frame (if it is only a delta to an earlier frame).
2156 <emphasis>+deanimate-gifs{last}</emphasis>
2157 <emphasis>+deanimate-gifs{first}</emphasis>
2166 <quote>+downgrade</quote> will downgrade HTTP/1.1 client requests to
2167 HTTP/1.0 and downgrade the responses as well. Use this action for servers
2168 that use HTTP/1.1 protocol features that
2169 <application>Junkbuster</application> doesn't handle well yet. HTTP/1.1
2170 is only partially implemented. Default is not to downgrade requests.
2176 <emphasis>+downgrade</emphasis>
2185 Many sites, like yahoo.com, don't just link to other sites. Instead, they
2186 will link to some script on their own server, giving the destination as a
2187 parameter, which will then redirect you to the final target. URLs resulting
2188 from this scheme typically look like:
2189 http://some.place/some_script?http://some.where-else.
2192 Sometimes, there are even multiple consecutive redirects encoded in the
2193 URL. These redirections via scripts make your web browsing more traceable,
2194 since the server from which you follow such a link can see where you go to.
2195 Apart from that, valuable bandwidth and time is wasted, while your browser
2196 ask the server for one redirect after the other. Plus, it feeds the
2200 The <quote>+fast-redirects</quote> option enables interception of these
2201 requests by <application>Junkbuster</application>, who will cut off all but
2202 the last valid URL in the request and send a local redirect back to your
2203 browser without contacting the remote site.
2209 <emphasis>+fast-redirects</emphasis>
2218 Filter the website through the re_filterfile:
2224 <emphasis>+filter{filename}</emphasis>
2233 Block any existing X-Forwarded-for header, and do not add a new one:
2239 <emphasis>+hide-forwarded</emphasis>
2248 If the browser sends a <quote>From:</quote> header containing your e-mail
2249 address, this either completely removes the header (<quote>block</quote>), or
2250 changes it to the specified e-mail address.
2256 <emphasis>+hide-from{block}</emphasis>
2257 <emphasis>+hide-from{spam@sittingduck.xqq}</emphasis>
2266 Don't send the <quote>Referer:</quote> (sic) header to the web site. You
2267 can block it, forge a URL to the same server as the request (which is
2268 preferred because some sites will not send images otherwise) or set it to a
2269 constant string of your choice.
2275 <emphasis>+hide-referer{block}</emphasis>
2276 <emphasis>+hide-referer{forge}</emphasis>
2277 <emphasis>+hide-referer{http://nowhere.com}</emphasis>
2286 Alternative spelling of <quote>+hide-referer</quote>. It has the same
2287 parameters, and can be freely mixed with, <quote>+hide-referer</quote>.
2288 (<quote>referrer</quote> is the correct English spelling, however the HTTP
2289 specification has a bug - it requires it to be spelled <quote>referer</quote>.)
2295 <emphasis>+hide-referrer{...}</emphasis>
2304 Change the <quote>User-Agent:</quote> header so web servers can't tell your
2305 browser type. Warning! This breaks many web sites. Specify the
2306 user-agent value you want. Example, pretend to be using Netscape on
2313 <emphasis>+hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}</emphasis>
2320 Or to identify yourself explicitly as a <quote>Junkbuster</quote> user:
2326 <emphasis>+hide-user-agent{JunkBuster/1.0}</emphasis>
2331 (Don't change the version number from 1.0 - after all, why tell them?)
2338 <emphasis>+hide-user-agent{browser-type}</emphasis>
2348 Treat this URL as an image. This only matters if it's also <quote>+block</quote>ed,
2349 in which case a <quote>blocked</quote> image can be sent rather than a HTML page.
2350 See <quote>+image-blocker{}</quote> below for the control over what is actually sent.
2356 <emphasis>+image</emphasis>
2365 Decides what to do with URLs that end up tagged with <quote>{+block
2366 +image}</quote>, e.g an advertizement. There are five options.
2367 <quote>-image-blocker</quote> will send a HTML <quote>blocked</quote> page,
2368 usually resulting in a <quote>broken image</quote> icon.
2369 <quote>+image-blocker{logo}</quote> will send a <quote>JunkBuster</quote>
2370 logo image. <quote>+image-blocker{blank}</quote> will send a 1x1
2371 transparent GIF image. And finally,
2372 <quote>+image-blocker{http://xyz.com}</quote> will send a HTTP temporary
2373 redirect to the specified image. This has the advantage of the icon being
2374 being cached by the browser, which will speed up the display.
2375 <quote>+image-blocker{pattern}</quote> will send a checkboard type pattern,
2376 which scales better than the logo (which can get blocky if the browser
2377 enlarges it too much).
2383 <emphasis>+image-blocker{logo}</emphasis>
2384 <emphasis>+image-blocker{blank}</emphasis>
2385 <emphasis>+image-blocker{http://i.j.b/send-banner}</emphasis>
2394 By default (i.e. in the absence of a <quote>+limit-connect</quote>
2395 action), <application>Junkbuster</application> will only allow CONNECT
2396 requests to port 443, which is the standard port for https as a
2401 The CONNECT methods exists in HTTP to allow access to secure websites
2402 (https:// URLs) through proxies. It works very simply: the proxy
2403 connects to the server on the specified port, and then short-circuits
2404 its connections to the client <emphasis>and</emphasis> to the remote proxy.
2405 This can be a big security hole, since CONNECT-enabled proxies can
2406 be abused as TCP relays very easily.
2410 If you want to allow CONNECT for more ports than this, or want to forbid
2411 CONNECT altogether, you can specify a comma separated list of ports and
2412 port ranges (the latter using dashes, with the minimum defaulting to 0 and
2420 <emphasis>+limit-connect{443} # This is the default and need no be specified.</emphasis>
2421 <emphasis>+limit-connect{80,443} # Ports 80 and 443 are OK.</emphasis>
2422 <emphasis>+limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100</emphasis>
2423 <emphasis> #and above 500 are OK.</emphasis>
2433 <quote>+no-compression</quote> prevents the website from compressing the
2434 data. Some websites do this, which can be a problem for
2435 <application>Junkbuster</application>, since <quote>+filter</quote>,
2436 <quote>+no-popup</quote> and <quote>+gif-deanimate</quote> will not work on
2437 compressed data. This will slow down connections to those websites,
2438 though. Default is <quote>nocompression</quote> is turned on.
2445 <emphasis>+nocompression</emphasis>
2454 If the website sets cookies, <quote>no-cookies-keep</quote> will make sure
2455 they are erased when you exit and restart your web browser. This makes
2456 profiling cookies useless, but won't break sites which require cookies so
2457 that you can log in for transactions. Default: on.
2463 <emphasis>+no-cookies-keep</emphasis>
2472 Prevent the website from reading cookies:
2478 <emphasis>+no-cookies-read</emphasis>
2487 Prevent the website from setting cookies:
2493 <emphasis>+no-cookies-set</emphasis>
2502 Filter the website through a built-in filter to disable those obnoxious
2503 JavaScript pop-up windows via window.open(), etc. The two alternative
2504 spellings are equivalent.
2510 <emphasis>+no-popup</emphasis>
2511 <emphasis>+no-popups</emphasis>
2520 This action only applies if you are using a <filename>jarfile</filename>
2521 for saving cookies. It sends a cookie to every site stating that you do not
2522 accept any copyright on cookies sent to you, and asking them not to track
2523 you. Of course, this is a (relatively) unique header they could use to
2530 <emphasis>+vanilla-wafer</emphasis>
2539 This allows you to add an arbitrary cookie. It can be specified multiple
2540 times in order to add as many cookies as you like.
2546 <emphasis>+wafer{name=value}</emphasis>
2557 The meaning of any of the above is reversed by preceding the action with a
2558 <quote>-</quote>, in place of the <quote>+</quote>.
2566 Turn off cookies by default, then allow a few through for specified sites:
2573 # Turn off all persistent cookies
2574 { +no-cookies-read }
2576 # Allow cookies for this browser session ONLY
2577 { +no-cookies-keep }
2579 # Exceptions to the above, sites that benefit from persistent cookies
2580 { -no-cookies-read }
2582 { -no-cookies-keep }
2589 # Alternative way of saying the same thing
2590 {-no-cookies-set -no-cookies-read -no-cookies-keep}
2599 Now turn off <quote>fast redirects</quote>, and then we allow two exceptions:
2609 # Reverse it for these two sites, which don't work right without it.
2611 www.ukc.ac.uk/cgi-bin/wac\.cgi\?
2619 Turn on page filtering, with one exception for sourceforge:
2626 # Run everything through the default filter file (<filename>re_filterfile</filename>):
2629 # But please don't re_filter code from sourceforge!
2631 .cvs.sourceforge.net
2638 Now some URLs that we want <quote>blocked</quote>, ie we won't see them.
2639 Many of these use regular expressions that will expand to match multiple
2649 /.*/(.*[-_.])?ads?[0-9]?(/|[-_.].*|\.(gif|jpe?g))
2650 /.*/(.*[-_.])?count(er)?(\.cgi|\.dll|\.exe|[?/])
2651 /.*/(ng)?adclient\.cgi
2652 /.*/(plain|live|rotate)[-_.]?ads?/
2653 /.*/(sponsor)s?[0-9]?/
2654 /.*/_?(plain|live)?ads?(-banners)?/
2656 /.*/ad(sdna_image|gifs?)/
2657 /.*/ad(server|stream|juggler)\.(cgi|pl|dll|exe)
2661 /.*/adv((er)?ts?|ertis(ing|ements?))?/
2665 /.*/cgi-bin/centralad/getimage
2666 /.*/images/addver\.gif
2667 /.*/images/marketing/.*\.(gif|jpe?g)
2671 /.*/sponsors?[0-9]?/
2672 /.*/advert[0-9]+\.jpg
2679 /graphics/defaultAd/
2681 /image\.ng/transactionID
2682 /images/.*/.*_anim\.gif # alvin brattli
2683 /ip_img/.*\.(gif|jpe?g)
2687 /cgi-bin/nph-adclick.exe/
2688 /.*/Image/BannerAdvertising/
2690 /.*/adlib/server\.cgi
2699 <!-- ~ End section ~ -->
2702 <!-- ~~~~~ New section ~~~~~ -->
2704 <title>Aliases</title>
2706 Custom <quote>actions</quote>, known to <application>Junkbuster</application>
2707 as <quote>aliases</quote>, can be defined by combining other <quote>actions</quote>.
2708 These can in turn be invoked just like the built-in <quote>actions</quote>.
2709 Currently, an alias can contain any character except space, tab, <quote>=</quote>,
2710 <quote>{</quote> or <quote>}</quote>. But please use only <quote>a</quote>-
2711 <quote>z</quote>, <quote>0</quote>-<quote>9</quote>, <quote>+</quote>, and
2712 <quote>-</quote>. Alias names are not case sensitive, and
2713 <emphasis>must be defined before anything</emphasis> else in the
2714 <filename>ijb.action</filename>file ! And there can only be one set of
2715 <quote>aliases</quote> defined.
2719 Now let's define a few aliases:
2726 # Useful customer aliases we can use later. These must come first!
2728 +no-cookies = +no-cookies-set +no-cookies-read
2729 -no-cookies = -no-cookies-set -no-cookies-read
2730 fragile = -block -no-cookies -filter -fast-redirects -hide-referer -no-popups
2731 shop = -no-cookies -filter -fast-redirects
2732 +imageblock = +block +image
2734 #For people who don't like to type too much: ;-)
2737 c2 = -no-cookies-set +no-cookies-read
2738 c3 = +no-cookies-set -no-cookies-read
2739 #... etc. Customize to your heart's content.
2746 Some examples using our <quote>shop</quote> and <quote>fragile</quote>
2754 # These sites are very complex and require
2755 # minimal interference.
2757 .office.microsoft.com
2758 .windowsupdate.microsoft.com
2761 # Shopping sites - still want to block ads.
2764 .worldpay.com # for quietpc.com
2768 # These shops require pop-ups
2780 <!-- ~ End section ~ -->
2783 <!-- ~~~~~ New section ~~~~~ -->
2784 <sect2 id="filterfile">
2785 <title>The Filter File</title>
2787 The filter file defines what filtering of web pages
2788 <application>Junkbuster</application> does. The default filter file is
2789 <filename>re_filterfile</filename>, located in the config directory. In this
2790 file, <emphasis>any document content</emphasis>, whether viewable text or
2791 embedded non-visible content, can be changed.
2795 This file uses regular expressions to alter or remove any string in the
2796 target page. Some examples from the included default <filename>re_filterfile</filename>:
2800 Stop web pages from displaying annoying messages in the status bar by
2801 deleting such references:
2808 # The status bar is for displaying link targets, not pointless buzzwords.
2809 # Again, check it out on http://www.airport-cgn.de/.
2810 s/status='.*?';*//ig
2817 Just for kicks, replace any occurrence of <quote>Microsoft</quote> with
2818 <quote>MicroSuck</quote>:
2825 s/microsoft(?!.com)/MicroSuck/ig
2832 Kill those auto-refresh tags:
2839 # Kill refresh tags. I like to refresh myself. Manually.
2840 # check it out on http://www.airport-cgn.de/ and go to the arrivals page.
2842 s/<meta[^>]*http-equiv[^>]*refresh.*URL=([^>]*?)"?>/<link rev="x-refresh" href=$1>/i
2843 s/<meta[^>]*http-equiv="?page-enter"?[^>]*content=[^>]*>/<!--no page enter for me-->/i
2851 <!-- ~ End section ~ -->
2855 <!-- ~~~~~ New section ~~~~~ -->
2858 <title>Templates</title>
2860 When <application>Junkbuster</application> displays one of its internal
2861 pages, such as a 404 Not Found error page, it uses the appropriate template.
2862 On Linux, BSD, and Unix, these are located in
2863 <filename>/etc/junkbuster/templates</filename> by default. These may be
2864 customized, if desired.
2871 <!-- ~ End section ~ -->
2875 <!-- ~~~~~ New section ~~~~~ -->
2876 <sect1 id="quickstart"><title>Quickstart to Using Junkbuster</title>
2878 Install package, then run and enjoy! <application>JunkBuster</application>
2879 is typically started by specifying the main configuration file to be
2880 used on the command line. Example Unix startup command:
2886 # /usr/sbin/junkbuster /etc/junkbuster/config
2892 An init script is provided for SuSE and Redhat.
2896 For for SuSE: /etc/rc.d/junkbuster start
2900 For RedHat: /etc/rc.d/init.d/junkbuster start
2905 If no configuration file is specified on the command line,
2906 <application>Junkbuster</application> will look for a file named
2907 <filename>config</filename> in the current directory. Except on Win32 where
2908 it will try <filename>config.txt</filename>. If no file is specified on the
2909 command line and no default configuration file can be found,
2910 <application>Junkbuster</application> will fail to start.
2914 Be sure your browser is set to use the proxy which is by default at
2915 localhost, port 8118. With <application>Netscape</application> (and
2916 <application>Mozilla</application>), this can be set under <literal>Edit
2917 -> Preferences -> Advanced -> Proxies -> HTTP Proxy</literal>.
2918 For <application>Internet Explorer</application>: <literal>Tools >
2919 Internet Properties -> Connections -> LAN Setting</literal>. Then,
2920 check <quote>Use Proxy</quote> and fill in the appropriate info (Address:
2921 localhost, Port: 8118). Include if HTTPS proxy support too.
2925 The included default configuration files should give a reasonable starting
2926 point, though may be somewhat aggressive in blocking junk. You will probably
2927 want to keep an eye out for sites that require persistent cookies, and add these to
2928 <filename>ijb.action</filename> as needed. By default, most of these will
2929 be accepted only during the current browser session, until you add them to
2930 the configuration. If you want the browser to handle this instead, you will
2931 need to edit <filename>ijb.action</filename> and disable this feature. If you
2932 use more than one browser, it would make more sense to let
2933 <application>Junkbuster</application> handle this. In which case, the
2934 browser(s) should be set to accept all cookies.
2938 If a particular site shows problems loading properly, try adding it
2939 to the <literal>{fragile}</literal> section of
2940 <filename>ijb.action</filename>. This will turn off most actions for
2945 <application>Junkbuster</application> is HTTP/1.1 compliant, but not all 1.1
2946 features are as yet implemented. If browsers that support HTTP/1.1 (like
2947 <application>Mozilla</application> or recent versions of I.E.) experience
2948 problems, you might try to force HTTP/1.0 compatibility. For Mozilla, look
2949 under <literal>Edit -> Preferences -> Debug -> Networking</literal>.
2950 Or set the <quote>+downgrade</quote> config option in
2951 <filename>ijb.action</filename>.
2955 After running <application>Junkbuster</application> for a while, you can
2956 start to fine tune the configuration to suit your personal, or site,
2957 preferences and requirements. There are many, many aspects that can
2958 be customized. <quote>Actions</quote> (as specified in <filename>ijb.action</filename>)
2959 can be adjusted by pointing your browser to
2960 <ulink url="http://i.j.b/">http://i.j.b/</ulink>,
2961 and then follow the link to <quote>edit the actions list</quote>.
2962 (This is an internal page and does not require Internet access.)
2966 In fact, various aspects of <application>Junkbuster</application>
2967 configuration can be viewed from this page, including
2968 current configuration parameters, source code version numbers,
2969 the browser's request headers, and <quote>actions</quote> that apply
2970 to a given URL. In addition to the <filename>ijb.action</filename> file
2971 editor mentioned above, <application>Junkbuster</application> can also
2972 be turned <quote>on</quote> and <quote>off</quote> from this page.
2976 If you encounter problems, please verify it is a
2977 <application>Junkbuster</application> bug, by disabling
2978 <application>Junkbuster</application>, and then trying the same page.
2979 Also, try another browser if possible to eliminate browser or site
2980 problems. Before reporting it as a bug, see if there is not a configuration
2981 option that is enabled that is causing the page not to load. You can
2982 then add an exception for that page or site. If a bug, please report it to
2983 the developers (see below).
2988 <!-- ~~~~~ New section ~~~~~ -->
2991 <title>Command Line Options</title>
2993 <application>JunkBuster</application> may be invoked with the following
2994 command-line options:
3002 <emphasis>--version</emphasis>
3005 Print version info and exit, Unix only.
3010 <emphasis>--help</emphasis>
3013 Print a short usage info and exit, Unix only.
3018 <emphasis>--no-daemon</emphasis>
3021 Don't become a daemon, i.e. don't fork and become process group
3022 leader, don't detach from controlling tty. Unix only.
3027 <emphasis>--pidfile FILE</emphasis>
3031 On startup, write the process ID to <emphasis>FILE</emphasis>. Delete the
3032 <emphasis>FILE</emphasis> on exit. Failiure to create or delete the
3033 <emphasis>FILE</emphasis> is non-fatal. If no <emphasis>FILE</emphasis>
3034 option is given, no PID file will be used. Unix only.
3039 <emphasis>--user USER[.GROUP]</emphasis>
3043 After (optionally) writing the PID file, assume the user ID of
3044 <emphasis>USER</emphasis>, and if included the GID of GROUP. Exit if the
3045 privileges are not sufficient to do so. Unix only.
3050 <emphasis>configfile</emphasis>
3053 If no <emphasis>configfile</emphasis> is included on the command line,
3054 <application>JunkBuster</application> will look for a file named
3055 <quote>config</quote> in the current directory (except on Win32
3056 where it will look for <quote>config.txt</quote> instead). Specify
3057 full path to avoid confusion.
3068 <!-- ~ End section ~ -->
3072 <!-- ~~~~~ New section ~~~~~ -->
3074 <sect1 id="contact"><title>Contacting the Developers, Bug Reporting and Feature
3077 We value your feedback. However, to provide you with the best support,
3082 <listitem><para>Use the <ulink url="http://sourceforge.net/tracker/?group_id=11118&atid=211118">Sourceforge support forum</ulink> to get
3083 help.</para></listitem>
3085 <listitem><para>Submit bugs only thru our <ulink url="http://sourceforge.net/tracker/?group_id=11118&atid=111118">Sourceforge bug
3087 Make sure that the bug has not already been submitted. Please try to
3088 verify that it is a <application>Junkbuster</application> bug, and not
3089 a browser or site bug first. If you are using your own custom configuration,
3090 please try the stock configs to see if the problem is a configuration
3091 related bug. And if not using the latest development snapshot, please
3092 try the latest one. Or even better, CVS sources.</para>
3096 <listitem><para>Submit feature requests only thru our <ulink
3097 url="http://sourceforge.net/tracker/?atid=361118&group_id=11118&func=browse">Sourceforge feature request forum</ulink>.</para></listitem>
3105 For any other issues, feel free to use the <ulink url="http://sourceforge.net/mail/?group_id=11118">mailing lists</ulink>.
3109 Anyone interested in actively participating in development and related
3110 discussions can join the appropriate mailing list
3111 <ulink url="http://sourceforge.net/mail/?group_id=11118">here</ulink>.
3112 Archives are available here too.
3118 <!-- ~~~~~ New section ~~~~~ -->
3119 <sect1 id="copyright"><title>Copyright and History</title>
3122 <title>License</title>
3124 <application>Internet Junkbuster</application> is free software; you can
3125 redistribute it and/or modify it under the terms of the GNU General Public
3126 License as published by the Free Software Foundation; either version 2 of the
3127 License, or (at your option) any later version.
3131 This program is distributed in the hope that it will be useful, but WITHOUT
3132 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
3133 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
3134 details, which is available from <ulink
3135 url="http://www.gnu.org/copyleft/gpl.html">the Free Software Foundation,
3136 Inc</ulink>, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3141 <!-- ~ End section ~ -->
3144 <!-- ~~~~~ New section ~~~~~ -->
3147 <title>History</title>
3149 <application>Junkbuster</application> was originally written by Anonymous
3151 url="http://www.junkbusters.com/ht/en/ijbfaq.html">Junkbuster's
3152 Corporation</ulink>, and was released as free open-source software under the
3153 GNU GPL. <ulink url="http://www.waldherr.org/junkbuster/">Stefan
3154 Waldherr</ulink> made many improvements, and started the <ulink
3155 url="http://sourceforge.net/projects/ijbswa/">SourceForge project</ulink> to
3156 rekindle development. There are now several active developers contributing.
3157 The last stable release was v2.0.2, which has now grown whiskers ;-).
3164 <!-- ~~~~~ New section ~~~~~ -->
3165 <sect1 id="seealso"><title>See also</title>
3170 <ulink url="http://sourceforge.net/projects/ijbswa">http://sourceforge.net/projects/ijbswa</ulink>
3175 <ulink url="http://ijbswa.sourceforge.net/">http://ijbswa.sourceforge.net/</ulink>
3180 <ulink url="http://i.j.b/">http://i.j.b/</ulink>
3185 <ulink url="http://www.junkbusters.com/ht/en/cookies.html">http://www.junkbusters.com/ht/en/cookies.html</ulink>
3190 <ulink url="http://www.waldherr.org/junkbuster/">http://www.waldherr.org/junkbuster/</ulink>
3195 <ulink url="http://privacy.net/analyze/">http://privacy.net/analyze/</ulink>
3200 <ulink url="http://www.squid-cache.org/">http://www.squid-cache.org/</ulink>
3209 <!-- ~~~~~ New section ~~~~~ -->
3210 <sect1 id="appendix"><title>Appendix</title>
3213 <!-- ~~~~~ New section ~~~~~ -->
3215 <title>Regular Expressions</title>
3217 <application>Junkbuster</application> can use <quote>regular expressions</quote>
3218 in various config files. Assuming support for <quote>pcre</quote> (Perl
3219 Compatible Regular Expressions) is compiled in, which is the default. Such
3220 configuration directives do not require regular expressions, but they can be
3221 used to increase flexibility by matching a pattern with wild-cards against
3226 If you are reading this, you probably don't understand what <quote>regular
3227 expressions</quote> are, or what they can do. So this will be a very brief
3228 introduction only. A full explanation would require a book ;-)
3232 <quote>Regular expressions</quote> is a way of matching one character
3233 expression against another to see if it matches or not. One of the
3234 <quote>expressions</quote> is a literal string of readable characters
3235 (letter, numbers, etc), and the other is a complex string of literal
3236 characters combined with wild-cards, and other special characters, called
3237 meta-characters. The <quote>meta-characters</quote> have special meanings and
3238 are used to build the complex pattern to be matched against. Perl Compatible
3239 Regular Expressions is an enhanced form of the regular expression language
3240 with backward compatibility.
3244 To make a simple analogy, we do something similar when we use wild-card
3245 characters when listing files with the <command>dir</command> command in DOS.
3246 <literal>*.*</literal> matches all filenames. The <quote>special</quote>
3247 character here is the asterisk which matches any and all characters. We can be
3248 more specific and use <literal>?</literal> to match just individual
3249 characters. So <quote>dir file?.text</quote> would match
3250 <quote>file1.txt</quote>, <quote>file2.txt</quote>, etc. We are pattern
3251 matching, using a similar technique to <quote>regular expressions</quote>!
3255 Regular expressions do essentially the same thing, but are much, much more
3256 powerful. There are many more <quote>special characters</quote> and ways of
3257 building complex patterns however. Let's look at a few of the common ones,
3258 and then some examples:
3263 <emphasis>.</emphasis> - Matches any single character, e.g. <quote>a</quote>,
3264 <quote>A</quote>, <quote>4</quote>, <quote>:</quote>, or <quote>@</quote>.
3270 <emphasis>?</emphasis> - The preceding character or expression is matched ZERO or ONE
3277 <emphasis>+</emphasis> - The preceding character or expression is matched ONE or MORE
3284 <emphasis>*</emphasis> - The preceding character or expression is matched ZERO or MORE
3291 <emphasis>\</emphasis> - The <quote>escape</quote> character denotes that
3292 the following character should be taken literally. This is used where one of the
3293 special characters (e.g. <quote>.</quote>) needs to be taken literally and
3294 not as a special meta-character.
3300 <emphasis>[]</emphasis> - Characters enclosed in brackets will be matched if
3301 any of the enclosed characters are encountered.
3307 <emphasis>()</emphasis> - parentheses are used to group a sub-expression,
3308 or multiple sub-expressions.
3314 <emphasis>|</emphasis> - The <quote>bar</quote> character works like an
3315 <quote>or</quote> conditional statement. A match is successful if the
3316 sub-expression on either side of <quote>|</quote> matches.
3322 <emphasis>s/string1/string2/g</emphasis> - This is used to rewrite strings of text.
3323 <quote>string1</quote> is replaced by <quote>string2</quote> in this
3329 These are just some of the ones you are likely to use when matching URLs with
3330 <application>Junkbuster</application>, and is a long way from a definitive
3331 list. This is enough to get us started with a few simple examples which may
3332 be more illuminating:
3336 <emphasis><literal>/.*/banners/.*</literal></emphasis> - A simple example
3337 that uses the common combination of <quote>.</quote> and <quote>*</quote> to
3338 denote any character, zero or more times. In other words, any string at all.
3339 So we start with a literal forward slash, then our regular expression pattern
3340 (<quote>.*</quote>) another literal forward slash, the string
3341 <quote>banners</quote>, another forward slash, and lastly another
3342 <quote>.*</quote>. We are building
3343 a directory path here. This will match any file with the path that has a
3344 directory named <quote>banners</quote> in it. The <quote>.*</quote> matches
3345 any characters, and this could conceivably be more forward slashes, so it
3346 might expand into a much longer looking path. For example, this could match:
3347 <quote>/eye/hate/spammers/banners/annoy_me_please.gif</quote>, or just
3348 <quote>/banners/annoying.html</quote>, or almost an infinite number of other
3349 possible combinations, just so it has <quote>banners</quote> in the path
3354 A now something a little more complex:
3358 <emphasis><literal>/.*/adv((er)?ts?|ertis(ing|ements?))?/</literal></emphasis> -
3359 We have several literal forward slashes again (<quote>/</quote>), so we are
3360 building another expression that is a file path statement. We have another
3361 <quote>.*</quote>, so we are matching against any conceivable sub-path, just so
3362 it matches our expression. The only true literal that <emphasis>must
3363 match</emphasis> our pattern is <application>adv</application>, together with
3364 the forward slashes. What comes after the <quote>adv</quote> string is the
3369 Remember the <quote>?</quote> means the preceding expression (either a
3370 literal character or anything grouped with <quote>(...)</quote> in this case)
3371 can exist or not, since this means either zero or one match. So
3372 <quote>((er)?ts?|ertis(ing|ements?))</quote> is optional, as are the
3373 individual sub-expressions: <quote>(er)</quote>,
3374 <quote>(ing|ements?)</quote>, and the <quote>s</quote>. The <quote>|</quote>
3375 means <quote>or</quote>. We have two of those. For instance,
3376 <quote>(ing|ements?)</quote>, can expand to match either <quote>ing</quote>
3377 <emphasis>OR</emphasis> <quote>ements?</quote>. What is being done here, is an
3378 attempt at matching as many variations of <quote>advertisement</quote>, and
3379 similar, as possible. So this would expand to match just <quote>adv</quote>,
3380 or <quote>advert</quote>, or <quote>adverts</quote>, or
3381 <quote>advertising</quote>, or <quote>advertisement</quote>, or
3382 <quote>advertisements</quote>. You get the idea. But it would not match
3383 <quote>advertizements</quote> (with a <quote>z</quote>). We could fix that by
3384 changing our regular expression to:
3385 <quote>/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/</quote>, which would then match
3390 <emphasis><literal>/.*/advert[0-9]+\.(gif|jpe?g)</literal></emphasis> - Again
3391 another path statement with forward slashes. Anything in the square brackets
3392 <quote>[]</quote> can be matched. This is using <quote>0-9</quote> as a
3393 shorthand expression to mean any digit one through nine. It is the same as
3394 saying <quote>0123456789</quote>. So any digit matches. The <quote>+</quote>
3395 means one or more of the preceding expression must be included. The preceding
3396 expression here is what is in the square brackets -- in this case, any digit
3397 one through nine. Then, at the end, we have a grouping: <quote>(gif|jpe?g)</quote>.
3398 This includes a <quote>|</quote>, so this needs to match the expression on
3399 either side of that bar character also. A simple <quote>gif</quote> on one side, and the other
3400 side will in turn match either <quote>jpeg</quote> or <quote>jpg</quote>,
3401 since the <quote>?</quote> means the letter <quote>e</quote> is optional and
3402 can be matched once or not at all. So we are building an expression here to
3403 match image GIF or JPEG type image file. It must include the literal
3404 string <quote>advert</quote>, then one or more digits, and a <quote>.</quote>
3405 (which is now a literal, and not a special character, since it is escaped
3406 with <quote>\</quote>), and lastly either <quote>gif</quote>, or
3407 <quote>jpeg</quote>, or <quote>jpg</quote>. Some possible matches would
3408 include: <quote>//advert1.jpg</quote>,
3409 <quote>/nasty/ads/advert1234.gif</quote>,
3410 <quote>/banners/from/hell/advert99.jpg</quote>. It would not match
3411 <quote>advert1.gif</quote> (no leading slash), or
3412 <quote>/adverts232.jpg</quote> (the expression does not include an
3413 <quote>s</quote>), or <quote>/advert1.jsp</quote> (<quote>jsp</quote> is not
3414 in the expression anywhere).
3418 <emphasis><literal>s/microsoft(?!.com)/MicroSuck/i</literal></emphasis> - This is
3419 a substitution. <quote>MicroSuck</quote> will replace any occurrence of
3420 <quote>microsoft</quote>. The <quote>i</quote> at the end of the expression
3421 means ignore case. The <quote>(?!.com)</quote> means
3422 the match should fail if <quote>microsoft</quote> is followed by
3423 <quote>.com</quote>. In other words, this acts like a <quote>NOT</quote>
3424 modifier. In case this is a hyperlink, we don't want to break it ;-).
3428 We are barely scratching the surface of regular expressions here so that you
3429 can understand the default <application>Junkbuster</application>
3430 configuration files, and maybe use this knowledge to customize your own
3431 installation. There is much, much more that can be done with regular
3432 expressions. Now that you know enough to get started, you can learn more on
3437 More reading on Perl Compatible Regular expressions:
3438 <ulink url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>
3447 This program is free software; you can redistribute it
3448 and/or modify it under the terms of the GNU General
3449 Public License as published by the Free Software
3450 Foundation; either version 2 of the License, or (at
3451 your option) any later version.
3453 This program is distributed in the hope that it will
3454 be useful, but WITHOUT ANY WARRANTY; without even the
3455 implied warranty of MERCHANTABILITY or FITNESS FOR A
3456 PARTICULAR PURPOSE. See the GNU General Public
3457 License for more details.
3459 The GNU General Public License should be included with
3460 this file. If not, you can view it at
3461 http://www.gnu.org/copyleft/gpl.html
3462 or write to the Free Software Foundation, Inc., 59
3463 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3465 $Log: user-manual.sgml,v $
3466 Revision 1.44 2002/03/09 17:08:48 hal9
3467 New section on Jon's actions file editor, and move some stuff around.
3469 Revision 1.43 2002/03/08 00:47:32 hal9
3470 Added imageblock{pattern}.
3472 Revision 1.42 2002/03/07 18:16:55 swa
3475 Revision 1.41 2002/03/07 16:46:43 hal9
3476 Fix a few markup problems for jade.
3478 Revision 1.40 2002/03/07 16:28:39 swa
3479 provide correct feedback channels
3481 Revision 1.39 2002/03/06 16:19:28 hal9
3482 Note on perceived filtering slowdown per FR.
3484 Revision 1.38 2002/03/05 23:55:14 hal9
3485 Stupid I did it again. Double hyphen in comment breaks jade.
3487 Revision 1.37 2002/03/05 23:53:49 hal9
3488 jade barfs on '- -' embedded in comments. - -user option broke it.
3490 Revision 1.36 2002/03/05 22:53:28 hal9
3491 Add new - - user option.
3493 Revision 1.35 2002/03/05 00:17:27 hal9
3494 Added section on command line options.
3496 Revision 1.34 2002/03/04 19:32:07 oes
3497 Changed default port to 8118
3499 Revision 1.33 2002/03/03 19:46:13 hal9
3500 Emphasis on where/how to report bugs, etc
3502 Revision 1.32 2002/03/03 09:26:06 joergs
3503 AmigaOS changes, config is now loaded from PROGDIR: instead of
3504 AmiTCP:db/junkbuster/ if no configuration file is specified on the
3507 Revision 1.31 2002/03/02 22:45:52 david__schmidt
3510 Revision 1.30 2002/03/02 22:00:14 hal9
3511 Updated 'New Features' list. Ran through spell-checker.
3513 Revision 1.29 2002/03/02 20:34:07 david__schmidt
3514 Update OS/2 build section
3516 Revision 1.28 2002/02/24 14:34:24 jongfoster
3517 Formatting changes. Now changing the doctype to DocBook XML 4.1
3518 will work - no other changes are needed.
3520 Revision 1.27 2002/01/11 14:14:32 hal9
3521 Added a very short section on Templates
3523 Revision 1.26 2002/01/09 20:02:50 hal9
3524 Fix bug re: auto-detect config file changes.
3526 Revision 1.25 2002/01/09 18:20:30 hal9
3527 Touch ups for *.action files.
3529 Revision 1.24 2001/12/02 01:13:42 hal9
3532 Revision 1.23 2001/12/02 00:20:41 hal9
3533 Updates for recent changes.
3535 Revision 1.22 2001/11/05 23:57:51 hal9
3536 Minor update for startup now daemon mode.
3538 Revision 1.21 2001/10/31 21:11:03 hal9
3539 Correct 2 minor errors
3541 Revision 1.18 2001/10/24 18:45:26 hal9
3542 *** empty log message ***
3544 Revision 1.17 2001/10/24 17:10:55 hal9
3545 Catching up with Jon's recent work, and a few other things.
3547 Revision 1.16 2001/10/21 17:19:21 swa
3548 wrong url in documentation
3550 Revision 1.15 2001/10/14 23:46:24 hal9
3551 Various minor changes. Fleshed out SEE ALSO section.
3553 Revision 1.13 2001/10/10 17:28:33 hal9
3556 Revision 1.12 2001/09/28 02:57:04 hal9
3559 Revision 1.11 2001/09/28 02:25:20 hal9
3562 Revision 1.9 2001/09/27 23:50:29 hal9
3563 A few changes. A short section on regular expression in appendix.
3565 Revision 1.8 2001/09/25 00:34:59 hal9
3566 Some additions, and re-arranging.
3568 Revision 1.7 2001/09/24 14:31:36 hal9
3571 Revision 1.6 2001/09/24 14:10:32 hal9
3572 Including David's OS/2 installation instructions.
3574 Revision 1.2 2001/09/13 15:27:40 swa
3577 Revision 1.1 2001/09/12 15:36:41 swa
3578 source files for junkbuster documentation
3580 Revision 1.3 2001/09/10 17:43:59 swa
3581 first proposal of a structure.
3583 Revision 1.2 2001/06/13 14:28:31 swa
3584 docs should have an author.
3586 Revision 1.1 2001/06/13 14:20:37 swa
3587 first import of project's documentation for the webserver.