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.46 2002/03/10 00:51:08 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.46 2002/03/10 00:51:08 hal9 Exp $</pubdate>
36 <orgname>By: Junkbuster Developers</orgname>
43 The user manual gives users information on how to install, configure and use
44 <application>Internet Junkbuster</application>. <application>Internet
45 Junkbuster</application> is a web proxy with advanced filtering capabilities
46 for protecting privacy, filtering web page content, managing cookies,
47 controlling access, and removing ads, banners, pop-ups and other obnoxious
48 Internet Junk. Junkbuster has a very flexible configuration and can be
49 customized to suit individual needs and tastes. <application>Internet
50 Junkbuster</application> has application for both stand-alone systems and
54 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>.
58 <!-- Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>. -->
65 <!-- ~~~~~ New section ~~~~~ -->
67 <sect1 id="introduction"><title>Introduction</title>
69 <application>Internet Junkbuster</application> is a web proxy with advanced
70 filtering capabilities for protecting privacy, filtering and modifying web
71 page content, managing cookies, controlling access, and removing ads,
72 banners, pop-ups and other obnoxious Internet Junk.
73 <application>Junkbuster</application> has a very flexible configuration and
74 can be customized to suit individual needs and tastes. <application>Internet
75 Junkbuster</application> has application for both stand-alone systems and
80 This documentation is included with the current BETA version of
81 <application>Internet Junkbuster</application> and is mostly complete at this
82 point. The most up to date reference for the time being is still the comments
83 in the source files and in the individual configuration files. Development
84 of version 3.0 is currently nearing completion, and includes many significant
85 changes and enhancements over earlier versions. The target release date for
86 stable v3.0 is <quote>soon</quote> ;-)
90 Since this is a BETA version, not all new features are well tested. This
91 documentation may be slightly out of sync as a result (especially with
92 CVS sources). And there <emphasis>may be</emphasis> bugs, though hopefully
97 <!-- ~~~~~ New section ~~~~~ -->
99 <title>New Features</title>
101 In addition to <application>Junkbuster's</application> traditional features
102 of ad and banner blocking and cookie management, this is a list of new
103 features currently under development:
111 Integrated browser based configuration and control utility (<ulink
112 url="http://i.j.b">http://i.j.b</ulink>). Browser-based tracing of rule
119 Modularized configuration that will allow for system wide settings, and
120 individual user settings. (not implemented yet, probably a 3.1 feature)
126 Blocking of annoying pop-up browser windows.
132 HTTP/1.1 compliant (most, but not all 1.1 features are supported).
138 Support for Perl Compatible Regular Expressions in the configuration files, and
139 generally a more sophisticated and flexible configuration syntax over
152 Web page content filtering (removes banners based on size,
153 invisible <quote>web-bugs</quote>, JavaScript, pop-ups, status bar abuse,
160 Bypass many click-tracking scripts (avoids script redirection).
167 Multi-threaded (POSIX and native threads).
173 Auto-detection and re-reading of config file changes.
179 User-customizable HTML templates (e.g. 404 error page).
185 Improved cookie management features (e.g. session based cookies).
191 Builds from source on most UNIX-like systems. Packages available for: Linux
192 (RedHat, SuSE, or Debian), Windows, Sun Solaris, Mac OSX, OS/2, HP-UX 11 and AmigaOS.
199 In addition, the configuration is much more powerful and versatile over-all.
210 <!-- ~ End section ~ -->
213 <!-- ~~~~~ New section ~~~~~ -->
214 <sect1 id="installation"><title>Installation</title>
216 <application>Junkbuster</application> is available as raw source code, or
217 pre-compiled binaries. See the <ulink
218 url="http://sourceforge.net/projects/ijbswa/">Junkbuster Home Page</ulink>
219 for binaries and current release info. <application>Junkbuster</application>
220 is also available via <ulink
221 url="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ijbswa/current/">CVS</ulink>.
222 This is the recommended approach at this time. But please be aware that CVS
223 is constantly changing, and it may break in mysterious ways.
226 <!-- ~~~~~ New section ~~~~~ -->
227 <sect2 id="installation-source"><title>Source</title>
229 For gzipped tar archives, unpack the source:
234 tar xzvf ijb_source_* [.tgz or .tar.gz]
235 cd ijb_source_2.9.11_beta
240 For retrieving the current CVS sources, you'll need the CVS
241 package installed first. To download CVS source:
246 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
247 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co current
253 This will create a directory named <filename>current/</filename>, which will
254 contain the source tree.
258 Then, in either case, to build from tarball/CVS source:
263 ./configure (--help to see options)
264 make (the make from gnu, gmake for *BSD)
266 make -n install (to see where all the files will go)
267 make install (to really install)
272 For Redhat and SuSE Linux RPM packages, see below.
278 <!-- ~~~~~ New section ~~~~~ -->
279 <sect2 id="installation-rh"><title>Red Hat</title>
281 To build Redhat RPM packages, install source as above. Then:
286 autoheader [suggested for CVS source]
287 autoconf [suggested for CVS source]
294 This will create both binary and src RPMs in the usual places. Example:
298 /usr/src/redhat/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
301 /usr/src/redhat/SRPMS/junkbuster-2.9.11-1.src.rpm
305 To install, of course:
310 rpm -Uvv /usr/src/redhat/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
315 This will place the <application>Junkbuster</application> configuration
316 files in <filename>/etc/junkbuster/</filename>, and log files in
317 <filename>/var/log/junkbuster/</filename>.
322 <!-- ~~~~~ New section ~~~~~ -->
323 <sect2 id="installation-suse"><title>SuSE</title>
325 To build SuSE RPM packages, install source as above. Then:
330 autoheader [suggested for CVS source]
331 autoconf [suggested for CVS source]
338 This will create both binary and src RPMs in the usual places. Example:
342 /usr/src/packages/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
345 /usr/src/packages/SRPMS/junkbuster-2.9.11-1.src.rpm
349 To install, of course:
354 rpm -Uvv /usr/src/packages/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
359 This will place the <application>Junkbuster</application> configuration
360 files in <filename>/etc/junkbuster/</filename>, and log files in
361 <filename>/var/log/junkbuster/</filename>.
367 <!-- ~~~~~ New section ~~~~~ -->
368 <sect2 id="installation-os2"><title>OS/2</title>
375 <application>Junkbuster</application> is packaged in a WarpIN self-
376 installing archive. The self-installing program will be named depending
377 on the release version, something like:
378 <filename>ijbos2_setup_1.2.3.exe</filename>. In order to install it, simply
379 run this executable or double-click on its icon and follow the WarpIN
380 installation panels. A shadow of the <application>Junkbuster</application>
381 executable will be placed in your startup folder so it will start
382 automatically whenever OS/2 starts.
386 The directory you choose to install <application>Junkbuster</application>
387 into will contain all of the configuration files.
391 If you would like to build binary images on OS/2 yourself, you will need
392 a few Unix-like tools: autoconf, autoheader and sh. These tools will be
393 used to create the required config.h file, which is not part of the
394 source distribution because it differs based on platform. You will also
396 The distribution has been created using IBM VisualAge compilers, but you
397 can use any compiler you like. GCC/EMX has the disadvantage of needing
398 to be single-threaded due to a limitation of EMX's implementation of the
399 select() socket call.
403 In addition to needing the source code distribution as outlined earlier,
404 you will want to extract the <filename>os2seutp</filename> directory from CVS:
406 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
407 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co os2setup
409 This will create a directory named os2setup/, which will contain the
410 <filename>Makefile.vac</filename> makefile and <filename>os2build.cmd</filename>
411 which is used to completely create the binary distribution. The sequence
412 of events for building the executable for yourself goes something like this:
419 nmake -f Makefile.vac
421 You will see this sequence laid out in <filename>os2build.cmd</filename>.
427 <!-- ~~~~~ New section ~~~~~ -->
428 <sect2 id="installation-win"><title>Windows</title>
429 <para>Click-click. (I need help on this. Not a clue here. Also for
430 configuration section below. HB.)
434 <!-- ~~~~~ New section ~~~~~ -->
435 <sect2 id="installation-other"><title>Other</title>
437 Some quick notes on other Operating Systems.
441 For FreeBSD (and other *BSDs?), the build will require <command>gmake</command>
442 instead of the included <command>make</command>. <command>gmake</command> is
443 available from <ulink url="http://www.gnu.org">http://www.gnu.org</ulink>.
444 The rest should be the same as above for Linux/Unix.
451 <!-- ~ End section ~ -->
454 <!-- ~~~~~ New section ~~~~~ -->
455 <sect1 id="configuration"><title>JunkBuster Configuration</title>
457 All <application>JunkBuster</application> configuration is kept
458 in text files. These files can be edited with a text editor.
459 Many important aspects of <application>JunkBuster</application> can
460 also be controlled easily with a web browser.
465 <!-- ~~~~~ New section ~~~~~ -->
468 <title>Controlling Junkbuster with Your Web Browser</title>
470 <application>JunkBuster</application> can be reached by the special
471 URL <ulink url="http://i.j.b/">http://i.j.b/</ulink> (or alternately
472 <ulink url="http://ijbswa.sourceforge.net/config/">http://ijbswa.sourceforge.net/config/</ulink>,
473 which is an internal page. You will see the following section:
480 Please choose from the following options:
482 * Show information about the current configuration
483 * Show the source code version numbers
484 * Show the client's request headers.
485 * Show which actions apply to a URL and why
486 * Toggle JunkBuster on or off
487 * Edit the actions list
493 This should be self-explanatory. Note the last item is an editor for the
494 <quote>actions list</quote>, which is where much of the ad, banner, cookie,
495 and URL blocking magic is configured as well as other advanced features of
496 <application>Junkbuster</application>. This is an easy way to adjust various
497 aspects of <application>Junkbuster</application> configuration. The actions
498 file, and other configuration files, are explained in detail below.
499 <application>Junkbuster</application> will automatically detect any changes
504 <quote>Toggle JunkBuster On or Off</quote> is handy for sites that might
505 have problems with your current actions and filters, or just to test if
506 a site misbehaves, whether it is <application>JunkBuster</application>
507 causing the problem or not. <application>Junkbuster</application> continues
508 to run as a proxy in this case, but all filtering is disabled.
514 <!-- ~ End section ~ -->
519 <!-- ~~~~~ New section ~~~~~ -->
522 <title>Configuration Files Overview</title>
524 For Unix, *BSD and Linux, all configuration files are located in
525 <filename>/etc/junkbuster/</filename> by default. For MS Windows, OS/2, and
526 AmigaOS these are all in the same directory as the
527 <application>Junkbuster</application> executable. The name and number of
528 configuration files has changed from previous versions, and is subject to
529 change as development progresses.
533 The installed defaults provide a reasonable starting point, though possibly
534 aggressive by some standards. For the time being, there are only three
535 default configuration files (this will change in time):
543 The main configuration file is named <filename>config</filename>
544 on Linux, Unix, BSD, OS/2, and AmigaOS and <filename>config.txt</filename>
551 The <filename>ijb.action</filename> file is used to define various
552 <quote>actions</quote> relating to images, banners, pop-ups, access
553 restrictions, banners and cookies. There is a CGI based editor for this
554 file that can be accessed via <ulink
555 url="http://i.j.b">http://i.j.b</ulink>. (Other actions
556 files are included as well with differing levels of filtering
557 and blocking, e.g. <filename>ijb-basic.action</filename>.)
563 The <filename>re_filterfile</filename> file can be used to rewrite the raw
564 page content, including text as well as embedded HTML and JavaScript.
572 <filename>ijb.action</filename> and <filename>re_filterfile</filename>
573 can use Perl style regular expressions for maximum flexibility. All files use
574 the <quote><literal>#</literal></quote> character to denote a comment. Such
575 lines are not processed by <application>Junkbuster</application>. After
576 making any changes, there is no need to restart
577 <application>Junkbuster</application> in order for the changes to take
578 effect. <application>Junkbuster</application> should detect such changes
583 While under development, the configuration content is subject to change.
584 The below documentation may not be accurate by the time you read this.
585 Also, what constitutes a <quote>default</quote> setting, may change, so
586 please check all your configuration files on important issues.
591 <!-- ~~~~~ New section ~~~~~ -->
594 <title>The Main Configuration File</title>
596 Again, the main configuration file is named <filename>config</filename> on
597 Linux/Unix/BSD and OS/2, and <filename>config.txt</filename> on Windows.
598 Configuration lines consist of an initial keyword followed by a list of
599 values, all separated by whitespace (any number of spaces or tabs). For
607 <emphasis>blockfile blocklist.ini</emphasis>
614 Indicates that the blockfile is named <quote>blocklist.ini</quote>.
618 A <quote><literal>#</literal></quote> indicates a comment. Any part of a
619 line following a <quote><literal>#</literal></quote> is ignored, except if
620 the <quote><literal>#</literal></quote> is preceded by a
621 <quote><literal>\</literal></quote>.
625 Thus, by placing a <quote><literal>#</literal></quote> at the start of an
626 existing configuration line, you can make it a comment and it will be treated
627 as if it weren't there. This is called <quote>commenting out</quote> an
628 option and can be useful to turn off features: If you comment out the
629 <quote>logfile</quote> line, <application>junkbuster</application> will not
630 log to a file at all. Watch for the <quote>default:</quote> section in each
631 explanation to see what happens if the option is left unset (or commented
636 Long lines can be continued on the next line by using a
637 <quote><literal>\</literal></quote> as the very last character.
641 There are various aspects of <application>Junkbuster</application> behavior
646 <!-- ~~~~~ New section ~~~~~ -->
649 <title>Defining Other Configuration Files</title>
652 <application>Junkbuster</application> can use a number of other files to tell it
653 what ads to block, what cookies to accept, etc. This section of the
654 configuration file tells <application>Junkbuster</application> where to find
655 all those other files.
659 On <application>Windows</application> and <application>AmigaOS</application>,
660 <application>Junkbuster</application> looks for these files in the same
661 directory as the executable. On Unix and OS/2,
662 <application>Junkbuster</application> looks for these files in the current
663 working directory. In either case, an absolute path name can be used to
668 When development goes modular and multi-user, the blocker, filter, and
669 per-user config will be stored in subdirectories of <quote>confdir</quote>.
670 For now, only <filename>confdir/templates</filename> is used for storing HTML
671 templates for CGI results.
675 The location of the configuration files:
682 <emphasis>confdir /etc/junkbuster</emphasis> # No trailing /, please.
689 The directory where all logging (i.e. <filename>logfile</filename> and
690 <filename>jarfile</filename>) takes place. No trailing
691 <quote><literal>/</literal></quote>, please:
698 <emphasis>logdir /var/log/junkbuster</emphasis>
705 Note that all file specifications below are relative to
706 the above two directories!
710 The <quote>ijb.action</quote> file contains patterns to specify the actions to
711 apply to requests for each site. Default: Cookies to and from all
712 destinations are kept only during the current browser session (i.e. they
713 are not saved to disk). Pop-ups are disabled for all sites. All sites are
714 filtered if <quote>re_filterfile</quote> specified according to the
715 contents of <quote>re_filterfile</quote>. No sites are blocked. The
716 JunkBuster logo is displayed for filtered ads and other images . The syntax
717 of this file is explained in detail <link
718 linkend="actionsfile">below</link>.
725 <emphasis>actionsfile ijb.action</emphasis>
732 The <quote>re_filterfile</quote> file contains content modification rules.
733 These rules permit powerful changes on the content of Web pages, e.g., you
734 could disable your favorite JavaScript annoyances, rewrite the actual
735 content, or just have some fun replacing <quote>Microsoft</quote> with
736 <quote>MicroSuck</quote> wherever it appears on a Web page. Default: No
737 content modification, or whatever the developers are playing with :-/
741 Filtering requires buffering the page content, which may appear to slow down
742 page rendering since nothing is displayed until all content has passed
743 the filters. (It does not really take longer, but seems that way since
744 the page is not incrementally displayed.) This effect will be more noticeable
745 on slower connections.
753 <emphasis>re_filterfile re_filterfile</emphasis>
760 The logfile is where all logging and error messages are written. The logfile
761 can be useful for tracking down a problem with
762 <application>Junkbuster</application> (e.g., it's not blocking an ad you
763 think it should block) but in most cases you probably will never look at it.
767 Your logfile will grow indefinitely, and you will probably want to
768 periodically remove it. On Unix systems, you can do this with a cron job
769 (see <quote>man cron</quote>). For Redhat, a <command>logrotate</command>
770 script has been included.
774 On SuSE Linux systems, you can place a line like <quote>/var/log/junkbuster.*
775 +1024k 644 nobody.nogroup</quote> in <filename>/etc/logfiles</filename>, with
776 the effect that cron.daily will automatically archive, gzip, and empty the
777 log, when it exceeds 1M size.
781 Default: Log to the a file named <filename>logfile</filename>.
782 Comment out to disable logging.
789 <emphasis>logfile logfile</emphasis>
796 The <quote>jarfile</quote> defines where
797 <application>Junkbuster</application> stores the cookies it intercepts. Note
798 that if you use a <quote>jarfile</quote>, it may grow quite large. Default:
799 Don't store intercepted cookies.
806 <emphasis>#jarfile jarfile</emphasis>
813 If you specify a <quote>trustfile</quote>,
814 <application>Junkbuster</application> will only allow access to sites that
815 are named in the trustfile. You can also mark sites as trusted referrers,
816 with the effect that access to untrusted sites will be granted, if a link
817 from a trusted referrer was used. The link target will then be added to the
818 <quote>trustfile</quote>. This is a very restrictive feature that typical
819 users most probably want to leave disabled. Default: Disabled, don't use the
827 <emphasis>#trustfile trust</emphasis>
834 If you use the trust mechanism, it is a good idea to write up some on-line
835 documentation about your blocking policy and to specify the URL(s) here. They
836 will appear on the page that your users receive when they try to access
837 untrusted content. Use multiple times for multiple URLs. Default: Don't
838 display links on the <quote>untrusted</quote> info page.
845 <emphasis>trust-info-url http://www.your-site.com/why_we_block.html</emphasis>
846 <emphasis>trust-info-url http://www.your-site.com/what_we_allow.html</emphasis>
854 <!-- ~ End section ~ -->
858 <!-- ~~~~~ New section ~~~~~ -->
861 <title>Other Configuration Options</title>
864 This part of the configuration file contains options that control how
865 <application>Junkbuster</application> operates.
869 <quote>Admin-address</quote> should be set to the email address of the proxy
870 administrator. It is used in many of the proxy-generated pages. Default:
878 <emphasis>#admin-address fill@me.in.please</emphasis>
885 <quote>Proxy-info-url</quote> can be set to a URL that contains more info
886 about this <application>Junkbuster</application> installation, it's
887 configuration and policies. It is used in many of the proxy-generated pages
888 and its use is highly recommended in multi-user installations, since your
889 users will want to know why certain content is blocked or modified. Default:
890 Don't show a link to on-line documentation.
897 <emphasis>proxy-info-url http://www.your-site.com/proxy.html</emphasis>
904 <quote>Listen-address</quote> specifies the address and port where
905 <application>Junkbuster</application> will listen for connections from your
906 Web browser. The default is to listen on the localhost port 8118, and
907 this is suitable for most users. (In your web browser, under proxy
908 configuration, list the proxy server as <quote>localhost</quote> and the
909 port as <quote>8118</quote>).
913 If you already have another service running on port 8118, or if you want to
914 serve requests from other machines (e.g. on your local network) as well, you
915 will need to override the default. The syntax is
916 <quote>listen-address [<ip-address>]:<port></quote>. If you leave
917 out the IP address, <application>junkbuster</application> will bind to all
918 interfaces (addresses) on your machine and may become reachable from the
919 Internet. In that case, consider using access control lists (acl's) (see
920 <quote>aclfile</quote> above), or a firewall.
924 For example, suppose you are running <application>Junkbuster</application> on
925 a machine which has the address 192.168.0.1 on your local private network
926 (192.168.0.0) and has another outside connection with a different address.
927 You want it to serve requests from inside only:
934 <emphasis>listen-address 192.168.0.1:8118</emphasis>
941 If you want it to listen on all addresses (including the outside
949 <emphasis>listen-address :8118</emphasis>
956 If you do this, consider using ACLs (see <quote>aclfile</quote> above). Note:
957 you will need to point your browser(s) to the address and port that you have
958 configured here. Default: localhost:8118 (127.0.0.1:8118).
962 The debug option sets the level of debugging information to log in the
963 logfile (and to the console in the Windows version). A debug level of 1 is
964 informative because it will show you each request as it happens. Higher
965 levels of debug are probably only of interest to developers.
972 debug 1 # GPC = show each GET/POST/CONNECT request
973 debug 2 # CONN = show each connection status
974 debug 4 # IO = show I/O status
975 debug 8 # HDR = show header parsing
976 debug 16 # LOG = log all data into the logfile
977 debug 32 # FRC = debug force feature
978 debug 64 # REF = debug regular expression filter
979 debug 128 # = debug fast redirects
980 debug 256 # = debug GIF de-animation
981 debug 512 # CLF = Common Log Format
982 debug 1024 # = debug kill pop-ups
983 debug 4096 # INFO = Startup banner and warnings.
984 debug 8192 # ERROR = Non-fatal errors
991 It is <emphasis>highly recommended</emphasis> that you enable ERROR
992 reporting (debug 8192), at least until the next stable release.
996 The reporting of FATAL errors (i.e. ones which crash
997 <application>JunkBuster</application>) is always on and cannot be disabled.
1001 If you want to use CLF (Common Log Format), you should set <quote>debug
1002 512</quote> ONLY, do not enable anything else.
1006 Multiple <quote>debug</quote> directives, are OK - they're logical-OR'd
1014 <emphasis>debug 15 # same as setting the first 4 listed above</emphasis>
1028 <emphasis>debug 1 # URLs</emphasis>
1029 <emphasis>debug 4096 # Info</emphasis>
1030 <emphasis>debug 8192 # Errors - *we highly recommended enabling this*</emphasis>
1037 <application>Junkbuster</application> normally uses
1038 <quote>multi-threading</quote>, a software technique that permits it to
1039 handle many different requests simultaneously. In some cases you may wish to
1040 disable this -- particularly if you're trying to debug a problem. The
1041 <quote>single-threaded</quote> option forces
1042 <application>Junkbuster</application> to handle requests sequentially.
1043 Default: Multi-threaded mode.
1050 <emphasis>#single-threaded</emphasis>
1057 <quote>toggle</quote> allows you to temporarily disable all
1058 <application>Junkbuster's</application> filtering. Just set <quote>toggle
1063 The Windows version of <application>Junkbuster</application> puts an icon in
1064 the system tray, which also allows you to change this option. If you
1065 right-click on that icon (or select the <quote>Options</quote> menu), one
1066 choice is <quote>Enable</quote>. Clicking on enable toggles
1067 <application>Junkbuster</application> on and off. This is useful if you want
1068 to temporarily disable <application>Junkbuster</application>, e.g., to access
1069 a site that requires cookies which you would otherwise have blocked. This can also
1070 be toggled via a web browser at the <application>Junkbuster</application>
1071 internal address of <ulink url="http://i.j.b">http://i.j.b</ulink> on
1076 <quote>toggle 1</quote> means <application>Junkbuster</application> runs
1077 normally, <quote>toggle 0</quote> means that
1078 <application>Junkbuster</application> becomes a non-anonymizing non-blocking
1079 proxy. Default: 1 (on).
1086 <emphasis>toggle 1</emphasis>
1093 For content filtering, i.e. the <quote>+filter</quote> and
1094 <quote>+deanimate-gif</quote> actions, it is necessary that
1095 <application>Junkbuster</application> buffers the entire document body.
1096 This can be potentially dangerous, since a server could just keep sending
1097 data indefinitely and wait for your RAM to exhaust. With nasty consequences.
1101 The <application>buffer-limit</application> option lets you set the maximum
1102 size in Kbytes that each buffer may use. When the documents buffer exceeds
1103 this size, it is flushed to the client unfiltered and no further attempt to
1104 filter the rest of it is made. Remember that there may multiple threads
1105 running, which might require increasing the <quote>buffer-limit</quote>
1106 Kbytes <emphasis>each</emphasis>, unless you have enabled
1107 <quote>single-threaded</quote> above.
1114 <emphasis>buffer-limit 4069</emphasis>
1121 To enable the web-based <filename>ijb.action</filename> file editor set
1122 <application>enable-edit-actions</application> to 1, or 0 to disable. Note
1123 that you must have compiled <application>JunkBuster</application> with
1124 support for this feature, otherwise this option has no effect. This
1125 internal page can be reached at <ulink
1126 url="http://i.j.b">http://i.j.b</ulink>.
1130 Security note: If this is enabled, anyone who can use the proxy
1131 can edit the actions file, and their changes will affect all users.
1132 For shared proxies, you probably want to disable this. Default: enabled.
1139 <emphasis>enable-edit-actions 1</emphasis>
1146 Allow <application>JunkBuster</application> to be toggled on and off
1147 remotely, using your web browser. Set <quote>enable-remote-toggle</quote>to
1148 1 to enable, and 0 to disable. Note that you must have compiled
1149 <application>JunkBuster</application> with support for this feature,
1150 otherwise this option has no effect.
1154 Security note: If this is enabled, anyone who can use the proxy can toggle
1155 it on or off (see <ulink url="http://i.j.b">http://i.j.b</ulink>), and
1156 their changes will affect all users. For shared proxies, you probably want to
1157 disable this. Default: enabled.
1164 <emphasis>enable-remote-toggle 1</emphasis>
1172 <!-- ~ End section ~ -->
1175 <!-- ~~~~~ New section ~~~~~ -->
1178 <title>Access Control List (ACL)</title>
1180 Access controls are included at the request of some ISPs and systems
1181 administrators, and are not usually needed by individual users. Please note
1182 the warnings in the FAQ that this proxy is not intended to be a substitute
1183 for a firewall or to encourage anyone to defer addressing basic security
1188 If no access settings are specified, the proxy talks to anyone that
1189 connects. If any access settings file are specified, then the proxy
1190 talks only to IP addresses permitted somewhere in this file and not
1191 denied later in this file.
1195 Summary -- if using an ACL:
1200 Client must have permission to receive service.
1205 LAST match in ACL wins.
1210 Default behavior is to deny service.
1215 The syntax for an entry in the Access Control List is:
1222 ACTION SRC_ADDR[/SRC_MASKLEN] [ DST_ADDR[/DST_MASKLEN] ]
1229 Where the individual fields are:
1236 <emphasis>ACTION</emphasis> = <quote>permit-access</quote> or <quote>deny-access</quote>
1238 <emphasis>SRC_ADDR</emphasis> = client hostname or dotted IP address
1239 <emphasis>SRC_MASKLEN</emphasis> = number of bits in the subnet mask for the source
1241 <emphasis>DST_ADDR</emphasis> = server or forwarder hostname or dotted IP address
1242 <emphasis>DST_MASKLEN</emphasis> = number of bits in the subnet mask for the target
1250 The field separator (FS) is whitespace (space or tab).
1254 IMPORTANT NOTE: If the <application>junkbuster</application> is using a
1255 forwarder (see below) or a gateway for a particular destination URL, the
1256 <literal>DST_ADDR</literal> that is examined is the address of the forwarder
1257 or the gateway and <emphasis>NOT</emphasis> the address of the ultimate
1258 target. This is necessary because it may be impossible for the local
1259 <application>Junkbuster</application> to determine the address of the
1260 ultimate target (that's often what gateways are used for).
1264 Here are a few examples to show how the ACL features work:
1268 <quote>localhost</quote> is OK -- no DST_ADDR implies that
1269 <emphasis>ALL</emphasis> destination addresses are OK:
1276 <emphasis>permit-access localhost</emphasis>
1283 A silly example to illustrate permitting any host on the class-C subnet with
1284 <application>Junkbuster</application> to go anywhere:
1291 <emphasis>permit-access www.junkbusters.com/24</emphasis>
1298 Except deny one particular IP address from using it at all:
1305 <emphasis>deny-access ident.junkbusters.com</emphasis>
1312 You can also specify an explicit network address and subnet mask.
1313 Explicit addresses do not have to be resolved to be used.
1320 <emphasis>permit-access 207.153.200.0/24</emphasis>
1327 A subnet mask of 0 matches anything, so the next line permits everyone.
1334 <emphasis>permit-access 0.0.0.0/0</emphasis>
1341 Note, you <emphasis>cannot</emphasis> say:
1348 <emphasis>permit-access .org</emphasis>
1355 to allow all *.org domains. Every IP address listed must resolve fully.
1359 An ISP may want to provide a <application>Junkbuster</application> that is
1360 accessible by <quote>the world</quote> and yet restrict use of some of their
1361 private content to hosts on its internal network (i.e. its own subscribers).
1362 Say, for instance the ISP owns the Class-B IP address block 123.124.0.0 (a 16
1363 bit netmask). This is how they could do it:
1370 <emphasis>permit-access 0.0.0.0/0 0.0.0.0/0</emphasis> # other clients can go anywhere
1371 # with the following exceptions:
1373 <emphasis>deny-access</emphasis> 0.0.0.0/0 123.124.0.0/16 # block all external requests for
1374 # sites on the ISP's network
1376 <emphasis>permit 0.0.0.0/0 www.my_isp.com</emphasis> # except for the ISP's main
1379 <emphasis>permit 123.124.0.0/16 0.0.0.0/0</emphasis> # the ISP's clients can go
1387 Note that if some hostnames are listed with multiple IP addresses,
1388 the primary value returned by DNS (via gethostbyname()) is used. Default:
1389 Anyone can access the proxy.
1394 <!-- ~ End section ~ -->
1397 <!-- ~~~~~ New section ~~~~~ -->
1400 <title>Forwarding</title>
1403 This feature allows chaining of HTTP requests via multiple proxies.
1404 It can be used to better protect privacy and confidentiality when
1405 accessing specific domains by routing requests to those domains
1406 to a special purpose filtering proxy such as lpwa.com. Or to use
1407 a caching proxy to speed up browsing.
1411 It can also be used in an environment with multiple networks to route
1412 requests via multiple gateways allowing transparent access to multiple
1413 networks without having to modify browser configurations.
1417 Also specified here are SOCKS proxies. <application>Junkbuster</application>
1418 SOCKS 4 and SOCKS 4A. The difference is that SOCKS 4A will resolve the target
1419 hostname using DNS on the SOCKS server, not our local DNS client.
1423 The syntax of each line is:
1430 <emphasis>forward target_domain[:port] http_proxy_host[:port]</emphasis>
1431 <emphasis>forward-socks4 target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]</emphasis>
1432 <emphasis>forward-socks4a target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]</emphasis>
1439 If http_proxy_host is <quote>.</quote>, then requests are not forwarded to a
1440 HTTP proxy but are made directly to the web servers.
1444 Lines are checked in sequence, and the last match wins.
1448 There is an implicit line equivalent to the following, which specifies that
1449 anything not finding a match on the list is to go out without forwarding
1450 or gateway protocol, like so:
1457 <emphasis>forward .* . </emphasis># implicit
1464 In the following common configuration, everything goes to Lucent's LPWA,
1465 except SSL on port 443 (which it doesn't handle):
1472 <emphasis>forward .* lpwa.com:8000</emphasis>
1473 <emphasis>forward :443 .</emphasis>
1480 See the FAQ for instructions on how to automate the login procedure for LPWA.
1481 Some users have reported difficulties related to LPWA's use of
1482 <quote>.</quote> as the last element of the domain, and have said that this
1483 can be fixed with this:
1490 <emphasis>forward lpwa. lpwa.com:8000</emphasis>
1497 (NOTE: the syntax for specifying target_domain has changed since the
1498 previous paragraph was written -- it will not work now. More information
1503 In this fictitious example, everything goes via an ISP's caching proxy,
1504 except requests to that ISP:
1511 <emphasis>forward .* caching.myisp.net:8000</emphasis>
1512 <emphasis>forward myisp.net .</emphasis>
1519 For the @home network, we're told the forwarding configuration is this:
1527 <emphasis>forward .* proxy:8080</emphasis>
1534 Also, we're told they insist on getting cookies and JavaScript, so you should
1535 add home.com to the cookie file. We consider JavaScript a security risk.
1536 Java need not be enabled.
1540 In this example direct connections are made to all <quote>internal</quote>
1541 domains, but everything else goes through Lucent's LPWA by way of the
1542 company's SOCKS gateway to the Internet.
1549 <emphasis>forward-socks4 .* lpwa.com:8000 firewall.my_company.com:1080</emphasis>
1550 <emphasis>forward my_company.com .</emphasis>
1557 This is how you could set up a site that always uses SOCKS but no forwarders:
1564 <emphasis>forward-socks4a .* . firewall.my_company.com:1080</emphasis>
1571 An advanced example for network administrators:
1575 If you have links to multiple ISPs that provide various special content to
1576 their subscribers, you can configure forwarding to pass requests to the
1577 specific host that's connected to that ISP so that everybody can see all
1578 of the content on all of the ISPs.
1582 This is a bit tricky, but here's an example:
1587 host-a has a PPP connection to isp-a.com. And host-b has a PPP connection to
1588 isp-b.com. host-a can run a <application>Junkbuster</application> proxy with
1589 forwarding like this:
1596 <emphasis>forward .* .</emphasis>
1597 <emphasis>forward isp-b.com host-b:8118</emphasis>
1604 host-b can run a <application>Junkbuster</application> proxy with forwarding
1612 <emphasis>forward .* .</emphasis>
1613 <emphasis>forward isp-a.com host-a:8118</emphasis>
1620 Now, <emphasis>anyone</emphasis> on the Internet (including users on host-a
1621 and host-b) can set their browser's proxy to <emphasis>either</emphasis>
1622 host-a or host-b and be able to browse the content on isp-a or isp-b.
1626 Here's another practical example, for University of Kent at
1627 Canterbury students with a network connection in their room, who
1628 need to use the University's Squid web cache.
1635 <emphasis>forward *. ssbcache.ukc.ac.uk:3128</emphasis> # Use the proxy, except for:
1636 <emphasis>forward .ukc.ac.uk . </emphasis> # Anything on the same domain as us
1637 <emphasis>forward * . </emphasis> # Host with no domain specified
1638 <emphasis>forward 129.12.*.* . </emphasis> # A dotted IP on our /16 network.
1639 <emphasis>forward 127.*.*.* . </emphasis> # Loopback address
1640 <emphasis>forward localhost.localdomain . </emphasis> # Loopback address
1641 <emphasis>forward www.ukc.mirror.ac.uk . </emphasis> # Specific host
1648 If you intend to chain <application>Junkbuster</application> and
1649 <application>squid</application> locally, then chain as
1650 <literal>browser -> squid -> junkbuster</literal> is the recommended way.
1654 Your squid configuration could then look like this:
1661 # Define junkbuster as parent cache
1662 <!-- per feedback from user...
1663 cache_peer 127.0.0.1 8118 parent 0 no-query
1665 cache_peer 127.0.0.1 parent 8118 0 no-query
1667 # Define ACL for protocol FTP
1670 # Do not forward ACL FTP to junkbuster
1671 always_direct allow FTP
1673 # Do not forward ACL CONNECT (https) to junkbuster
1674 always_direct allow CONNECT
1676 # Forward the rest to junkbuster
1677 never_direct allow all
1685 <!-- ~ End section ~ -->
1688 <!-- ~~~~~ New section ~~~~~ -->
1691 <title>Windows GUI Options</title>
1693 Removed references to Win32. HB 09/23/01
1696 <application>Junkbuster</application> has a number of options specific to the
1697 Windows GUI interface:
1701 If <quote>activity-animation</quote> is set to 1, the
1702 <application>Junkbuster</application> icon will animate when
1703 <quote>Junkbuster</quote> is active. To turn off, set to 0.
1710 <emphasis>activity-animation 1</emphasis>
1717 If <quote>log-messages</quote> is set to 1,
1718 <application>Junkbuster</application> will log messages to the console
1726 <emphasis>log-messages 1</emphasis>
1733 If <quote>log-buffer-size</quote> is set to 1, the size of the log buffer,
1734 i.e. the amount of memory used for the log messages displayed in the
1735 console window, will be limited to <quote>log-max-lines</quote> (see below).
1739 Warning: Setting this to 0 will result in the buffer to grow infinitely and
1740 eat up all your memory!
1747 <emphasis>log-buffer-size 1</emphasis>
1754 <application>log-max-lines</application> is the maximum number of lines held
1755 in the log buffer. See above.
1762 <emphasis>log-max-lines 200</emphasis>
1769 If <quote>log-highlight-messages</quote> is set to 1,
1770 <application>Junkbuster</application> will highlight portions of the log
1771 messages with a bold-faced font:
1778 <emphasis>log-highlight-messages 1</emphasis>
1785 The font used in the console window:
1792 <emphasis>log-font-name Comic Sans MS</emphasis>
1799 Font size used in the console window:
1806 <emphasis>log-font-size 8</emphasis>
1813 <quote>show-on-task-bar</quote> controls whether or not
1814 <application>Junkbuster</application> will appear as a button on the Task bar
1822 <emphasis>show-on-task-bar 0</emphasis>
1829 If <quote>close-button-minimizes</quote> is set to 1, the Windows close
1830 button will minimize <application>Junkbuster</application> instead of closing
1831 the program (close with the exit option on the File menu).
1838 <emphasis>close-button-minimizes 1</emphasis>
1845 The <quote>hide-console</quote> option is specific to the MS-Win console
1846 version of <application>JunkBuster</application>. If this option is used,
1847 <application>Junkbuster</application> will disconnect from and hide the
1864 <!-- ~ End section ~ -->
1867 <!-- ~~~~~ New section ~~~~~ -->
1868 <sect2 id="actionsfile">
1869 <title>The Actions File</title>
1872 The <quote>ijb.action</quote> file (formerly
1873 <filename>actionsfile</filename>) is used to define what actions
1874 <application>Junkbuster</application> takes, and thus determines how images,
1875 cookies and various other aspects of HTTP content and transactions are
1876 handled. Images can be anything you want, including ads, banners, or just
1877 some obnoxious image that you would rather not see. Cookies can be accepted
1878 or rejected, or accepted only during the current browser session (i.e.
1879 not written to disk). Changes to <filename>ijb.action</filename> should
1880 be immediately visible to <application>Junkbuster</application> without
1881 the need to restart.
1885 To determine which actions apply to a request, the URL of the request is
1886 compared to all patterns in this file. Every time it matches, the list of
1887 applicable actions for the URL is incrementally updated. You can trace
1888 this process by visiting <ulink
1889 url="http://i.j.b/show-url-info">http://i.j.b/show-url-info</ulink>.
1893 The actions file can be edited with a browser by loading
1894 <ulink url="http://i.j.b/">http://i.j.b/</ulink>, and then select
1895 <quote>Edit Actions</quote>.
1899 There are four types of lines in this file: comments (begin with a
1900 <quote>#</quote> character), actions, aliases and patterns, all of which are
1901 explained below, as well as the configuration file syntax that
1902 <application>Junkbuster</application> understands.
1907 <!-- ~~~~~ New section ~~~~~ -->
1909 <title>URL Domain and Path Syntax</title>
1911 Generally, a pattern has the form <domain>/<path>, where both the
1912 <domain> and <path> part are optional. If you only specify a
1913 domain part, the <quote>/</quote> can be left out:
1917 <emphasis>www.example.com</emphasis> - is a domain only pattern and will match any request to
1918 <quote>www.example.com</quote>.
1922 <emphasis>www.example.com/</emphasis> - means exactly the same.
1926 <emphasis>www.example.com/index.html</emphasis> - matches only the single
1927 document <quote>/index.html</quote> on <quote>www.example.com</quote>.
1931 <emphasis>/index.html</emphasis> - matches the document <quote>/index.html</quote>, regardless of
1936 <emphasis>index.html</emphasis> - matches nothing, since it would be
1937 interpreted as a domain name and there is no top-level domain called
1938 <quote>.html</quote>.
1942 The matching of the domain part offers some flexible options: if the
1943 domain starts or ends with a dot, it becomes unanchored at that end.
1948 <emphasis>.example.com</emphasis> - matches any domain that <emphasis>ENDS</emphasis> in
1949 <quote>.example.com</quote>.
1953 <emphasis>www.</emphasis> - matches any domain that <emphasis>STARTS</emphasis> with
1958 Additionally, there are wild-cards that you can use in the domain names
1959 themselves. They work pretty similar to shell wild-cards: <quote>*</quote>
1960 stands for zero or more arbitrary characters, <quote>?</quote> stands for
1961 any single character. And you can define character classes in square
1962 brackets and they can be freely mixed:
1966 <emphasis>ad*.example.com</emphasis> - matches <quote>adserver.example.com</quote>,
1967 <quote>ads.example.com</quote>, etc but not <quote>sfads.example.com</quote>.
1971 <emphasis>*ad*.example.com</emphasis> - matches all of the above, and then some.
1975 <emphasis>.?pix.com</emphasis> - matches <quote>www.ipix.com</quote>,
1976 <quote>pictures.epix.com</quote>, <quote>a.b.c.d.e.upix.com</quote>, etc.
1980 <emphasis>www[1-9a-ez].example.com</emphasis> - matches <quote>www1.example.com</quote>,
1981 <quote>www4.example.com</quote>, <quote>wwwd.example.com</quote>,
1982 <quote>wwwz.example.com</quote>, etc., but <emphasis>not</emphasis>
1983 <quote>wwww.example.com</quote>.
1987 If <application>Junkbuster</application> was compiled with
1988 <quote>pcre</quote> support (default), Perl compatible regular expressions
1989 can be used. See the <filename>pcre/docs/</filename> directory or <quote>man
1990 perlre</quote> (also available on <ulink
1991 url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>)
1992 for details. A brief discussion of regular expressions is in the
1993 <link linkend="regex">Appendix</link>. For instance:
1997 <emphasis>/.*/advert[0-9]+\.jpe?g</emphasis> - would match a URL from any
1998 domain, with any path that includes <quote>advert</quote> followed
1999 immediately by one or more digits, then a <quote>.</quote> and ending in
2000 either <quote>jpeg</quote> or <quote>jpg</quote>. So we match
2001 <quote>example.com/ads/advert2.jpg</quote>, and
2002 <quote>www.example.com/ads/banners/advert39.jpeg</quote>, but not
2003 <quote>www.example.com/ads/banners/advert39.gif</quote> (no gifs in the
2008 Please note that matching in the path is case
2009 <emphasis>INSENSITIVE</emphasis> by default, but you can switch to case
2010 sensitive at any point in the pattern by using the
2011 <quote>(?-i)</quote> switch:
2015 <emphasis>www.example.com/(?-i)PaTtErN.*</emphasis> - will match only
2016 documents whose path starts with <quote>PaTtErN</quote> in
2017 <emphasis>exactly</emphasis> this capitalization.
2022 <!-- ~ End section ~ -->
2026 <!-- ~~~~~ New section ~~~~~ -->
2029 <title>Actions</title>
2031 Actions are enabled if preceded with a <quote>+</quote>, and disabled if
2032 preceded with a <quote>-</quote>. Actions are invoked by enclosing the
2033 action name in curly braces (e.g. {+some_action}), followed by a list of
2034 URLs to which the action applies. There are three classes of actions:
2042 Boolean (e.g. <quote>+/-block</quote>):
2048 <emphasis>{+name}</emphasis> # enable this action
2049 <emphasis>{-name}</emphasis> # disable this action
2059 parameterized (e.g. <quote>+/-hide-user-agent</quote>):
2065 <emphasis>{+name{param}}</emphasis> # enable action and set parameter to <quote>param</quote>
2066 <emphasis>{-name}</emphasis> # disable action
2075 Multi-value (e.g. <quote>{+/-add-header{Name: value}}</quote>, <quote>{+/-wafer{name=value}}</quote>):
2081 <emphasis>{+name{param}}</emphasis> # enable action and add parameter <quote>param</quote>
2082 <emphasis>{-name{param}}</emphasis> # remove the parameter <quote>param</quote>
2083 <emphasis>{-name}</emphasis> # disable this action totally
2094 If nothing is specified in this file, no <quote>actions</quote> are taken.
2095 So in this case <application>JunkBuster</application> would just be a
2096 normal, non-blocking, non-anonymizing proxy. You must specifically
2097 enable the privacy and blocking features you need (although the
2098 provided default <filename>ijb.action</filename> file will
2099 give a good starting point).
2103 Later defined actions always over-ride earlier ones. For multi-valued
2104 actions, the actions are applied in the order they are specified.
2108 The list of valid <application>Junkbuster</application> <quote>actions</quote> are:
2116 Add the specified HTTP header, which is not checked for validity.
2117 You may specify this many times to specify many different headers:
2123 <emphasis>+add-header{Name: value}</emphasis>
2133 Block this URL totally.
2139 <emphasis>+block</emphasis>
2149 De-animate all animated GIF images, i.e. reduce them to their last frame.
2150 This will also shrink the images considerably (in bytes, not pixels!). If
2151 the option <quote>first</quote> is given, the first frame of the animation
2152 is used as the replacement. If <quote>last</quote> is given, the last frame
2153 of the animation is used instead, which probably makes more sense for most
2154 banner animations, but also has the risk of not showing the entire last
2155 frame (if it is only a delta to an earlier frame).
2161 <emphasis>+deanimate-gifs{last}</emphasis>
2162 <emphasis>+deanimate-gifs{first}</emphasis>
2171 <quote>+downgrade</quote> will downgrade HTTP/1.1 client requests to
2172 HTTP/1.0 and downgrade the responses as well. Use this action for servers
2173 that use HTTP/1.1 protocol features that
2174 <application>Junkbuster</application> doesn't handle well yet. HTTP/1.1
2175 is only partially implemented. Default is not to downgrade requests.
2181 <emphasis>+downgrade</emphasis>
2190 Many sites, like yahoo.com, don't just link to other sites. Instead, they
2191 will link to some script on their own server, giving the destination as a
2192 parameter, which will then redirect you to the final target. URLs resulting
2193 from this scheme typically look like:
2194 http://some.place/some_script?http://some.where-else.
2197 Sometimes, there are even multiple consecutive redirects encoded in the
2198 URL. These redirections via scripts make your web browsing more traceable,
2199 since the server from which you follow such a link can see where you go to.
2200 Apart from that, valuable bandwidth and time is wasted, while your browser
2201 ask the server for one redirect after the other. Plus, it feeds the
2205 The <quote>+fast-redirects</quote> option enables interception of these
2206 requests by <application>Junkbuster</application>, who will cut off all but
2207 the last valid URL in the request and send a local redirect back to your
2208 browser without contacting the remote site.
2214 <emphasis>+fast-redirects</emphasis>
2223 Filter the website through the re_filterfile:
2229 <emphasis>+filter{filename}</emphasis>
2238 Block any existing X-Forwarded-for header, and do not add a new one:
2244 <emphasis>+hide-forwarded</emphasis>
2253 If the browser sends a <quote>From:</quote> header containing your e-mail
2254 address, this either completely removes the header (<quote>block</quote>), or
2255 changes it to the specified e-mail address.
2261 <emphasis>+hide-from{block}</emphasis>
2262 <emphasis>+hide-from{spam@sittingduck.xqq}</emphasis>
2271 Don't send the <quote>Referer:</quote> (sic) header to the web site. You
2272 can block it, forge a URL to the same server as the request (which is
2273 preferred because some sites will not send images otherwise) or set it to a
2274 constant string of your choice.
2280 <emphasis>+hide-referer{block}</emphasis>
2281 <emphasis>+hide-referer{forge}</emphasis>
2282 <emphasis>+hide-referer{http://nowhere.com}</emphasis>
2291 Alternative spelling of <quote>+hide-referer</quote>. It has the same
2292 parameters, and can be freely mixed with, <quote>+hide-referer</quote>.
2293 (<quote>referrer</quote> is the correct English spelling, however the HTTP
2294 specification has a bug - it requires it to be spelled <quote>referer</quote>.)
2300 <emphasis>+hide-referrer{...}</emphasis>
2309 Change the <quote>User-Agent:</quote> header so web servers can't tell your
2310 browser type. Warning! This breaks many web sites. Specify the
2311 user-agent value you want. Example, pretend to be using Netscape on
2318 <emphasis>+hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}</emphasis>
2325 Or to identify yourself explicitly as a <quote>Junkbuster</quote> user:
2331 <emphasis>+hide-user-agent{JunkBuster/1.0}</emphasis>
2336 (Don't change the version number from 1.0 - after all, why tell them?)
2343 <emphasis>+hide-user-agent{browser-type}</emphasis>
2353 Treat this URL as an image. This only matters if it's also <quote>+block</quote>ed,
2354 in which case a <quote>blocked</quote> image can be sent rather than a HTML page.
2355 See <quote>+image-blocker{}</quote> below for the control over what is actually sent.
2361 <emphasis>+image</emphasis>
2370 Decides what to do with URLs that end up tagged with <quote>{+block
2371 +image}</quote>, e.g an advertizement. There are five options.
2372 <quote>-image-blocker</quote> will send a HTML <quote>blocked</quote> page,
2373 usually resulting in a <quote>broken image</quote> icon.
2374 <quote>+image-blocker{logo}</quote> will send a <quote>JunkBuster</quote>
2375 logo image. <quote>+image-blocker{blank}</quote> will send a 1x1
2376 transparent GIF image. And finally,
2377 <quote>+image-blocker{http://xyz.com}</quote> will send a HTTP temporary
2378 redirect to the specified image. This has the advantage of the icon being
2379 being cached by the browser, which will speed up the display.
2380 <quote>+image-blocker{pattern}</quote> will send a checkboard type pattern,
2381 which scales better than the logo (which can get blocky if the browser
2382 enlarges it too much).
2388 <emphasis>+image-blocker{logo}</emphasis>
2389 <emphasis>+image-blocker{blank}</emphasis>
2390 <emphasis>+image-blocker{http://i.j.b/send-banner}</emphasis>
2399 By default (i.e. in the absence of a <quote>+limit-connect</quote>
2400 action), <application>Junkbuster</application> will only allow CONNECT
2401 requests to port 443, which is the standard port for https as a
2406 The CONNECT methods exists in HTTP to allow access to secure websites
2407 (https:// URLs) through proxies. It works very simply: the proxy
2408 connects to the server on the specified port, and then short-circuits
2409 its connections to the client <emphasis>and</emphasis> to the remote proxy.
2410 This can be a big security hole, since CONNECT-enabled proxies can
2411 be abused as TCP relays very easily.
2415 If you want to allow CONNECT for more ports than this, or want to forbid
2416 CONNECT altogether, you can specify a comma separated list of ports and
2417 port ranges (the latter using dashes, with the minimum defaulting to 0 and
2425 <emphasis>+limit-connect{443} # This is the default and need no be specified.</emphasis>
2426 <emphasis>+limit-connect{80,443} # Ports 80 and 443 are OK.</emphasis>
2427 <emphasis>+limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100</emphasis>
2428 <emphasis> #and above 500 are OK.</emphasis>
2438 <quote>+no-compression</quote> prevents the website from compressing the
2439 data. Some websites do this, which can be a problem for
2440 <application>Junkbuster</application>, since <quote>+filter</quote>,
2441 <quote>+no-popup</quote> and <quote>+gif-deanimate</quote> will not work on
2442 compressed data. This will slow down connections to those websites,
2443 though. Default is <quote>nocompression</quote> is turned on.
2450 <emphasis>+nocompression</emphasis>
2459 If the website sets cookies, <quote>no-cookies-keep</quote> will make sure
2460 they are erased when you exit and restart your web browser. This makes
2461 profiling cookies useless, but won't break sites which require cookies so
2462 that you can log in for transactions. Default: on.
2468 <emphasis>+no-cookies-keep</emphasis>
2477 Prevent the website from reading cookies:
2483 <emphasis>+no-cookies-read</emphasis>
2492 Prevent the website from setting cookies:
2498 <emphasis>+no-cookies-set</emphasis>
2507 Filter the website through a built-in filter to disable those obnoxious
2508 JavaScript pop-up windows via window.open(), etc. The two alternative
2509 spellings are equivalent.
2515 <emphasis>+no-popup</emphasis>
2516 <emphasis>+no-popups</emphasis>
2525 This action only applies if you are using a <filename>jarfile</filename>
2526 for saving cookies. It sends a cookie to every site stating that you do not
2527 accept any copyright on cookies sent to you, and asking them not to track
2528 you. Of course, this is a (relatively) unique header they could use to
2535 <emphasis>+vanilla-wafer</emphasis>
2544 This allows you to add an arbitrary cookie. It can be specified multiple
2545 times in order to add as many cookies as you like.
2551 <emphasis>+wafer{name=value}</emphasis>
2562 The meaning of any of the above is reversed by preceding the action with a
2563 <quote>-</quote>, in place of the <quote>+</quote>.
2571 Turn off cookies by default, then allow a few through for specified sites:
2578 # Turn off all persistent cookies
2579 { +no-cookies-read }
2581 # Allow cookies for this browser session ONLY
2582 { +no-cookies-keep }
2584 # Exceptions to the above, sites that benefit from persistent cookies
2585 { -no-cookies-read }
2587 { -no-cookies-keep }
2594 # Alternative way of saying the same thing
2595 {-no-cookies-set -no-cookies-read -no-cookies-keep}
2604 Now turn off <quote>fast redirects</quote>, and then we allow two exceptions:
2614 # Reverse it for these two sites, which don't work right without it.
2616 www.ukc.ac.uk/cgi-bin/wac\.cgi\?
2624 Turn on page filtering, with one exception for sourceforge:
2631 # Run everything through the default filter file (<filename>re_filterfile</filename>):
2634 # But please don't re_filter code from sourceforge!
2636 .cvs.sourceforge.net
2643 Now some URLs that we want <quote>blocked</quote>, ie we won't see them.
2644 Many of these use regular expressions that will expand to match multiple
2654 /.*/(.*[-_.])?ads?[0-9]?(/|[-_.].*|\.(gif|jpe?g))
2655 /.*/(.*[-_.])?count(er)?(\.cgi|\.dll|\.exe|[?/])
2656 /.*/(ng)?adclient\.cgi
2657 /.*/(plain|live|rotate)[-_.]?ads?/
2658 /.*/(sponsor)s?[0-9]?/
2659 /.*/_?(plain|live)?ads?(-banners)?/
2661 /.*/ad(sdna_image|gifs?)/
2662 /.*/ad(server|stream|juggler)\.(cgi|pl|dll|exe)
2666 /.*/adv((er)?ts?|ertis(ing|ements?))?/
2670 /.*/cgi-bin/centralad/getimage
2671 /.*/images/addver\.gif
2672 /.*/images/marketing/.*\.(gif|jpe?g)
2676 /.*/sponsors?[0-9]?/
2677 /.*/advert[0-9]+\.jpg
2684 /graphics/defaultAd/
2686 /image\.ng/transactionID
2687 /images/.*/.*_anim\.gif # alvin brattli
2688 /ip_img/.*\.(gif|jpe?g)
2692 /cgi-bin/nph-adclick.exe/
2693 /.*/Image/BannerAdvertising/
2695 /.*/adlib/server\.cgi
2704 <!-- ~ End section ~ -->
2707 <!-- ~~~~~ New section ~~~~~ -->
2709 <title>Aliases</title>
2711 Custom <quote>actions</quote>, known to <application>Junkbuster</application>
2712 as <quote>aliases</quote>, can be defined by combining other <quote>actions</quote>.
2713 These can in turn be invoked just like the built-in <quote>actions</quote>.
2714 Currently, an alias can contain any character except space, tab, <quote>=</quote>,
2715 <quote>{</quote> or <quote>}</quote>. But please use only <quote>a</quote>-
2716 <quote>z</quote>, <quote>0</quote>-<quote>9</quote>, <quote>+</quote>, and
2717 <quote>-</quote>. Alias names are not case sensitive, and
2718 <emphasis>must be defined before anything</emphasis> else in the
2719 <filename>ijb.action</filename>file ! And there can only be one set of
2720 <quote>aliases</quote> defined.
2724 Now let's define a few aliases:
2731 # Useful customer aliases we can use later. These must come first!
2733 +no-cookies = +no-cookies-set +no-cookies-read
2734 -no-cookies = -no-cookies-set -no-cookies-read
2735 fragile = -block -no-cookies -filter -fast-redirects -hide-referer -no-popups
2736 shop = -no-cookies -filter -fast-redirects
2737 +imageblock = +block +image
2739 #For people who don't like to type too much: ;-)
2742 c2 = -no-cookies-set +no-cookies-read
2743 c3 = +no-cookies-set -no-cookies-read
2744 #... etc. Customize to your heart's content.
2751 Some examples using our <quote>shop</quote> and <quote>fragile</quote>
2759 # These sites are very complex and require
2760 # minimal interference.
2762 .office.microsoft.com
2763 .windowsupdate.microsoft.com
2766 # Shopping sites - still want to block ads.
2769 .worldpay.com # for quietpc.com
2773 # These shops require pop-ups
2785 <!-- ~ End section ~ -->
2788 <!-- ~~~~~ New section ~~~~~ -->
2789 <sect2 id="filterfile">
2790 <title>The Filter File</title>
2792 Any web page can be dynamically modified with the filter file. This
2793 modification can be removal, or re-writing, of any web page content,
2794 including tags and non-visible content. The default filter file is
2795 <filename>re_filterfile</filename>, located in the config directory.
2799 This file uses regular expressions to alter or remove any string in the
2800 target page. The expressions can only operate on one line at a time .Some
2801 examples from the included default <filename>re_filterfile</filename>:
2805 Stop web pages from displaying annoying messages in the status bar by
2806 deleting such references:
2813 # The status bar is for displaying link targets, not pointless buzzwords.
2814 # Again, check it out on http://www.airport-cgn.de/.
2815 s/status='.*?';*//ig
2822 Just for kicks, replace any occurrence of <quote>Microsoft</quote> with
2823 <quote>MicroSuck</quote>:
2830 s/microsoft(?!.com)/MicroSuck/ig
2837 Kill those auto-refresh tags:
2844 # Kill refresh tags. I like to refresh myself. Manually.
2845 # check it out on http://www.airport-cgn.de/ and go to the arrivals page.
2847 s/<meta[^>]*http-equiv[^>]*refresh.*URL=([^>]*?)"?>/<link rev="x-refresh" href=$1>/i
2848 s/<meta[^>]*http-equiv="?page-enter"?[^>]*content=[^>]*>/<!--no page enter for me-->/i
2856 <!-- ~ End section ~ -->
2860 <!-- ~~~~~ New section ~~~~~ -->
2863 <title>Templates</title>
2865 When <application>Junkbuster</application> displays one of its internal
2866 pages, such as a 404 Not Found error page, it uses the appropriate template.
2867 On Linux, BSD, and Unix, these are located in
2868 <filename>/etc/junkbuster/templates</filename> by default. These may be
2869 customized, if desired.
2876 <!-- ~ End section ~ -->
2880 <!-- ~~~~~ New section ~~~~~ -->
2881 <sect1 id="quickstart"><title>Quickstart to Using Junkbuster</title>
2883 Install package, then run and enjoy! <application>JunkBuster</application>
2884 is typically started by specifying the main configuration file to be
2885 used on the command line. Example Unix startup command:
2891 # /usr/sbin/junkbuster /etc/junkbuster/config
2897 An init script is provided for SuSE and Redhat.
2901 For for SuSE: /etc/rc.d/junkbuster start
2905 For RedHat: /etc/rc.d/init.d/junkbuster start
2910 If no configuration file is specified on the command line,
2911 <application>Junkbuster</application> will look for a file named
2912 <filename>config</filename> in the current directory. Except on Win32 where
2913 it will try <filename>config.txt</filename>. If no file is specified on the
2914 command line and no default configuration file can be found,
2915 <application>Junkbuster</application> will fail to start.
2919 Be sure your browser is set to use the proxy which is by default at
2920 localhost, port 8118. With <application>Netscape</application> (and
2921 <application>Mozilla</application>), this can be set under <literal>Edit
2922 -> Preferences -> Advanced -> Proxies -> HTTP Proxy</literal>.
2923 For <application>Internet Explorer</application>: <literal>Tools >
2924 Internet Properties -> Connections -> LAN Setting</literal>. Then,
2925 check <quote>Use Proxy</quote> and fill in the appropriate info (Address:
2926 localhost, Port: 8118). Include if HTTPS proxy support too.
2930 The included default configuration files should give a reasonable starting
2931 point, though may be somewhat aggressive in blocking junk. You will probably
2932 want to keep an eye out for sites that require persistent cookies, and add these to
2933 <filename>ijb.action</filename> as needed. By default, most of these will
2934 be accepted only during the current browser session, until you add them to
2935 the configuration. If you want the browser to handle this instead, you will
2936 need to edit <filename>ijb.action</filename> and disable this feature. If you
2937 use more than one browser, it would make more sense to let
2938 <application>Junkbuster</application> handle this. In which case, the
2939 browser(s) should be set to accept all cookies.
2943 If a particular site shows problems loading properly, try adding it
2944 to the <literal>{fragile}</literal> section of
2945 <filename>ijb.action</filename>. This will turn off most actions for
2950 <application>Junkbuster</application> is HTTP/1.1 compliant, but not all 1.1
2951 features are as yet implemented. If browsers that support HTTP/1.1 (like
2952 <application>Mozilla</application> or recent versions of I.E.) experience
2953 problems, you might try to force HTTP/1.0 compatibility. For Mozilla, look
2954 under <literal>Edit -> Preferences -> Debug -> Networking</literal>.
2955 Or set the <quote>+downgrade</quote> config option in
2956 <filename>ijb.action</filename>.
2960 After running <application>Junkbuster</application> for a while, you can
2961 start to fine tune the configuration to suit your personal, or site,
2962 preferences and requirements. There are many, many aspects that can
2963 be customized. <quote>Actions</quote> (as specified in <filename>ijb.action</filename>)
2964 can be adjusted by pointing your browser to
2965 <ulink url="http://i.j.b/">http://i.j.b/</ulink>,
2966 and then follow the link to <quote>edit the actions list</quote>.
2967 (This is an internal page and does not require Internet access.)
2971 In fact, various aspects of <application>Junkbuster</application>
2972 configuration can be viewed from this page, including
2973 current configuration parameters, source code version numbers,
2974 the browser's request headers, and <quote>actions</quote> that apply
2975 to a given URL. In addition to the <filename>ijb.action</filename> file
2976 editor mentioned above, <application>Junkbuster</application> can also
2977 be turned <quote>on</quote> and <quote>off</quote> from this page.
2981 If you encounter problems, please verify it is a
2982 <application>Junkbuster</application> bug, by disabling
2983 <application>Junkbuster</application>, and then trying the same page.
2984 Also, try another browser if possible to eliminate browser or site
2985 problems. Before reporting it as a bug, see if there is not a configuration
2986 option that is enabled that is causing the page not to load. You can
2987 then add an exception for that page or site. If a bug, please report it to
2988 the developers (see below).
2993 <!-- ~~~~~ New section ~~~~~ -->
2996 <title>Command Line Options</title>
2998 <application>JunkBuster</application> may be invoked with the following
2999 command-line options:
3007 <emphasis>--version</emphasis>
3010 Print version info and exit, Unix only.
3015 <emphasis>--help</emphasis>
3018 Print a short usage info and exit, Unix only.
3023 <emphasis>--no-daemon</emphasis>
3026 Don't become a daemon, i.e. don't fork and become process group
3027 leader, don't detach from controlling tty. Unix only.
3032 <emphasis>--pidfile FILE</emphasis>
3036 On startup, write the process ID to <emphasis>FILE</emphasis>. Delete the
3037 <emphasis>FILE</emphasis> on exit. Failiure to create or delete the
3038 <emphasis>FILE</emphasis> is non-fatal. If no <emphasis>FILE</emphasis>
3039 option is given, no PID file will be used. Unix only.
3044 <emphasis>--user USER[.GROUP]</emphasis>
3048 After (optionally) writing the PID file, assume the user ID of
3049 <emphasis>USER</emphasis>, and if included the GID of GROUP. Exit if the
3050 privileges are not sufficient to do so. Unix only.
3055 <emphasis>configfile</emphasis>
3058 If no <emphasis>configfile</emphasis> is included on the command line,
3059 <application>JunkBuster</application> will look for a file named
3060 <quote>config</quote> in the current directory (except on Win32
3061 where it will look for <quote>config.txt</quote> instead). Specify
3062 full path to avoid confusion.
3073 <!-- ~ End section ~ -->
3077 <!-- ~~~~~ New section ~~~~~ -->
3079 <sect1 id="contact"><title>Contacting the Developers, Bug Reporting and Feature
3082 We value your feedback. However, to provide you with the best support,
3087 <listitem><para>Use the <ulink url="http://sourceforge.net/tracker/?group_id=11118&atid=211118">Sourceforge support forum</ulink> to get
3088 help.</para></listitem>
3090 <listitem><para>Submit bugs only thru our <ulink url="http://sourceforge.net/tracker/?group_id=11118&atid=111118">Sourceforge bug
3092 Make sure that the bug has not already been submitted. Please try to
3093 verify that it is a <application>Junkbuster</application> bug, and not
3094 a browser or site bug first. If you are using your own custom configuration,
3095 please try the stock configs to see if the problem is a configuration
3096 related bug. And if not using the latest development snapshot, please
3097 try the latest one. Or even better, CVS sources.</para>
3101 <listitem><para>Submit feature requests only thru our <ulink
3102 url="http://sourceforge.net/tracker/?atid=361118&group_id=11118&func=browse">Sourceforge feature request forum</ulink>.</para></listitem>
3110 For any other issues, feel free to use the <ulink url="http://sourceforge.net/mail/?group_id=11118">mailing lists</ulink>.
3114 Anyone interested in actively participating in development and related
3115 discussions can join the appropriate mailing list
3116 <ulink url="http://sourceforge.net/mail/?group_id=11118">here</ulink>.
3117 Archives are available here too.
3123 <!-- ~~~~~ New section ~~~~~ -->
3124 <sect1 id="copyright"><title>Copyright and History</title>
3127 <title>License</title>
3129 <application>Internet Junkbuster</application> is free software; you can
3130 redistribute it and/or modify it under the terms of the GNU General Public
3131 License as published by the Free Software Foundation; either version 2 of the
3132 License, or (at your option) any later version.
3136 This program is distributed in the hope that it will be useful, but WITHOUT
3137 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
3138 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
3139 details, which is available from <ulink
3140 url="http://www.gnu.org/copyleft/gpl.html">the Free Software Foundation,
3141 Inc</ulink>, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3146 <!-- ~ End section ~ -->
3149 <!-- ~~~~~ New section ~~~~~ -->
3152 <title>History</title>
3154 <application>Junkbuster</application> was originally written by Anonymous
3156 url="http://www.junkbusters.com/ht/en/ijbfaq.html">Junkbuster's
3157 Corporation</ulink>, and was released as free open-source software under the
3158 GNU GPL. <ulink url="http://www.waldherr.org/junkbuster/">Stefan
3159 Waldherr</ulink> made many improvements, and started the <ulink
3160 url="http://sourceforge.net/projects/ijbswa/">SourceForge project</ulink> to
3161 rekindle development. There are now several active developers contributing.
3162 The last stable release was v2.0.2, which has now grown whiskers ;-).
3169 <!-- ~~~~~ New section ~~~~~ -->
3170 <sect1 id="seealso"><title>See also</title>
3175 <ulink url="http://sourceforge.net/projects/ijbswa">http://sourceforge.net/projects/ijbswa</ulink>
3180 <ulink url="http://ijbswa.sourceforge.net/">http://ijbswa.sourceforge.net/</ulink>
3185 <ulink url="http://i.j.b/">http://i.j.b/</ulink>
3190 <ulink url="http://www.junkbusters.com/ht/en/cookies.html">http://www.junkbusters.com/ht/en/cookies.html</ulink>
3195 <ulink url="http://www.waldherr.org/junkbuster/">http://www.waldherr.org/junkbuster/</ulink>
3200 <ulink url="http://privacy.net/analyze/">http://privacy.net/analyze/</ulink>
3205 <ulink url="http://www.squid-cache.org/">http://www.squid-cache.org/</ulink>
3214 <!-- ~~~~~ New section ~~~~~ -->
3215 <sect1 id="appendix"><title>Appendix</title>
3218 <!-- ~~~~~ New section ~~~~~ -->
3220 <title>Regular Expressions</title>
3222 <application>Junkbuster</application> can use <quote>regular expressions</quote>
3223 in various config files. Assuming support for <quote>pcre</quote> (Perl
3224 Compatible Regular Expressions) is compiled in, which is the default. Such
3225 configuration directives do not require regular expressions, but they can be
3226 used to increase flexibility by matching a pattern with wild-cards against
3231 If you are reading this, you probably don't understand what <quote>regular
3232 expressions</quote> are, or what they can do. So this will be a very brief
3233 introduction only. A full explanation would require a book ;-)
3237 <quote>Regular expressions</quote> is a way of matching one character
3238 expression against another to see if it matches or not. One of the
3239 <quote>expressions</quote> is a literal string of readable characters
3240 (letter, numbers, etc), and the other is a complex string of literal
3241 characters combined with wild-cards, and other special characters, called
3242 meta-characters. The <quote>meta-characters</quote> have special meanings and
3243 are used to build the complex pattern to be matched against. Perl Compatible
3244 Regular Expressions is an enhanced form of the regular expression language
3245 with backward compatibility.
3249 To make a simple analogy, we do something similar when we use wild-card
3250 characters when listing files with the <command>dir</command> command in DOS.
3251 <literal>*.*</literal> matches all filenames. The <quote>special</quote>
3252 character here is the asterisk which matches any and all characters. We can be
3253 more specific and use <literal>?</literal> to match just individual
3254 characters. So <quote>dir file?.text</quote> would match
3255 <quote>file1.txt</quote>, <quote>file2.txt</quote>, etc. We are pattern
3256 matching, using a similar technique to <quote>regular expressions</quote>!
3260 Regular expressions do essentially the same thing, but are much, much more
3261 powerful. There are many more <quote>special characters</quote> and ways of
3262 building complex patterns however. Let's look at a few of the common ones,
3263 and then some examples:
3268 <emphasis>.</emphasis> - Matches any single character, e.g. <quote>a</quote>,
3269 <quote>A</quote>, <quote>4</quote>, <quote>:</quote>, or <quote>@</quote>.
3275 <emphasis>?</emphasis> - The preceding character or expression is matched ZERO or ONE
3282 <emphasis>+</emphasis> - The preceding character or expression is matched ONE or MORE
3289 <emphasis>*</emphasis> - The preceding character or expression is matched ZERO or MORE
3296 <emphasis>\</emphasis> - The <quote>escape</quote> character denotes that
3297 the following character should be taken literally. This is used where one of the
3298 special characters (e.g. <quote>.</quote>) needs to be taken literally and
3299 not as a special meta-character.
3305 <emphasis>[]</emphasis> - Characters enclosed in brackets will be matched if
3306 any of the enclosed characters are encountered.
3312 <emphasis>()</emphasis> - parentheses are used to group a sub-expression,
3313 or multiple sub-expressions.
3319 <emphasis>|</emphasis> - The <quote>bar</quote> character works like an
3320 <quote>or</quote> conditional statement. A match is successful if the
3321 sub-expression on either side of <quote>|</quote> matches.
3327 <emphasis>s/string1/string2/g</emphasis> - This is used to rewrite strings of text.
3328 <quote>string1</quote> is replaced by <quote>string2</quote> in this
3334 These are just some of the ones you are likely to use when matching URLs with
3335 <application>Junkbuster</application>, and is a long way from a definitive
3336 list. This is enough to get us started with a few simple examples which may
3337 be more illuminating:
3341 <emphasis><literal>/.*/banners/.*</literal></emphasis> - A simple example
3342 that uses the common combination of <quote>.</quote> and <quote>*</quote> to
3343 denote any character, zero or more times. In other words, any string at all.
3344 So we start with a literal forward slash, then our regular expression pattern
3345 (<quote>.*</quote>) another literal forward slash, the string
3346 <quote>banners</quote>, another forward slash, and lastly another
3347 <quote>.*</quote>. We are building
3348 a directory path here. This will match any file with the path that has a
3349 directory named <quote>banners</quote> in it. The <quote>.*</quote> matches
3350 any characters, and this could conceivably be more forward slashes, so it
3351 might expand into a much longer looking path. For example, this could match:
3352 <quote>/eye/hate/spammers/banners/annoy_me_please.gif</quote>, or just
3353 <quote>/banners/annoying.html</quote>, or almost an infinite number of other
3354 possible combinations, just so it has <quote>banners</quote> in the path
3359 A now something a little more complex:
3363 <emphasis><literal>/.*/adv((er)?ts?|ertis(ing|ements?))?/</literal></emphasis> -
3364 We have several literal forward slashes again (<quote>/</quote>), so we are
3365 building another expression that is a file path statement. We have another
3366 <quote>.*</quote>, so we are matching against any conceivable sub-path, just so
3367 it matches our expression. The only true literal that <emphasis>must
3368 match</emphasis> our pattern is <application>adv</application>, together with
3369 the forward slashes. What comes after the <quote>adv</quote> string is the
3374 Remember the <quote>?</quote> means the preceding expression (either a
3375 literal character or anything grouped with <quote>(...)</quote> in this case)
3376 can exist or not, since this means either zero or one match. So
3377 <quote>((er)?ts?|ertis(ing|ements?))</quote> is optional, as are the
3378 individual sub-expressions: <quote>(er)</quote>,
3379 <quote>(ing|ements?)</quote>, and the <quote>s</quote>. The <quote>|</quote>
3380 means <quote>or</quote>. We have two of those. For instance,
3381 <quote>(ing|ements?)</quote>, can expand to match either <quote>ing</quote>
3382 <emphasis>OR</emphasis> <quote>ements?</quote>. What is being done here, is an
3383 attempt at matching as many variations of <quote>advertisement</quote>, and
3384 similar, as possible. So this would expand to match just <quote>adv</quote>,
3385 or <quote>advert</quote>, or <quote>adverts</quote>, or
3386 <quote>advertising</quote>, or <quote>advertisement</quote>, or
3387 <quote>advertisements</quote>. You get the idea. But it would not match
3388 <quote>advertizements</quote> (with a <quote>z</quote>). We could fix that by
3389 changing our regular expression to:
3390 <quote>/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/</quote>, which would then match
3395 <emphasis><literal>/.*/advert[0-9]+\.(gif|jpe?g)</literal></emphasis> - Again
3396 another path statement with forward slashes. Anything in the square brackets
3397 <quote>[]</quote> can be matched. This is using <quote>0-9</quote> as a
3398 shorthand expression to mean any digit one through nine. It is the same as
3399 saying <quote>0123456789</quote>. So any digit matches. The <quote>+</quote>
3400 means one or more of the preceding expression must be included. The preceding
3401 expression here is what is in the square brackets -- in this case, any digit
3402 one through nine. Then, at the end, we have a grouping: <quote>(gif|jpe?g)</quote>.
3403 This includes a <quote>|</quote>, so this needs to match the expression on
3404 either side of that bar character also. A simple <quote>gif</quote> on one side, and the other
3405 side will in turn match either <quote>jpeg</quote> or <quote>jpg</quote>,
3406 since the <quote>?</quote> means the letter <quote>e</quote> is optional and
3407 can be matched once or not at all. So we are building an expression here to
3408 match image GIF or JPEG type image file. It must include the literal
3409 string <quote>advert</quote>, then one or more digits, and a <quote>.</quote>
3410 (which is now a literal, and not a special character, since it is escaped
3411 with <quote>\</quote>), and lastly either <quote>gif</quote>, or
3412 <quote>jpeg</quote>, or <quote>jpg</quote>. Some possible matches would
3413 include: <quote>//advert1.jpg</quote>,
3414 <quote>/nasty/ads/advert1234.gif</quote>,
3415 <quote>/banners/from/hell/advert99.jpg</quote>. It would not match
3416 <quote>advert1.gif</quote> (no leading slash), or
3417 <quote>/adverts232.jpg</quote> (the expression does not include an
3418 <quote>s</quote>), or <quote>/advert1.jsp</quote> (<quote>jsp</quote> is not
3419 in the expression anywhere).
3423 <emphasis><literal>s/microsoft(?!.com)/MicroSuck/i</literal></emphasis> - This is
3424 a substitution. <quote>MicroSuck</quote> will replace any occurrence of
3425 <quote>microsoft</quote>. The <quote>i</quote> at the end of the expression
3426 means ignore case. The <quote>(?!.com)</quote> means
3427 the match should fail if <quote>microsoft</quote> is followed by
3428 <quote>.com</quote>. In other words, this acts like a <quote>NOT</quote>
3429 modifier. In case this is a hyperlink, we don't want to break it ;-).
3433 We are barely scratching the surface of regular expressions here so that you
3434 can understand the default <application>Junkbuster</application>
3435 configuration files, and maybe use this knowledge to customize your own
3436 installation. There is much, much more that can be done with regular
3437 expressions. Now that you know enough to get started, you can learn more on
3442 More reading on Perl Compatible Regular expressions:
3443 <ulink url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>
3448 <!-- ~ End section ~ -->
3451 <!-- ~~~~~ New section ~~~~~ -->
3453 <title>JunkBuster's Internal Pages</title>
3456 Since <application>JunkBuster</application> proxies each requested
3457 web page, it is easy for <application>JunkBuster</application> to
3458 trap certain URLs. In this way, we can talk directly to
3459 <application>JunkBuster</application>, and see how it is
3460 configured, see how our rules are being applied, change these
3461 rules and other configuration options, and even turn
3462 <application>JunkBuster</application> off.
3467 The URLs listed below are the special ones that allow direct access
3468 to <application>JunkBuster</application>. Of course,
3469 <application>JunkBuster</application> must be running to access these. If
3470 not, you will get a friendly error message.
3479 Junkbuster main page:
3483 <ulink url="http://ijbswa.sourceforge.net/config/">http://ijbswa.sourceforge.net/config/</ulink>
3487 Alternately, this may be reached at <ulink url="http://i.j.b/">http://i.j.b/</ulink>,
3488 but this variation may not work as reliably as the above in some
3495 Show information about the current configuration:
3499 <ulink url="http://ijbswa.sourceforge.net/config/show-status">http://ijbswa.sourceforge.net/config/show-status</ulink>
3506 Show the source code version numbers:
3510 <ulink url="http://ijbswa.sourceforge.net/config/show-version">http://ijbswa.sourceforge.net/config/show-version</ulink>
3517 Show the client's request headers:
3521 <ulink url="http://ijbswa.sourceforge.net/config/show-request">http://ijbswa.sourceforge.net/config/show-request</ulink>
3528 Show which actions apply to a URL and why:
3532 <ulink url="http://ijbswa.sourceforge.net/config/show-url-info">http://ijbswa.sourceforge.net/config/show-url-info</ulink>
3539 Toggle JunkBuster on or off:
3543 <ulink url="http://ijbswa.sourceforge.net/config/toggle">http://ijbswa.sourceforge.net/config/toggle</ulink>
3547 Short cuts. Turn off, then on:
3551 <ulink url="http://ijbswa.sourceforge.net/config/toggle?set=disable">http://ijbswa.sourceforge.net/config/toggle?set=disable</ulink>
3556 <ulink url="http://ijbswa.sourceforge.net/config/toggle?set=enable">http://ijbswa.sourceforge.net/config/toggle?set=enable</ulink>
3563 Edit the actions list file:
3567 <ulink url="http://ijbswa.sourceforge.net/config/edit-actions">http://ijbswa.sourceforge.net/config/edit-actions</ulink>
3576 These may be bookmarked for quick reference.
3586 This program is free software; you can redistribute it
3587 and/or modify it under the terms of the GNU General
3588 Public License as published by the Free Software
3589 Foundation; either version 2 of the License, or (at
3590 your option) any later version.
3592 This program is distributed in the hope that it will
3593 be useful, but WITHOUT ANY WARRANTY; without even the
3594 implied warranty of MERCHANTABILITY or FITNESS FOR A
3595 PARTICULAR PURPOSE. See the GNU General Public
3596 License for more details.
3598 The GNU General Public License should be included with
3599 this file. If not, you can view it at
3600 http://www.gnu.org/copyleft/gpl.html
3601 or write to the Free Software Foundation, Inc., 59
3602 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3604 $Log: user-manual.sgml,v $
3605 Revision 1.46 2002/03/10 00:51:08 hal9
3606 Added section on JB internal pages in Appendix.
3608 Revision 1.45 2002/03/09 17:43:53 swa
3611 Revision 1.44 2002/03/09 17:08:48 hal9
3612 New section on Jon's actions file editor, and move some stuff around.
3614 Revision 1.43 2002/03/08 00:47:32 hal9
3615 Added imageblock{pattern}.
3617 Revision 1.42 2002/03/07 18:16:55 swa
3620 Revision 1.41 2002/03/07 16:46:43 hal9
3621 Fix a few markup problems for jade.
3623 Revision 1.40 2002/03/07 16:28:39 swa
3624 provide correct feedback channels
3626 Revision 1.39 2002/03/06 16:19:28 hal9
3627 Note on perceived filtering slowdown per FR.
3629 Revision 1.38 2002/03/05 23:55:14 hal9
3630 Stupid I did it again. Double hyphen in comment breaks jade.
3632 Revision 1.37 2002/03/05 23:53:49 hal9
3633 jade barfs on '- -' embedded in comments. - -user option broke it.
3635 Revision 1.36 2002/03/05 22:53:28 hal9
3636 Add new - - user option.
3638 Revision 1.35 2002/03/05 00:17:27 hal9
3639 Added section on command line options.
3641 Revision 1.34 2002/03/04 19:32:07 oes
3642 Changed default port to 8118
3644 Revision 1.33 2002/03/03 19:46:13 hal9
3645 Emphasis on where/how to report bugs, etc
3647 Revision 1.32 2002/03/03 09:26:06 joergs
3648 AmigaOS changes, config is now loaded from PROGDIR: instead of
3649 AmiTCP:db/junkbuster/ if no configuration file is specified on the
3652 Revision 1.31 2002/03/02 22:45:52 david__schmidt
3655 Revision 1.30 2002/03/02 22:00:14 hal9
3656 Updated 'New Features' list. Ran through spell-checker.
3658 Revision 1.29 2002/03/02 20:34:07 david__schmidt
3659 Update OS/2 build section
3661 Revision 1.28 2002/02/24 14:34:24 jongfoster
3662 Formatting changes. Now changing the doctype to DocBook XML 4.1
3663 will work - no other changes are needed.
3665 Revision 1.27 2002/01/11 14:14:32 hal9
3666 Added a very short section on Templates
3668 Revision 1.26 2002/01/09 20:02:50 hal9
3669 Fix bug re: auto-detect config file changes.
3671 Revision 1.25 2002/01/09 18:20:30 hal9
3672 Touch ups for *.action files.
3674 Revision 1.24 2001/12/02 01:13:42 hal9
3677 Revision 1.23 2001/12/02 00:20:41 hal9
3678 Updates for recent changes.
3680 Revision 1.22 2001/11/05 23:57:51 hal9
3681 Minor update for startup now daemon mode.
3683 Revision 1.21 2001/10/31 21:11:03 hal9
3684 Correct 2 minor errors
3686 Revision 1.18 2001/10/24 18:45:26 hal9
3687 *** empty log message ***
3689 Revision 1.17 2001/10/24 17:10:55 hal9
3690 Catching up with Jon's recent work, and a few other things.
3692 Revision 1.16 2001/10/21 17:19:21 swa
3693 wrong url in documentation
3695 Revision 1.15 2001/10/14 23:46:24 hal9
3696 Various minor changes. Fleshed out SEE ALSO section.
3698 Revision 1.13 2001/10/10 17:28:33 hal9
3701 Revision 1.12 2001/09/28 02:57:04 hal9
3704 Revision 1.11 2001/09/28 02:25:20 hal9
3707 Revision 1.9 2001/09/27 23:50:29 hal9
3708 A few changes. A short section on regular expression in appendix.
3710 Revision 1.8 2001/09/25 00:34:59 hal9
3711 Some additions, and re-arranging.
3713 Revision 1.7 2001/09/24 14:31:36 hal9
3716 Revision 1.6 2001/09/24 14:10:32 hal9
3717 Including David's OS/2 installation instructions.
3719 Revision 1.2 2001/09/13 15:27:40 swa
3722 Revision 1.1 2001/09/12 15:36:41 swa
3723 source files for junkbuster documentation
3725 Revision 1.3 2001/09/10 17:43:59 swa
3726 first proposal of a structure.
3728 Revision 1.2 2001/06/13 14:28:31 swa
3729 docs should have an author.
3731 Revision 1.1 2001/06/13 14:20:37 swa
3732 first import of project's documentation for the webserver.