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.47 2002/03/11 13:13:27 swa 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.47 2002/03/11 13:13:27 swa 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 re-write the raw
564 page content, including viewable text as well as embedded HTML and JavaScript,
565 and whatever else lurks on any given web page.
573 <filename>ijb.action</filename> and <filename>re_filterfile</filename>
574 can use Perl style regular expressions for maximum flexibility. All files use
575 the <quote><literal>#</literal></quote> character to denote a comment. Such
576 lines are not processed by <application>Junkbuster</application>. After
577 making any changes, there is no need to restart
578 <application>Junkbuster</application> in order for the changes to take
579 effect. <application>Junkbuster</application> should detect such changes
584 While under development, the configuration content is subject to change.
585 The below documentation may not be accurate by the time you read this.
586 Also, what constitutes a <quote>default</quote> setting, may change, so
587 please check all your configuration files on important issues.
592 <!-- ~~~~~ New section ~~~~~ -->
595 <title>The Main Configuration File</title>
597 Again, the main configuration file is named <filename>config</filename> on
598 Linux/Unix/BSD and OS/2, and <filename>config.txt</filename> on Windows.
599 Configuration lines consist of an initial keyword followed by a list of
600 values, all separated by whitespace (any number of spaces or tabs). For
608 <emphasis>blockfile blocklist.ini</emphasis>
615 Indicates that the blockfile is named <quote>blocklist.ini</quote>.
619 A <quote><literal>#</literal></quote> indicates a comment. Any part of a
620 line following a <quote><literal>#</literal></quote> is ignored, except if
621 the <quote><literal>#</literal></quote> is preceded by a
622 <quote><literal>\</literal></quote>.
626 Thus, by placing a <quote><literal>#</literal></quote> at the start of an
627 existing configuration line, you can make it a comment and it will be treated
628 as if it weren't there. This is called <quote>commenting out</quote> an
629 option and can be useful to turn off features: If you comment out the
630 <quote>logfile</quote> line, <application>junkbuster</application> will not
631 log to a file at all. Watch for the <quote>default:</quote> section in each
632 explanation to see what happens if the option is left unset (or commented
637 Long lines can be continued on the next line by using a
638 <quote><literal>\</literal></quote> as the very last character.
642 There are various aspects of <application>Junkbuster</application> behavior
647 <!-- ~~~~~ New section ~~~~~ -->
650 <title>Defining Other Configuration Files</title>
653 <application>Junkbuster</application> can use a number of other files to tell it
654 what ads to block, what cookies to accept, etc. This section of the
655 configuration file tells <application>Junkbuster</application> where to find
656 all those other files.
660 On <application>Windows</application> and <application>AmigaOS</application>,
661 <application>Junkbuster</application> looks for these files in the same
662 directory as the executable. On Unix and OS/2,
663 <application>Junkbuster</application> looks for these files in the current
664 working directory. In either case, an absolute path name can be used to
669 When development goes modular and multi-user, the blocker, filter, and
670 per-user config will be stored in subdirectories of <quote>confdir</quote>.
671 For now, only <filename>confdir/templates</filename> is used for storing HTML
672 templates for CGI results.
676 The location of the configuration files:
683 <emphasis>confdir /etc/junkbuster</emphasis> # No trailing /, please.
690 The directory where all logging (i.e. <filename>logfile</filename> and
691 <filename>jarfile</filename>) takes place. No trailing
692 <quote><literal>/</literal></quote>, please:
699 <emphasis>logdir /var/log/junkbuster</emphasis>
706 Note that all file specifications below are relative to
707 the above two directories!
711 The <quote>ijb.action</quote> file contains patterns to specify the actions to
712 apply to requests for each site. Default: Cookies to and from all
713 destinations are kept only during the current browser session (i.e. they
714 are not saved to disk). Pop-ups are disabled for all sites. All sites are
715 filtered through selected sections of <quote>re_filterfile</quote>. No sites
716 are blocked. The JunkBuster logo is displayed for filtered ads and other
717 images . The syntax 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 that use <quote>regular expressions</quote>. These rules permit powerful
734 changes on the content of Web pages, e.g., you could disable your favorite
735 JavaScript annoyances, re-write the actual displayed text, or just have some
736 fun replacing <quote>Microsoft</quote> with <quote>MicroSuck</quote> wherever
737 it appears on a Web page. Default: whatever the developers are playing with
742 Filtering requires buffering the page content, which may appear to slow down
743 page rendering since nothing is displayed until all content has passed
744 the filters. (It does not really take longer, but seems that way since
745 the page is not incrementally displayed.) This effect will be more noticeable
746 on slower connections.
754 <emphasis>re_filterfile re_filterfile</emphasis>
761 The logfile is where all logging and error messages are written. The logfile
762 can be useful for tracking down a problem with
763 <application>Junkbuster</application> (e.g., it's not blocking an ad you
764 think it should block) but in most cases you probably will never look at it.
768 Your logfile will grow indefinitely, and you will probably want to
769 periodically remove it. On Unix systems, you can do this with a cron job
770 (see <quote>man cron</quote>). For Redhat, a <command>logrotate</command>
771 script has been included.
775 On SuSE Linux systems, you can place a line like <quote>/var/log/junkbuster.*
776 +1024k 644 nobody.nogroup</quote> in <filename>/etc/logfiles</filename>, with
777 the effect that cron.daily will automatically archive, gzip, and empty the
778 log, when it exceeds 1M size.
782 Default: Log to the a file named <filename>logfile</filename>.
783 Comment out to disable logging.
790 <emphasis>logfile logfile</emphasis>
797 The <quote>jarfile</quote> defines where
798 <application>Junkbuster</application> stores the cookies it intercepts. Note
799 that if you use a <quote>jarfile</quote>, it may grow quite large. Default:
800 Don't store intercepted cookies.
807 <emphasis>#jarfile jarfile</emphasis>
814 If you specify a <quote>trustfile</quote>,
815 <application>Junkbuster</application> will only allow access to sites that
816 are named in the trustfile. You can also mark sites as trusted referrers,
817 with the effect that access to untrusted sites will be granted, if a link
818 from a trusted referrer was used. The link target will then be added to the
819 <quote>trustfile</quote>. This is a very restrictive feature that typical
820 users most probably want to leave disabled. Default: Disabled, don't use the
828 <emphasis>#trustfile trust</emphasis>
835 If you use the trust mechanism, it is a good idea to write up some on-line
836 documentation about your blocking policy and to specify the URL(s) here. They
837 will appear on the page that your users receive when they try to access
838 untrusted content. Use multiple times for multiple URLs. Default: Don't
839 display links on the <quote>untrusted</quote> info page.
846 <emphasis>trust-info-url http://www.your-site.com/why_we_block.html</emphasis>
847 <emphasis>trust-info-url http://www.your-site.com/what_we_allow.html</emphasis>
855 <!-- ~ End section ~ -->
859 <!-- ~~~~~ New section ~~~~~ -->
862 <title>Other Configuration Options</title>
865 This part of the configuration file contains options that control how
866 <application>Junkbuster</application> operates.
870 <quote>Admin-address</quote> should be set to the email address of the proxy
871 administrator. It is used in many of the proxy-generated pages. Default:
879 <emphasis>#admin-address fill@me.in.please</emphasis>
886 <quote>Proxy-info-url</quote> can be set to a URL that contains more info
887 about this <application>Junkbuster</application> installation, it's
888 configuration and policies. It is used in many of the proxy-generated pages
889 and its use is highly recommended in multi-user installations, since your
890 users will want to know why certain content is blocked or modified. Default:
891 Don't show a link to on-line documentation.
898 <emphasis>proxy-info-url http://www.your-site.com/proxy.html</emphasis>
905 <quote>Listen-address</quote> specifies the address and port where
906 <application>Junkbuster</application> will listen for connections from your
907 Web browser. The default is to listen on the localhost port 8118, and
908 this is suitable for most users. (In your web browser, under proxy
909 configuration, list the proxy server as <quote>localhost</quote> and the
910 port as <quote>8118</quote>).
914 If you already have another service running on port 8118, or if you want to
915 serve requests from other machines (e.g. on your local network) as well, you
916 will need to override the default. The syntax is
917 <quote>listen-address [<ip-address>]:<port></quote>. If you leave
918 out the IP address, <application>junkbuster</application> will bind to all
919 interfaces (addresses) on your machine and may become reachable from the
920 Internet. In that case, consider using access control lists (acl's) (see
921 <quote>aclfile</quote> above), or a firewall.
925 For example, suppose you are running <application>Junkbuster</application> on
926 a machine which has the address 192.168.0.1 on your local private network
927 (192.168.0.0) and has another outside connection with a different address.
928 You want it to serve requests from inside only:
935 <emphasis>listen-address 192.168.0.1:8118</emphasis>
942 If you want it to listen on all addresses (including the outside
950 <emphasis>listen-address :8118</emphasis>
957 If you do this, consider using ACLs (see <quote>aclfile</quote> above). Note:
958 you will need to point your browser(s) to the address and port that you have
959 configured here. Default: localhost:8118 (127.0.0.1:8118).
963 The debug option sets the level of debugging information to log in the
964 logfile (and to the console in the Windows version). A debug level of 1 is
965 informative because it will show you each request as it happens. Higher
966 levels of debug are probably only of interest to developers.
973 debug 1 # GPC = show each GET/POST/CONNECT request
974 debug 2 # CONN = show each connection status
975 debug 4 # IO = show I/O status
976 debug 8 # HDR = show header parsing
977 debug 16 # LOG = log all data into the logfile
978 debug 32 # FRC = debug force feature
979 debug 64 # REF = debug regular expression filter
980 debug 128 # = debug fast redirects
981 debug 256 # = debug GIF de-animation
982 debug 512 # CLF = Common Log Format
983 debug 1024 # = debug kill pop-ups
984 debug 4096 # INFO = Startup banner and warnings.
985 debug 8192 # ERROR = Non-fatal errors
992 It is <emphasis>highly recommended</emphasis> that you enable ERROR
993 reporting (debug 8192), at least until the next stable release.
997 The reporting of FATAL errors (i.e. ones which crash
998 <application>JunkBuster</application>) is always on and cannot be disabled.
1002 If you want to use CLF (Common Log Format), you should set <quote>debug
1003 512</quote> ONLY, do not enable anything else.
1007 Multiple <quote>debug</quote> directives, are OK - they're logical-OR'd
1015 <emphasis>debug 15 # same as setting the first 4 listed above</emphasis>
1029 <emphasis>debug 1 # URLs</emphasis>
1030 <emphasis>debug 4096 # Info</emphasis>
1031 <emphasis>debug 8192 # Errors - *we highly recommended enabling this*</emphasis>
1038 <application>Junkbuster</application> normally uses
1039 <quote>multi-threading</quote>, a software technique that permits it to
1040 handle many different requests simultaneously. In some cases you may wish to
1041 disable this -- particularly if you're trying to debug a problem. The
1042 <quote>single-threaded</quote> option forces
1043 <application>Junkbuster</application> to handle requests sequentially.
1044 Default: Multi-threaded mode.
1051 <emphasis>#single-threaded</emphasis>
1058 <quote>toggle</quote> allows you to temporarily disable all
1059 <application>Junkbuster's</application> filtering. Just set <quote>toggle
1064 The Windows version of <application>Junkbuster</application> puts an icon in
1065 the system tray, which also allows you to change this option. If you
1066 right-click on that icon (or select the <quote>Options</quote> menu), one
1067 choice is <quote>Enable</quote>. Clicking on enable toggles
1068 <application>Junkbuster</application> on and off. This is useful if you want
1069 to temporarily disable <application>Junkbuster</application>, e.g., to access
1070 a site that requires cookies which you would otherwise have blocked. This can also
1071 be toggled via a web browser at the <application>Junkbuster</application>
1072 internal address of <ulink url="http://i.j.b">http://i.j.b</ulink> on
1077 <quote>toggle 1</quote> means <application>Junkbuster</application> runs
1078 normally, <quote>toggle 0</quote> means that
1079 <application>Junkbuster</application> becomes a non-anonymizing non-blocking
1080 proxy. Default: 1 (on).
1087 <emphasis>toggle 1</emphasis>
1094 For content filtering, i.e. the <quote>+filter</quote> and
1095 <quote>+deanimate-gif</quote> actions, it is necessary that
1096 <application>Junkbuster</application> buffers the entire document body.
1097 This can be potentially dangerous, since a server could just keep sending
1098 data indefinitely and wait for your RAM to exhaust. With nasty consequences.
1102 The <application>buffer-limit</application> option lets you set the maximum
1103 size in Kbytes that each buffer may use. When the documents buffer exceeds
1104 this size, it is flushed to the client unfiltered and no further attempt to
1105 filter the rest of it is made. Remember that there may multiple threads
1106 running, which might require increasing the <quote>buffer-limit</quote>
1107 Kbytes <emphasis>each</emphasis>, unless you have enabled
1108 <quote>single-threaded</quote> above.
1115 <emphasis>buffer-limit 4069</emphasis>
1122 To enable the web-based <filename>ijb.action</filename> file editor set
1123 <application>enable-edit-actions</application> to 1, or 0 to disable. Note
1124 that you must have compiled <application>JunkBuster</application> with
1125 support for this feature, otherwise this option has no effect. This
1126 internal page can be reached at <ulink
1127 url="http://i.j.b">http://i.j.b</ulink>.
1131 Security note: If this is enabled, anyone who can use the proxy
1132 can edit the actions file, and their changes will affect all users.
1133 For shared proxies, you probably want to disable this. Default: enabled.
1140 <emphasis>enable-edit-actions 1</emphasis>
1147 Allow <application>JunkBuster</application> to be toggled on and off
1148 remotely, using your web browser. Set <quote>enable-remote-toggle</quote>to
1149 1 to enable, and 0 to disable. Note that you must have compiled
1150 <application>JunkBuster</application> with support for this feature,
1151 otherwise this option has no effect.
1155 Security note: If this is enabled, anyone who can use the proxy can toggle
1156 it on or off (see <ulink url="http://i.j.b">http://i.j.b</ulink>), and
1157 their changes will affect all users. For shared proxies, you probably want to
1158 disable this. Default: enabled.
1165 <emphasis>enable-remote-toggle 1</emphasis>
1173 <!-- ~ End section ~ -->
1176 <!-- ~~~~~ New section ~~~~~ -->
1179 <title>Access Control List (ACL)</title>
1181 Access controls are included at the request of some ISPs and systems
1182 administrators, and are not usually needed by individual users. Please note
1183 the warnings in the FAQ that this proxy is not intended to be a substitute
1184 for a firewall or to encourage anyone to defer addressing basic security
1189 If no access settings are specified, the proxy talks to anyone that
1190 connects. If any access settings file are specified, then the proxy
1191 talks only to IP addresses permitted somewhere in this file and not
1192 denied later in this file.
1196 Summary -- if using an ACL:
1201 Client must have permission to receive service.
1206 LAST match in ACL wins.
1211 Default behavior is to deny service.
1216 The syntax for an entry in the Access Control List is:
1223 ACTION SRC_ADDR[/SRC_MASKLEN] [ DST_ADDR[/DST_MASKLEN] ]
1230 Where the individual fields are:
1237 <emphasis>ACTION</emphasis> = <quote>permit-access</quote> or <quote>deny-access</quote>
1239 <emphasis>SRC_ADDR</emphasis> = client hostname or dotted IP address
1240 <emphasis>SRC_MASKLEN</emphasis> = number of bits in the subnet mask for the source
1242 <emphasis>DST_ADDR</emphasis> = server or forwarder hostname or dotted IP address
1243 <emphasis>DST_MASKLEN</emphasis> = number of bits in the subnet mask for the target
1251 The field separator (FS) is whitespace (space or tab).
1255 IMPORTANT NOTE: If the <application>junkbuster</application> is using a
1256 forwarder (see below) or a gateway for a particular destination URL, the
1257 <literal>DST_ADDR</literal> that is examined is the address of the forwarder
1258 or the gateway and <emphasis>NOT</emphasis> the address of the ultimate
1259 target. This is necessary because it may be impossible for the local
1260 <application>Junkbuster</application> to determine the address of the
1261 ultimate target (that's often what gateways are used for).
1265 Here are a few examples to show how the ACL features work:
1269 <quote>localhost</quote> is OK -- no DST_ADDR implies that
1270 <emphasis>ALL</emphasis> destination addresses are OK:
1277 <emphasis>permit-access localhost</emphasis>
1284 A silly example to illustrate permitting any host on the class-C subnet with
1285 <application>Junkbuster</application> to go anywhere:
1292 <emphasis>permit-access www.junkbusters.com/24</emphasis>
1299 Except deny one particular IP address from using it at all:
1306 <emphasis>deny-access ident.junkbusters.com</emphasis>
1313 You can also specify an explicit network address and subnet mask.
1314 Explicit addresses do not have to be resolved to be used.
1321 <emphasis>permit-access 207.153.200.0/24</emphasis>
1328 A subnet mask of 0 matches anything, so the next line permits everyone.
1335 <emphasis>permit-access 0.0.0.0/0</emphasis>
1342 Note, you <emphasis>cannot</emphasis> say:
1349 <emphasis>permit-access .org</emphasis>
1356 to allow all *.org domains. Every IP address listed must resolve fully.
1360 An ISP may want to provide a <application>Junkbuster</application> that is
1361 accessible by <quote>the world</quote> and yet restrict use of some of their
1362 private content to hosts on its internal network (i.e. its own subscribers).
1363 Say, for instance the ISP owns the Class-B IP address block 123.124.0.0 (a 16
1364 bit netmask). This is how they could do it:
1371 <emphasis>permit-access 0.0.0.0/0 0.0.0.0/0</emphasis> # other clients can go anywhere
1372 # with the following exceptions:
1374 <emphasis>deny-access</emphasis> 0.0.0.0/0 123.124.0.0/16 # block all external requests for
1375 # sites on the ISP's network
1377 <emphasis>permit 0.0.0.0/0 www.my_isp.com</emphasis> # except for the ISP's main
1380 <emphasis>permit 123.124.0.0/16 0.0.0.0/0</emphasis> # the ISP's clients can go
1388 Note that if some hostnames are listed with multiple IP addresses,
1389 the primary value returned by DNS (via gethostbyname()) is used. Default:
1390 Anyone can access the proxy.
1395 <!-- ~ End section ~ -->
1398 <!-- ~~~~~ New section ~~~~~ -->
1401 <title>Forwarding</title>
1404 This feature allows chaining of HTTP requests via multiple proxies.
1405 It can be used to better protect privacy and confidentiality when
1406 accessing specific domains by routing requests to those domains
1407 to a special purpose filtering proxy such as lpwa.com. Or to use
1408 a caching proxy to speed up browsing.
1412 It can also be used in an environment with multiple networks to route
1413 requests via multiple gateways allowing transparent access to multiple
1414 networks without having to modify browser configurations.
1418 Also specified here are SOCKS proxies. <application>Junkbuster</application>
1419 SOCKS 4 and SOCKS 4A. The difference is that SOCKS 4A will resolve the target
1420 hostname using DNS on the SOCKS server, not our local DNS client.
1424 The syntax of each line is:
1431 <emphasis>forward target_domain[:port] http_proxy_host[:port]</emphasis>
1432 <emphasis>forward-socks4 target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]</emphasis>
1433 <emphasis>forward-socks4a target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]</emphasis>
1440 If http_proxy_host is <quote>.</quote>, then requests are not forwarded to a
1441 HTTP proxy but are made directly to the web servers.
1445 Lines are checked in sequence, and the last match wins.
1449 There is an implicit line equivalent to the following, which specifies that
1450 anything not finding a match on the list is to go out without forwarding
1451 or gateway protocol, like so:
1458 <emphasis>forward .* . </emphasis># implicit
1465 In the following common configuration, everything goes to Lucent's LPWA,
1466 except SSL on port 443 (which it doesn't handle):
1473 <emphasis>forward .* lpwa.com:8000</emphasis>
1474 <emphasis>forward :443 .</emphasis>
1481 See the FAQ for instructions on how to automate the login procedure for LPWA.
1482 Some users have reported difficulties related to LPWA's use of
1483 <quote>.</quote> as the last element of the domain, and have said that this
1484 can be fixed with this:
1491 <emphasis>forward lpwa. lpwa.com:8000</emphasis>
1498 (NOTE: the syntax for specifying target_domain has changed since the
1499 previous paragraph was written -- it will not work now. More information
1504 In this fictitious example, everything goes via an ISP's caching proxy,
1505 except requests to that ISP:
1512 <emphasis>forward .* caching.myisp.net:8000</emphasis>
1513 <emphasis>forward myisp.net .</emphasis>
1520 For the @home network, we're told the forwarding configuration is this:
1528 <emphasis>forward .* proxy:8080</emphasis>
1535 Also, we're told they insist on getting cookies and JavaScript, so you should
1536 add home.com to the cookie file. We consider JavaScript a security risk.
1537 Java need not be enabled.
1541 In this example direct connections are made to all <quote>internal</quote>
1542 domains, but everything else goes through Lucent's LPWA by way of the
1543 company's SOCKS gateway to the Internet.
1550 <emphasis>forward-socks4 .* lpwa.com:8000 firewall.my_company.com:1080</emphasis>
1551 <emphasis>forward my_company.com .</emphasis>
1558 This is how you could set up a site that always uses SOCKS but no forwarders:
1565 <emphasis>forward-socks4a .* . firewall.my_company.com:1080</emphasis>
1572 An advanced example for network administrators:
1576 If you have links to multiple ISPs that provide various special content to
1577 their subscribers, you can configure forwarding to pass requests to the
1578 specific host that's connected to that ISP so that everybody can see all
1579 of the content on all of the ISPs.
1583 This is a bit tricky, but here's an example:
1588 host-a has a PPP connection to isp-a.com. And host-b has a PPP connection to
1589 isp-b.com. host-a can run a <application>Junkbuster</application> proxy with
1590 forwarding like this:
1597 <emphasis>forward .* .</emphasis>
1598 <emphasis>forward isp-b.com host-b:8118</emphasis>
1605 host-b can run a <application>Junkbuster</application> proxy with forwarding
1613 <emphasis>forward .* .</emphasis>
1614 <emphasis>forward isp-a.com host-a:8118</emphasis>
1621 Now, <emphasis>anyone</emphasis> on the Internet (including users on host-a
1622 and host-b) can set their browser's proxy to <emphasis>either</emphasis>
1623 host-a or host-b and be able to browse the content on isp-a or isp-b.
1627 Here's another practical example, for University of Kent at
1628 Canterbury students with a network connection in their room, who
1629 need to use the University's Squid web cache.
1636 <emphasis>forward *. ssbcache.ukc.ac.uk:3128</emphasis> # Use the proxy, except for:
1637 <emphasis>forward .ukc.ac.uk . </emphasis> # Anything on the same domain as us
1638 <emphasis>forward * . </emphasis> # Host with no domain specified
1639 <emphasis>forward 129.12.*.* . </emphasis> # A dotted IP on our /16 network.
1640 <emphasis>forward 127.*.*.* . </emphasis> # Loopback address
1641 <emphasis>forward localhost.localdomain . </emphasis> # Loopback address
1642 <emphasis>forward www.ukc.mirror.ac.uk . </emphasis> # Specific host
1649 If you intend to chain <application>Junkbuster</application> and
1650 <application>squid</application> locally, then chain as
1651 <literal>browser -> squid -> junkbuster</literal> is the recommended way.
1655 Your squid configuration could then look like this:
1662 # Define junkbuster as parent cache
1663 <!-- per feedback from user...
1664 cache_peer 127.0.0.1 8118 parent 0 no-query
1666 cache_peer 127.0.0.1 parent 8118 0 no-query
1668 # Define ACL for protocol FTP
1671 # Do not forward ACL FTP to junkbuster
1672 always_direct allow FTP
1674 # Do not forward ACL CONNECT (https) to junkbuster
1675 always_direct allow CONNECT
1677 # Forward the rest to junkbuster
1678 never_direct allow all
1686 <!-- ~ End section ~ -->
1689 <!-- ~~~~~ New section ~~~~~ -->
1692 <title>Windows GUI Options</title>
1694 Removed references to Win32. HB 09/23/01
1697 <application>Junkbuster</application> has a number of options specific to the
1698 Windows GUI interface:
1702 If <quote>activity-animation</quote> is set to 1, the
1703 <application>Junkbuster</application> icon will animate when
1704 <quote>Junkbuster</quote> is active. To turn off, set to 0.
1711 <emphasis>activity-animation 1</emphasis>
1718 If <quote>log-messages</quote> is set to 1,
1719 <application>Junkbuster</application> will log messages to the console
1727 <emphasis>log-messages 1</emphasis>
1734 If <quote>log-buffer-size</quote> is set to 1, the size of the log buffer,
1735 i.e. the amount of memory used for the log messages displayed in the
1736 console window, will be limited to <quote>log-max-lines</quote> (see below).
1740 Warning: Setting this to 0 will result in the buffer to grow infinitely and
1741 eat up all your memory!
1748 <emphasis>log-buffer-size 1</emphasis>
1755 <application>log-max-lines</application> is the maximum number of lines held
1756 in the log buffer. See above.
1763 <emphasis>log-max-lines 200</emphasis>
1770 If <quote>log-highlight-messages</quote> is set to 1,
1771 <application>Junkbuster</application> will highlight portions of the log
1772 messages with a bold-faced font:
1779 <emphasis>log-highlight-messages 1</emphasis>
1786 The font used in the console window:
1793 <emphasis>log-font-name Comic Sans MS</emphasis>
1800 Font size used in the console window:
1807 <emphasis>log-font-size 8</emphasis>
1814 <quote>show-on-task-bar</quote> controls whether or not
1815 <application>Junkbuster</application> will appear as a button on the Task bar
1823 <emphasis>show-on-task-bar 0</emphasis>
1830 If <quote>close-button-minimizes</quote> is set to 1, the Windows close
1831 button will minimize <application>Junkbuster</application> instead of closing
1832 the program (close with the exit option on the File menu).
1839 <emphasis>close-button-minimizes 1</emphasis>
1846 The <quote>hide-console</quote> option is specific to the MS-Win console
1847 version of <application>JunkBuster</application>. If this option is used,
1848 <application>Junkbuster</application> will disconnect from and hide the
1865 <!-- ~ End section ~ -->
1868 <!-- ~~~~~ New section ~~~~~ -->
1869 <sect2 id="actionsfile">
1870 <title>The Actions File</title>
1873 The <quote>ijb.action</quote> file (formerly
1874 <filename>actionsfile</filename>) is used to define what actions
1875 <application>Junkbuster</application> takes, and thus determines how images,
1876 cookies and various other aspects of HTTP content and transactions are
1877 handled. Images can be anything you want, including ads, banners, or just
1878 some obnoxious image that you would rather not see. Cookies can be accepted
1879 or rejected, or accepted only during the current browser session (i.e.
1880 not written to disk). Changes to <filename>ijb.action</filename> should
1881 be immediately visible to <application>Junkbuster</application> without
1882 the need to restart.
1886 To determine which actions apply to a request, the URL of the request is
1887 compared to all patterns in this file. Every time it matches, the list of
1888 applicable actions for the URL is incrementally updated. You can trace
1889 this process by visiting <ulink
1890 url="http://i.j.b/show-url-info">http://i.j.b/show-url-info</ulink>.
1894 The actions file can be edited with a browser by loading
1895 <ulink url="http://i.j.b/">http://i.j.b/</ulink>, and then select
1896 <quote>Edit Actions</quote>.
1900 There are four types of lines in this file: comments (begin with a
1901 <quote>#</quote> character), actions, aliases and patterns, all of which are
1902 explained below, as well as the configuration file syntax that
1903 <application>Junkbuster</application> understands.
1908 <!-- ~~~~~ New section ~~~~~ -->
1910 <title>URL Domain and Path Syntax</title>
1912 Generally, a pattern has the form <domain>/<path>, where both the
1913 <domain> and <path> part are optional. If you only specify a
1914 domain part, the <quote>/</quote> can be left out:
1918 <emphasis>www.example.com</emphasis> - is a domain only pattern and will match any request to
1919 <quote>www.example.com</quote>.
1923 <emphasis>www.example.com/</emphasis> - means exactly the same.
1927 <emphasis>www.example.com/index.html</emphasis> - matches only the single
1928 document <quote>/index.html</quote> on <quote>www.example.com</quote>.
1932 <emphasis>/index.html</emphasis> - matches the document <quote>/index.html</quote>, regardless of
1937 <emphasis>index.html</emphasis> - matches nothing, since it would be
1938 interpreted as a domain name and there is no top-level domain called
1939 <quote>.html</quote>.
1943 The matching of the domain part offers some flexible options: if the
1944 domain starts or ends with a dot, it becomes unanchored at that end.
1949 <emphasis>.example.com</emphasis> - matches any domain that <emphasis>ENDS</emphasis> in
1950 <quote>.example.com</quote>.
1954 <emphasis>www.</emphasis> - matches any domain that <emphasis>STARTS</emphasis> with
1959 Additionally, there are wild-cards that you can use in the domain names
1960 themselves. They work pretty similar to shell wild-cards: <quote>*</quote>
1961 stands for zero or more arbitrary characters, <quote>?</quote> stands for
1962 any single character. And you can define character classes in square
1963 brackets and they can be freely mixed:
1967 <emphasis>ad*.example.com</emphasis> - matches <quote>adserver.example.com</quote>,
1968 <quote>ads.example.com</quote>, etc but not <quote>sfads.example.com</quote>.
1972 <emphasis>*ad*.example.com</emphasis> - matches all of the above, and then some.
1976 <emphasis>.?pix.com</emphasis> - matches <quote>www.ipix.com</quote>,
1977 <quote>pictures.epix.com</quote>, <quote>a.b.c.d.e.upix.com</quote>, etc.
1981 <emphasis>www[1-9a-ez].example.com</emphasis> - matches <quote>www1.example.com</quote>,
1982 <quote>www4.example.com</quote>, <quote>wwwd.example.com</quote>,
1983 <quote>wwwz.example.com</quote>, etc., but <emphasis>not</emphasis>
1984 <quote>wwww.example.com</quote>.
1988 If <application>Junkbuster</application> was compiled with
1989 <quote>pcre</quote> support (default), Perl compatible regular expressions
1990 can be used. See the <filename>pcre/docs/</filename> directory or <quote>man
1991 perlre</quote> (also available on <ulink
1992 url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>)
1993 for details. A brief discussion of regular expressions is in the
1994 <link linkend="regex">Appendix</link>. For instance:
1998 <emphasis>/.*/advert[0-9]+\.jpe?g</emphasis> - would match a URL from any
1999 domain, with any path that includes <quote>advert</quote> followed
2000 immediately by one or more digits, then a <quote>.</quote> and ending in
2001 either <quote>jpeg</quote> or <quote>jpg</quote>. So we match
2002 <quote>example.com/ads/advert2.jpg</quote>, and
2003 <quote>www.example.com/ads/banners/advert39.jpeg</quote>, but not
2004 <quote>www.example.com/ads/banners/advert39.gif</quote> (no gifs in the
2009 Please note that matching in the path is case
2010 <emphasis>INSENSITIVE</emphasis> by default, but you can switch to case
2011 sensitive at any point in the pattern by using the
2012 <quote>(?-i)</quote> switch:
2016 <emphasis>www.example.com/(?-i)PaTtErN.*</emphasis> - will match only
2017 documents whose path starts with <quote>PaTtErN</quote> in
2018 <emphasis>exactly</emphasis> this capitalization.
2023 <!-- ~ End section ~ -->
2027 <!-- ~~~~~ New section ~~~~~ -->
2030 <title>Actions</title>
2032 Actions are enabled if preceded with a <quote>+</quote>, and disabled if
2033 preceded with a <quote>-</quote>. Actions are invoked by enclosing the
2034 action name in curly braces (e.g. {+some_action}), followed by a list of
2035 URLs to which the action applies. There are three classes of actions:
2043 Boolean (e.g. <quote>+/-block</quote>):
2049 <emphasis>{+name}</emphasis> # enable this action
2050 <emphasis>{-name}</emphasis> # disable this action
2060 parameterized (e.g. <quote>+/-hide-user-agent</quote>):
2066 <emphasis>{+name{param}}</emphasis> # enable action and set parameter to <quote>param</quote>
2067 <emphasis>{-name}</emphasis> # disable action
2076 Multi-value (e.g. <quote>{+/-add-header{Name: value}}</quote>, <quote>{+/-wafer{name=value}}</quote>):
2082 <emphasis>{+name{param}}</emphasis> # enable action and add parameter <quote>param</quote>
2083 <emphasis>{-name{param}}</emphasis> # remove the parameter <quote>param</quote>
2084 <emphasis>{-name}</emphasis> # disable this action totally
2095 If nothing is specified in this file, no <quote>actions</quote> are taken.
2096 So in this case <application>JunkBuster</application> would just be a
2097 normal, non-blocking, non-anonymizing proxy. You must specifically
2098 enable the privacy and blocking features you need (although the
2099 provided default <filename>ijb.action</filename> file will
2100 give a good starting point).
2104 Later defined actions always over-ride earlier ones. For multi-valued
2105 actions, the actions are applied in the order they are specified.
2109 The list of valid <application>Junkbuster</application> <quote>actions</quote> are:
2117 Add the specified HTTP header, which is not checked for validity.
2118 You may specify this many times to specify many different headers:
2124 <emphasis>+add-header{Name: value}</emphasis>
2134 Block this URL totally.
2140 <emphasis>+block</emphasis>
2150 De-animate all animated GIF images, i.e. reduce them to their last frame.
2151 This will also shrink the images considerably (in bytes, not pixels!). If
2152 the option <quote>first</quote> is given, the first frame of the animation
2153 is used as the replacement. If <quote>last</quote> is given, the last frame
2154 of the animation is used instead, which probably makes more sense for most
2155 banner animations, but also has the risk of not showing the entire last
2156 frame (if it is only a delta to an earlier frame).
2162 <emphasis>+deanimate-gifs{last}</emphasis>
2163 <emphasis>+deanimate-gifs{first}</emphasis>
2172 <quote>+downgrade</quote> will downgrade HTTP/1.1 client requests to
2173 HTTP/1.0 and downgrade the responses as well. Use this action for servers
2174 that use HTTP/1.1 protocol features that
2175 <application>Junkbuster</application> doesn't handle well yet. HTTP/1.1
2176 is only partially implemented. Default is not to downgrade requests.
2182 <emphasis>+downgrade</emphasis>
2191 Many sites, like yahoo.com, don't just link to other sites. Instead, they
2192 will link to some script on their own server, giving the destination as a
2193 parameter, which will then redirect you to the final target. URLs resulting
2194 from this scheme typically look like:
2195 http://some.place/some_script?http://some.where-else.
2198 Sometimes, there are even multiple consecutive redirects encoded in the
2199 URL. These redirections via scripts make your web browsing more traceable,
2200 since the server from which you follow such a link can see where you go to.
2201 Apart from that, valuable bandwidth and time is wasted, while your browser
2202 ask the server for one redirect after the other. Plus, it feeds the
2206 The <quote>+fast-redirects</quote> option enables interception of these
2207 requests by <application>Junkbuster</application>, who will cut off all but
2208 the last valid URL in the request and send a local redirect back to your
2209 browser without contacting the remote site.
2215 <emphasis>+fast-redirects</emphasis>
2224 Apply the filters in the <literal>section_header</literal>
2225 section of the <filename>re_filterfile</filename> file to the site(s).
2226 <filename>Re_filterfile</filename> sections are grouped according to like
2234 <emphasis>+filter{section_header}</emphasis>
2241 Filter sections that are pre-defined in the supplied
2242 <filename>re_filterfile</filename> include:
2248 <emphasis>html-annoyances</emphasis>: Get rid of particularly annoying HTML abuse.
2253 <emphasis>js-annoyances</emphasis>: Get rid of particularly annoying JavaScript abuse
2258 <emphasis>no-poups</emphasis>: Kill all popups in JS and HTML
2263 <emphasis>frameset-borders</emphasis>: Give frames a border
2268 <emphasis>webbugs</emphasis>: Squish WebBugs (1x1 invisible GIFs used for user tracking)
2273 <emphasis>no-refresh</emphasis>: Automatic refresh sucks on auto-dialup lines
2278 <emphasis>fun</emphasis>: Text replacements for subversive browsing fun!
2283 <emphasis>nimda</emphasis>: Remove (virus) Nimda code.
2288 <emphasis>banners-by-size</emphasis>: Kill banners by size
2293 <emphasis>crude-parental</emphasis>: Kill all web pages that contain the words "sex" or "warez"
2302 Block any existing X-Forwarded-for header, and do not add a new one:
2308 <emphasis>+hide-forwarded</emphasis>
2317 If the browser sends a <quote>From:</quote> header containing your e-mail
2318 address, this either completely removes the header (<quote>block</quote>), or
2319 changes it to the specified e-mail address.
2325 <emphasis>+hide-from{block}</emphasis>
2326 <emphasis>+hide-from{spam@sittingduck.xqq}</emphasis>
2335 Don't send the <quote>Referer:</quote> (sic) header to the web site. You
2336 can block it, forge a URL to the same server as the request (which is
2337 preferred because some sites will not send images otherwise) or set it to a
2338 constant string of your choice.
2344 <emphasis>+hide-referer{block}</emphasis>
2345 <emphasis>+hide-referer{forge}</emphasis>
2346 <emphasis>+hide-referer{http://nowhere.com}</emphasis>
2355 Alternative spelling of <quote>+hide-referer</quote>. It has the same
2356 parameters, and can be freely mixed with, <quote>+hide-referer</quote>.
2357 (<quote>referrer</quote> is the correct English spelling, however the HTTP
2358 specification has a bug - it requires it to be spelled <quote>referer</quote>.)
2364 <emphasis>+hide-referrer{...}</emphasis>
2373 Change the <quote>User-Agent:</quote> header so web servers can't tell your
2374 browser type. Warning! This breaks many web sites. Specify the
2375 user-agent value you want. Example, pretend to be using Netscape on
2382 <emphasis>+hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}</emphasis>
2389 Or to identify yourself explicitly as a <quote>Junkbuster</quote> user:
2395 <emphasis>+hide-user-agent{JunkBuster/1.0}</emphasis>
2400 (Don't change the version number from 1.0 - after all, why tell them?)
2407 <emphasis>+hide-user-agent{browser-type}</emphasis>
2417 Treat this URL as an image. This only matters if it's also <quote>+block</quote>ed,
2418 in which case a <quote>blocked</quote> image can be sent rather than a HTML page.
2419 See <quote>+image-blocker{}</quote> below for the control over what is actually sent.
2425 <emphasis>+image</emphasis>
2434 Decides what to do with URLs that end up tagged with <quote>{+block
2435 +image}</quote>, e.g an advertizement. There are five options.
2436 <quote>-image-blocker</quote> will send a HTML <quote>blocked</quote> page,
2437 usually resulting in a <quote>broken image</quote> icon.
2438 <quote>+image-blocker{logo}</quote> will send a <quote>JunkBuster</quote>
2439 logo image. <quote>+image-blocker{blank}</quote> will send a 1x1
2440 transparent GIF image. And finally,
2441 <quote>+image-blocker{http://xyz.com}</quote> will send a HTTP temporary
2442 redirect to the specified image. This has the advantage of the icon being
2443 being cached by the browser, which will speed up the display.
2444 <quote>+image-blocker{pattern}</quote> will send a checkboard type pattern,
2445 which scales better than the logo (which can get blocky if the browser
2446 enlarges it too much).
2452 <emphasis>+image-blocker{logo}</emphasis>
2453 <emphasis>+image-blocker{blank}</emphasis>
2454 <emphasis>+image-blocker{pattern}</emphasis>
2455 <emphasis>+image-blocker{http://i.j.b/send-banner}</emphasis>
2464 By default (i.e. in the absence of a <quote>+limit-connect</quote>
2465 action), <application>Junkbuster</application> will only allow CONNECT
2466 requests to port 443, which is the standard port for https as a
2471 The CONNECT methods exists in HTTP to allow access to secure websites
2472 (https:// URLs) through proxies. It works very simply: the proxy
2473 connects to the server on the specified port, and then short-circuits
2474 its connections to the client <emphasis>and</emphasis> to the remote proxy.
2475 This can be a big security hole, since CONNECT-enabled proxies can
2476 be abused as TCP relays very easily.
2480 If you want to allow CONNECT for more ports than this, or want to forbid
2481 CONNECT altogether, you can specify a comma separated list of ports and
2482 port ranges (the latter using dashes, with the minimum defaulting to 0 and
2490 <emphasis>+limit-connect{443} # This is the default and need no be specified.</emphasis>
2491 <emphasis>+limit-connect{80,443} # Ports 80 and 443 are OK.</emphasis>
2492 <emphasis>+limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100</emphasis>
2493 <emphasis> #and above 500 are OK.</emphasis>
2503 <quote>+no-compression</quote> prevents the website from compressing the
2504 data. Some websites do this, which can be a problem for
2505 <application>Junkbuster</application>, since <quote>+filter</quote>,
2506 <quote>+no-popup</quote> and <quote>+gif-deanimate</quote> will not work on
2507 compressed data. This will slow down connections to those websites,
2508 though. Default is <quote>nocompression</quote> is turned on.
2515 <emphasis>+nocompression</emphasis>
2524 If the website sets cookies, <quote>no-cookies-keep</quote> will make sure
2525 they are erased when you exit and restart your web browser. This makes
2526 profiling cookies useless, but won't break sites which require cookies so
2527 that you can log in for transactions. Default: on.
2533 <emphasis>+no-cookies-keep</emphasis>
2542 Prevent the website from reading cookies:
2548 <emphasis>+no-cookies-read</emphasis>
2557 Prevent the website from setting cookies:
2563 <emphasis>+no-cookies-set</emphasis>
2572 Filter the website through a built-in filter to disable those obnoxious
2573 JavaScript pop-up windows via window.open(), etc. The two alternative
2574 spellings are equivalent.
2580 <emphasis>+no-popup</emphasis>
2581 <emphasis>+no-popups</emphasis>
2590 This action only applies if you are using a <filename>jarfile</filename>
2591 for saving cookies. It sends a cookie to every site stating that you do not
2592 accept any copyright on cookies sent to you, and asking them not to track
2593 you. Of course, this is a (relatively) unique header they could use to
2600 <emphasis>+vanilla-wafer</emphasis>
2609 This allows you to add an arbitrary cookie. It can be specified multiple
2610 times in order to add as many cookies as you like.
2616 <emphasis>+wafer{name=value}</emphasis>
2627 The meaning of any of the above is reversed by preceding the action with a
2628 <quote>-</quote>, in place of the <quote>+</quote>.
2636 Turn off cookies by default, then allow a few through for specified sites:
2643 # Turn off all persistent cookies
2644 { +no-cookies-read }
2646 # Allow cookies for this browser session ONLY
2647 { +no-cookies-keep }
2649 # Exceptions to the above, sites that benefit from persistent cookies
2650 { -no-cookies-read }
2652 { -no-cookies-keep }
2659 # Alternative way of saying the same thing
2660 {-no-cookies-set -no-cookies-read -no-cookies-keep}
2669 Now turn off <quote>fast redirects</quote>, and then we allow two exceptions:
2679 # Reverse it for these two sites, which don't work right without it.
2681 www.ukc.ac.uk/cgi-bin/wac\.cgi\?
2689 Turn on page filtering according to rules in the defined sections
2690 of <filename>refilterfile</filename>, and make one exception for
2698 # Run everything through the filter file, using only the
2699 # specified sections:
2700 +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}\
2701 +filter{webbugs} +filter{nimda} +filter{banners-by-size}
2703 # Then disable filtering of code from sourceforge!
2705 .cvs.sourceforge.net
2712 Now some URLs that we want <quote>blocked</quote>, ie we won't see them.
2713 Many of these use regular expressions that will expand to match multiple
2723 /.*/(.*[-_.])?ads?[0-9]?(/|[-_.].*|\.(gif|jpe?g))
2724 /.*/(.*[-_.])?count(er)?(\.cgi|\.dll|\.exe|[?/])
2725 /.*/(ng)?adclient\.cgi
2726 /.*/(plain|live|rotate)[-_.]?ads?/
2727 /.*/(sponsor)s?[0-9]?/
2728 /.*/_?(plain|live)?ads?(-banners)?/
2730 /.*/ad(sdna_image|gifs?)/
2731 /.*/ad(server|stream|juggler)\.(cgi|pl|dll|exe)
2735 /.*/adv((er)?ts?|ertis(ing|ements?))?/
2739 /.*/cgi-bin/centralad/getimage
2740 /.*/images/addver\.gif
2741 /.*/images/marketing/.*\.(gif|jpe?g)
2745 /.*/sponsors?[0-9]?/
2746 /.*/advert[0-9]+\.jpg
2753 /graphics/defaultAd/
2755 /image\.ng/transactionID
2756 /images/.*/.*_anim\.gif # alvin brattli
2757 /ip_img/.*\.(gif|jpe?g)
2761 /cgi-bin/nph-adclick.exe/
2762 /.*/Image/BannerAdvertising/
2764 /.*/adlib/server\.cgi
2773 <!-- ~ End section ~ -->
2776 <!-- ~~~~~ New section ~~~~~ -->
2778 <title>Aliases</title>
2780 Custom <quote>actions</quote>, known to <application>Junkbuster</application>
2781 as <quote>aliases</quote>, can be defined by combining other <quote>actions</quote>.
2782 These can in turn be invoked just like the built-in <quote>actions</quote>.
2783 Currently, an alias can contain any character except space, tab, <quote>=</quote>,
2784 <quote>{</quote> or <quote>}</quote>. But please use only <quote>a</quote>-
2785 <quote>z</quote>, <quote>0</quote>-<quote>9</quote>, <quote>+</quote>, and
2786 <quote>-</quote>. Alias names are not case sensitive, and
2787 <emphasis>must be defined before anything</emphasis> else in the
2788 <filename>ijb.action</filename>file ! And there can only be one set of
2789 <quote>aliases</quote> defined.
2793 Now let's define a few aliases:
2800 # Useful customer aliases we can use later. These must come first!
2802 +no-cookies = +no-cookies-set +no-cookies-read
2803 -no-cookies = -no-cookies-set -no-cookies-read
2804 fragile = -block -no-cookies -filter -fast-redirects -hide-referer -no-popups
2805 shop = -no-cookies -filter -fast-redirects
2806 +imageblock = +block +image
2808 #For people who don't like to type too much: ;-)
2811 c2 = -no-cookies-set +no-cookies-read
2812 c3 = +no-cookies-set -no-cookies-read
2813 #... etc. Customize to your heart's content.
2820 Some examples using our <quote>shop</quote> and <quote>fragile</quote>
2828 # These sites are very complex and require
2829 # minimal interference.
2831 .office.microsoft.com
2832 .windowsupdate.microsoft.com
2835 # Shopping sites - still want to block ads.
2838 .worldpay.com # for quietpc.com
2842 # These shops require pop-ups
2854 <!-- ~ End section ~ -->
2857 <!-- ~~~~~ New section ~~~~~ -->
2858 <sect2 id="filterfile">
2859 <title>The Filter File</title>
2861 Any web page can be dynamically modified with the filter file. This
2862 modification can be removal, or re-writing, of any web page content,
2863 including tags and non-visible content. The default filter file is
2864 <filename>re_filterfile</filename>, located in the config directory.
2868 The included example file is divided into sections. Each section begins
2869 with the <literal>FILTER</literal> keyword, followed by the identifier
2870 for that section, e.g. <quote>FILTER: webbugs</quote>. Each section performs
2871 a similar type of filtering, such as <quote>html-annoyances</quote>.
2876 This file uses regular expressions to alter or remove any string in the
2877 target page. The expressions can only operate on one line at a time. Some
2878 examples from the included default <filename>re_filterfile</filename>:
2882 Stop web pages from displaying annoying messages in the status bar by
2883 deleting such references:
2890 FILTER: html-annoyances
2892 # New browser windows should be resizeable and have a location and status
2895 s/resizable="?(no|0)"?/resizable=1/ig s/noresize/yesresize/ig
2896 s/location="?(no|0)"?/location=1/ig s/status="?(no|0)"?/status=1/ig
2897 s/scrolling="?(no|0|Auto)"?/scrolling=1/ig
2898 s/menubar="?(no|0)"?/menubar=1/ig
2900 # The <BLINK> tag was a crime!
2902 s*<blink>|</blink>**ig
2906 #s/framespacing="?(no|0)"?//ig
2907 #s/margin(height|width)=[0-9]*//gi
2914 Just for kicks, replace any occurrence of <quote>Microsoft</quote> with
2915 <quote>MicroSuck</quote>, and have a little fun with topical buzzwords:
2924 s/microsoft(?!.com)/MicroSuck/ig
2928 s/industry-leading|cutting-edge|award-winning/<font color=red><b>BINGO!</b></font>/ig
2935 Kill those pesky little web-bugs:
2942 # webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking)
2945 s/<img\s+[^>]*?(width|height)\s*=\s*['"]?1\D[^>]*?(width|height)\s*=\s*['"]?1(\D[^>]*?)?>/<!-- Squished WebBug -->/sig
2953 <!-- ~ End section ~ -->
2957 <!-- ~~~~~ New section ~~~~~ -->
2960 <title>Templates</title>
2962 When <application>Junkbuster</application> displays one of its internal
2963 pages, such as a 404 Not Found error page, it uses the appropriate template.
2964 On Linux, BSD, and Unix, these are located in
2965 <filename>/etc/junkbuster/templates</filename> by default. These may be
2966 customized, if desired.
2973 <!-- ~ End section ~ -->
2977 <!-- ~~~~~ New section ~~~~~ -->
2978 <sect1 id="quickstart"><title>Quickstart to Using Junkbuster</title>
2980 Install package, then run and enjoy! <application>JunkBuster</application>
2981 is typically started by specifying the main configuration file to be
2982 used on the command line. Example Unix startup command:
2988 # /usr/sbin/junkbuster /etc/junkbuster/config
2994 An init script is provided for SuSE and Redhat.
2998 For for SuSE: /etc/rc.d/junkbuster start
3002 For RedHat: /etc/rc.d/init.d/junkbuster start
3007 If no configuration file is specified on the command line,
3008 <application>Junkbuster</application> will look for a file named
3009 <filename>config</filename> in the current directory. Except on Win32 where
3010 it will try <filename>config.txt</filename>. If no file is specified on the
3011 command line and no default configuration file can be found,
3012 <application>Junkbuster</application> will fail to start.
3016 Be sure your browser is set to use the proxy which is by default at
3017 localhost, port 8118. With <application>Netscape</application> (and
3018 <application>Mozilla</application>), this can be set under <literal>Edit
3019 -> Preferences -> Advanced -> Proxies -> HTTP Proxy</literal>.
3020 For <application>Internet Explorer</application>: <literal>Tools >
3021 Internet Properties -> Connections -> LAN Setting</literal>. Then,
3022 check <quote>Use Proxy</quote> and fill in the appropriate info (Address:
3023 localhost, Port: 8118). Include if HTTPS proxy support too.
3027 The included default configuration files should give a reasonable starting
3028 point, though may be somewhat aggressive in blocking junk. You will probably
3029 want to keep an eye out for sites that require persistent cookies, and add these to
3030 <filename>ijb.action</filename> as needed. By default, most of these will
3031 be accepted only during the current browser session, until you add them to
3032 the configuration. If you want the browser to handle this instead, you will
3033 need to edit <filename>ijb.action</filename> and disable this feature. If you
3034 use more than one browser, it would make more sense to let
3035 <application>Junkbuster</application> handle this. In which case, the
3036 browser(s) should be set to accept all cookies.
3040 If a particular site shows problems loading properly, try adding it
3041 to the <literal>{fragile}</literal> section of
3042 <filename>ijb.action</filename>. This will turn off most actions for
3047 <application>Junkbuster</application> is HTTP/1.1 compliant, but not all 1.1
3048 features are as yet implemented. If browsers that support HTTP/1.1 (like
3049 <application>Mozilla</application> or recent versions of I.E.) experience
3050 problems, you might try to force HTTP/1.0 compatibility. For Mozilla, look
3051 under <literal>Edit -> Preferences -> Debug -> Networking</literal>.
3052 Or set the <quote>+downgrade</quote> config option in
3053 <filename>ijb.action</filename>.
3057 After running <application>Junkbuster</application> for a while, you can
3058 start to fine tune the configuration to suit your personal, or site,
3059 preferences and requirements. There are many, many aspects that can
3060 be customized. <quote>Actions</quote> (as specified in <filename>ijb.action</filename>)
3061 can be adjusted by pointing your browser to
3062 <ulink url="http://i.j.b/">http://i.j.b/</ulink>,
3063 and then follow the link to <quote>edit the actions list</quote>.
3064 (This is an internal page and does not require Internet access.)
3068 In fact, various aspects of <application>Junkbuster</application>
3069 configuration can be viewed from this page, including
3070 current configuration parameters, source code version numbers,
3071 the browser's request headers, and <quote>actions</quote> that apply
3072 to a given URL. In addition to the <filename>ijb.action</filename> file
3073 editor mentioned above, <application>Junkbuster</application> can also
3074 be turned <quote>on</quote> and <quote>off</quote> from this page.
3078 If you encounter problems, please verify it is a
3079 <application>Junkbuster</application> bug, by disabling
3080 <application>Junkbuster</application>, and then trying the same page.
3081 Also, try another browser if possible to eliminate browser or site
3082 problems. Before reporting it as a bug, see if there is not a configuration
3083 option that is enabled that is causing the page not to load. You can
3084 then add an exception for that page or site. If a bug, please report it to
3085 the developers (see below).
3090 <!-- ~~~~~ New section ~~~~~ -->
3093 <title>Command Line Options</title>
3095 <application>JunkBuster</application> may be invoked with the following
3096 command-line options:
3104 <emphasis>--version</emphasis>
3107 Print version info and exit, Unix only.
3112 <emphasis>--help</emphasis>
3115 Print a short usage info and exit, Unix only.
3120 <emphasis>--no-daemon</emphasis>
3123 Don't become a daemon, i.e. don't fork and become process group
3124 leader, don't detach from controlling tty. Unix only.
3129 <emphasis>--pidfile FILE</emphasis>
3133 On startup, write the process ID to <emphasis>FILE</emphasis>. Delete the
3134 <emphasis>FILE</emphasis> on exit. Failiure to create or delete the
3135 <emphasis>FILE</emphasis> is non-fatal. If no <emphasis>FILE</emphasis>
3136 option is given, no PID file will be used. Unix only.
3141 <emphasis>--user USER[.GROUP]</emphasis>
3145 After (optionally) writing the PID file, assume the user ID of
3146 <emphasis>USER</emphasis>, and if included the GID of GROUP. Exit if the
3147 privileges are not sufficient to do so. Unix only.
3152 <emphasis>configfile</emphasis>
3155 If no <emphasis>configfile</emphasis> is included on the command line,
3156 <application>JunkBuster</application> will look for a file named
3157 <quote>config</quote> in the current directory (except on Win32
3158 where it will look for <quote>config.txt</quote> instead). Specify
3159 full path to avoid confusion.
3170 <!-- ~ End section ~ -->
3174 <!-- ~~~~~ New section ~~~~~ -->
3176 <sect1 id="contact"><title>Contacting the Developers, Bug Reporting and Feature
3179 We value your feedback. However, to provide you with the best support,
3184 <listitem><para>Use the <ulink url="http://sourceforge.net/tracker/?group_id=11118&atid=211118">Sourceforge support forum</ulink> to get
3185 help.</para></listitem>
3187 <listitem><para>Submit bugs only thru our <ulink url="http://sourceforge.net/tracker/?group_id=11118&atid=111118">Sourceforge bug
3189 Make sure that the bug has not already been submitted. Please try to
3190 verify that it is a <application>Junkbuster</application> bug, and not
3191 a browser or site bug first. If you are using your own custom configuration,
3192 please try the stock configs to see if the problem is a configuration
3193 related bug. And if not using the latest development snapshot, please
3194 try the latest one. Or even better, CVS sources.</para>
3198 <listitem><para>Submit feature requests only thru our <ulink
3199 url="http://sourceforge.net/tracker/?atid=361118&group_id=11118&func=browse">Sourceforge feature request forum</ulink>.</para></listitem>
3207 For any other issues, feel free to use the <ulink url="http://sourceforge.net/mail/?group_id=11118">mailing lists</ulink>.
3211 Anyone interested in actively participating in development and related
3212 discussions can join the appropriate mailing list
3213 <ulink url="http://sourceforge.net/mail/?group_id=11118">here</ulink>.
3214 Archives are available here too.
3220 <!-- ~~~~~ New section ~~~~~ -->
3221 <sect1 id="copyright"><title>Copyright and History</title>
3224 <title>License</title>
3226 <application>Internet Junkbuster</application> is free software; you can
3227 redistribute it and/or modify it under the terms of the GNU General Public
3228 License as published by the Free Software Foundation; either version 2 of the
3229 License, or (at your option) any later version.
3233 This program is distributed in the hope that it will be useful, but WITHOUT
3234 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
3235 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
3236 details, which is available from <ulink
3237 url="http://www.gnu.org/copyleft/gpl.html">the Free Software Foundation,
3238 Inc</ulink>, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3243 <!-- ~ End section ~ -->
3246 <!-- ~~~~~ New section ~~~~~ -->
3249 <title>History</title>
3251 <application>Junkbuster</application> was originally written by Anonymous
3253 url="http://www.junkbusters.com/ht/en/ijbfaq.html">Junkbuster's
3254 Corporation</ulink>, and was released as free open-source software under the
3255 GNU GPL. <ulink url="http://www.waldherr.org/junkbuster/">Stefan
3256 Waldherr</ulink> made many improvements, and started the <ulink
3257 url="http://sourceforge.net/projects/ijbswa/">SourceForge project</ulink> to
3258 rekindle development. There are now several active developers contributing.
3259 The last stable release was v2.0.2, which has now grown whiskers ;-).
3266 <!-- ~~~~~ New section ~~~~~ -->
3267 <sect1 id="seealso"><title>See also</title>
3272 <ulink url="http://sourceforge.net/projects/ijbswa">http://sourceforge.net/projects/ijbswa</ulink>
3277 <ulink url="http://ijbswa.sourceforge.net/">http://ijbswa.sourceforge.net/</ulink>
3282 <ulink url="http://i.j.b/">http://i.j.b/</ulink>
3287 <ulink url="http://www.junkbusters.com/ht/en/cookies.html">http://www.junkbusters.com/ht/en/cookies.html</ulink>
3292 <ulink url="http://www.waldherr.org/junkbuster/">http://www.waldherr.org/junkbuster/</ulink>
3297 <ulink url="http://privacy.net/analyze/">http://privacy.net/analyze/</ulink>
3302 <ulink url="http://www.squid-cache.org/">http://www.squid-cache.org/</ulink>
3311 <!-- ~~~~~ New section ~~~~~ -->
3312 <sect1 id="appendix"><title>Appendix</title>
3315 <!-- ~~~~~ New section ~~~~~ -->
3317 <title>Regular Expressions</title>
3319 <application>Junkbuster</application> can use <quote>regular expressions</quote>
3320 in various config files. Assuming support for <quote>pcre</quote> (Perl
3321 Compatible Regular Expressions) is compiled in, which is the default. Such
3322 configuration directives do not require regular expressions, but they can be
3323 used to increase flexibility by matching a pattern with wild-cards against
3328 If you are reading this, you probably don't understand what <quote>regular
3329 expressions</quote> are, or what they can do. So this will be a very brief
3330 introduction only. A full explanation would require a book ;-)
3334 <quote>Regular expressions</quote> is a way of matching one character
3335 expression against another to see if it matches or not. One of the
3336 <quote>expressions</quote> is a literal string of readable characters
3337 (letter, numbers, etc), and the other is a complex string of literal
3338 characters combined with wild-cards, and other special characters, called
3339 meta-characters. The <quote>meta-characters</quote> have special meanings and
3340 are used to build the complex pattern to be matched against. Perl Compatible
3341 Regular Expressions is an enhanced form of the regular expression language
3342 with backward compatibility.
3346 To make a simple analogy, we do something similar when we use wild-card
3347 characters when listing files with the <command>dir</command> command in DOS.
3348 <literal>*.*</literal> matches all filenames. The <quote>special</quote>
3349 character here is the asterisk which matches any and all characters. We can be
3350 more specific and use <literal>?</literal> to match just individual
3351 characters. So <quote>dir file?.text</quote> would match
3352 <quote>file1.txt</quote>, <quote>file2.txt</quote>, etc. We are pattern
3353 matching, using a similar technique to <quote>regular expressions</quote>!
3357 Regular expressions do essentially the same thing, but are much, much more
3358 powerful. There are many more <quote>special characters</quote> and ways of
3359 building complex patterns however. Let's look at a few of the common ones,
3360 and then some examples:
3365 <emphasis>.</emphasis> - Matches any single character, e.g. <quote>a</quote>,
3366 <quote>A</quote>, <quote>4</quote>, <quote>:</quote>, or <quote>@</quote>.
3372 <emphasis>?</emphasis> - The preceding character or expression is matched ZERO or ONE
3379 <emphasis>+</emphasis> - The preceding character or expression is matched ONE or MORE
3386 <emphasis>*</emphasis> - The preceding character or expression is matched ZERO or MORE
3393 <emphasis>\</emphasis> - The <quote>escape</quote> character denotes that
3394 the following character should be taken literally. This is used where one of the
3395 special characters (e.g. <quote>.</quote>) needs to be taken literally and
3396 not as a special meta-character.
3402 <emphasis>[]</emphasis> - Characters enclosed in brackets will be matched if
3403 any of the enclosed characters are encountered.
3409 <emphasis>()</emphasis> - parentheses are used to group a sub-expression,
3410 or multiple sub-expressions.
3416 <emphasis>|</emphasis> - The <quote>bar</quote> character works like an
3417 <quote>or</quote> conditional statement. A match is successful if the
3418 sub-expression on either side of <quote>|</quote> matches.
3424 <emphasis>s/string1/string2/g</emphasis> - This is used to rewrite strings of text.
3425 <quote>string1</quote> is replaced by <quote>string2</quote> in this
3431 These are just some of the ones you are likely to use when matching URLs with
3432 <application>Junkbuster</application>, and is a long way from a definitive
3433 list. This is enough to get us started with a few simple examples which may
3434 be more illuminating:
3438 <emphasis><literal>/.*/banners/.*</literal></emphasis> - A simple example
3439 that uses the common combination of <quote>.</quote> and <quote>*</quote> to
3440 denote any character, zero or more times. In other words, any string at all.
3441 So we start with a literal forward slash, then our regular expression pattern
3442 (<quote>.*</quote>) another literal forward slash, the string
3443 <quote>banners</quote>, another forward slash, and lastly another
3444 <quote>.*</quote>. We are building
3445 a directory path here. This will match any file with the path that has a
3446 directory named <quote>banners</quote> in it. The <quote>.*</quote> matches
3447 any characters, and this could conceivably be more forward slashes, so it
3448 might expand into a much longer looking path. For example, this could match:
3449 <quote>/eye/hate/spammers/banners/annoy_me_please.gif</quote>, or just
3450 <quote>/banners/annoying.html</quote>, or almost an infinite number of other
3451 possible combinations, just so it has <quote>banners</quote> in the path
3456 A now something a little more complex:
3460 <emphasis><literal>/.*/adv((er)?ts?|ertis(ing|ements?))?/</literal></emphasis> -
3461 We have several literal forward slashes again (<quote>/</quote>), so we are
3462 building another expression that is a file path statement. We have another
3463 <quote>.*</quote>, so we are matching against any conceivable sub-path, just so
3464 it matches our expression. The only true literal that <emphasis>must
3465 match</emphasis> our pattern is <application>adv</application>, together with
3466 the forward slashes. What comes after the <quote>adv</quote> string is the
3471 Remember the <quote>?</quote> means the preceding expression (either a
3472 literal character or anything grouped with <quote>(...)</quote> in this case)
3473 can exist or not, since this means either zero or one match. So
3474 <quote>((er)?ts?|ertis(ing|ements?))</quote> is optional, as are the
3475 individual sub-expressions: <quote>(er)</quote>,
3476 <quote>(ing|ements?)</quote>, and the <quote>s</quote>. The <quote>|</quote>
3477 means <quote>or</quote>. We have two of those. For instance,
3478 <quote>(ing|ements?)</quote>, can expand to match either <quote>ing</quote>
3479 <emphasis>OR</emphasis> <quote>ements?</quote>. What is being done here, is an
3480 attempt at matching as many variations of <quote>advertisement</quote>, and
3481 similar, as possible. So this would expand to match just <quote>adv</quote>,
3482 or <quote>advert</quote>, or <quote>adverts</quote>, or
3483 <quote>advertising</quote>, or <quote>advertisement</quote>, or
3484 <quote>advertisements</quote>. You get the idea. But it would not match
3485 <quote>advertizements</quote> (with a <quote>z</quote>). We could fix that by
3486 changing our regular expression to:
3487 <quote>/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/</quote>, which would then match
3492 <emphasis><literal>/.*/advert[0-9]+\.(gif|jpe?g)</literal></emphasis> - Again
3493 another path statement with forward slashes. Anything in the square brackets
3494 <quote>[]</quote> can be matched. This is using <quote>0-9</quote> as a
3495 shorthand expression to mean any digit one through nine. It is the same as
3496 saying <quote>0123456789</quote>. So any digit matches. The <quote>+</quote>
3497 means one or more of the preceding expression must be included. The preceding
3498 expression here is what is in the square brackets -- in this case, any digit
3499 one through nine. Then, at the end, we have a grouping: <quote>(gif|jpe?g)</quote>.
3500 This includes a <quote>|</quote>, so this needs to match the expression on
3501 either side of that bar character also. A simple <quote>gif</quote> on one side, and the other
3502 side will in turn match either <quote>jpeg</quote> or <quote>jpg</quote>,
3503 since the <quote>?</quote> means the letter <quote>e</quote> is optional and
3504 can be matched once or not at all. So we are building an expression here to
3505 match image GIF or JPEG type image file. It must include the literal
3506 string <quote>advert</quote>, then one or more digits, and a <quote>.</quote>
3507 (which is now a literal, and not a special character, since it is escaped
3508 with <quote>\</quote>), and lastly either <quote>gif</quote>, or
3509 <quote>jpeg</quote>, or <quote>jpg</quote>. Some possible matches would
3510 include: <quote>//advert1.jpg</quote>,
3511 <quote>/nasty/ads/advert1234.gif</quote>,
3512 <quote>/banners/from/hell/advert99.jpg</quote>. It would not match
3513 <quote>advert1.gif</quote> (no leading slash), or
3514 <quote>/adverts232.jpg</quote> (the expression does not include an
3515 <quote>s</quote>), or <quote>/advert1.jsp</quote> (<quote>jsp</quote> is not
3516 in the expression anywhere).
3520 <emphasis><literal>s/microsoft(?!.com)/MicroSuck/i</literal></emphasis> - This is
3521 a substitution. <quote>MicroSuck</quote> will replace any occurrence of
3522 <quote>microsoft</quote>. The <quote>i</quote> at the end of the expression
3523 means ignore case. The <quote>(?!.com)</quote> means
3524 the match should fail if <quote>microsoft</quote> is followed by
3525 <quote>.com</quote>. In other words, this acts like a <quote>NOT</quote>
3526 modifier. In case this is a hyperlink, we don't want to break it ;-).
3530 We are barely scratching the surface of regular expressions here so that you
3531 can understand the default <application>Junkbuster</application>
3532 configuration files, and maybe use this knowledge to customize your own
3533 installation. There is much, much more that can be done with regular
3534 expressions. Now that you know enough to get started, you can learn more on
3539 More reading on Perl Compatible Regular expressions:
3540 <ulink url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>
3545 <!-- ~ End section ~ -->
3548 <!-- ~~~~~ New section ~~~~~ -->
3550 <title>JunkBuster's Internal Pages</title>
3553 Since <application>JunkBuster</application> proxies each requested
3554 web page, it is easy for <application>JunkBuster</application> to
3555 trap certain URLs. In this way, we can talk directly to
3556 <application>JunkBuster</application>, and see how it is
3557 configured, see how our rules are being applied, change these
3558 rules and other configuration options, and even turn
3559 <application>JunkBuster's</application> filtering off, all with
3565 The URLs listed below are the special ones that allow direct access
3566 to <application>JunkBuster</application>. Of course,
3567 <application>JunkBuster</application> must be running to access these. If
3568 not, you will get a friendly error message.
3577 Junkbuster main page:
3581 <ulink url="http://ijbswa.sourceforge.net/config/">http://ijbswa.sourceforge.net/config/</ulink>
3585 Alternately, this may be reached at <ulink url="http://i.j.b/">http://i.j.b/</ulink>,
3586 but this variation may not work as reliably as the above in some
3593 Show information about the current configuration:
3597 <ulink url="http://ijbswa.sourceforge.net/config/show-status">http://ijbswa.sourceforge.net/config/show-status</ulink>
3604 Show the source code version numbers:
3608 <ulink url="http://ijbswa.sourceforge.net/config/show-version">http://ijbswa.sourceforge.net/config/show-version</ulink>
3615 Show the client's request headers:
3619 <ulink url="http://ijbswa.sourceforge.net/config/show-request">http://ijbswa.sourceforge.net/config/show-request</ulink>
3626 Show which actions apply to a URL and why:
3630 <ulink url="http://ijbswa.sourceforge.net/config/show-url-info">http://ijbswa.sourceforge.net/config/show-url-info</ulink>
3637 Toggle JunkBuster on or off:
3641 <ulink url="http://ijbswa.sourceforge.net/config/toggle">http://ijbswa.sourceforge.net/config/toggle</ulink>
3645 Short cuts. Turn off, then on:
3649 <ulink url="http://ijbswa.sourceforge.net/config/toggle?set=disable">http://ijbswa.sourceforge.net/config/toggle?set=disable</ulink>
3654 <ulink url="http://ijbswa.sourceforge.net/config/toggle?set=enable">http://ijbswa.sourceforge.net/config/toggle?set=enable</ulink>
3661 Edit the actions list file:
3665 <ulink url="http://ijbswa.sourceforge.net/config/edit-actions">http://ijbswa.sourceforge.net/config/edit-actions</ulink>
3674 These may be bookmarked for quick reference.
3684 This program is free software; you can redistribute it
3685 and/or modify it under the terms of the GNU General
3686 Public License as published by the Free Software
3687 Foundation; either version 2 of the License, or (at
3688 your option) any later version.
3690 This program is distributed in the hope that it will
3691 be useful, but WITHOUT ANY WARRANTY; without even the
3692 implied warranty of MERCHANTABILITY or FITNESS FOR A
3693 PARTICULAR PURPOSE. See the GNU General Public
3694 License for more details.
3696 The GNU General Public License should be included with
3697 this file. If not, you can view it at
3698 http://www.gnu.org/copyleft/gpl.html
3699 or write to the Free Software Foundation, Inc., 59
3700 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3702 $Log: user-manual.sgml,v $
3703 Revision 1.47 2002/03/11 13:13:27 swa
3704 correct feedback channels
3706 Revision 1.46 2002/03/10 00:51:08 hal9
3707 Added section on JB internal pages in Appendix.
3709 Revision 1.45 2002/03/09 17:43:53 swa
3712 Revision 1.44 2002/03/09 17:08:48 hal9
3713 New section on Jon's actions file editor, and move some stuff around.
3715 Revision 1.43 2002/03/08 00:47:32 hal9
3716 Added imageblock{pattern}.
3718 Revision 1.42 2002/03/07 18:16:55 swa
3721 Revision 1.41 2002/03/07 16:46:43 hal9
3722 Fix a few markup problems for jade.
3724 Revision 1.40 2002/03/07 16:28:39 swa
3725 provide correct feedback channels
3727 Revision 1.39 2002/03/06 16:19:28 hal9
3728 Note on perceived filtering slowdown per FR.
3730 Revision 1.38 2002/03/05 23:55:14 hal9
3731 Stupid I did it again. Double hyphen in comment breaks jade.
3733 Revision 1.37 2002/03/05 23:53:49 hal9
3734 jade barfs on '- -' embedded in comments. - -user option broke it.
3736 Revision 1.36 2002/03/05 22:53:28 hal9
3737 Add new - - user option.
3739 Revision 1.35 2002/03/05 00:17:27 hal9
3740 Added section on command line options.
3742 Revision 1.34 2002/03/04 19:32:07 oes
3743 Changed default port to 8118
3745 Revision 1.33 2002/03/03 19:46:13 hal9
3746 Emphasis on where/how to report bugs, etc
3748 Revision 1.32 2002/03/03 09:26:06 joergs
3749 AmigaOS changes, config is now loaded from PROGDIR: instead of
3750 AmiTCP:db/junkbuster/ if no configuration file is specified on the
3753 Revision 1.31 2002/03/02 22:45:52 david__schmidt
3756 Revision 1.30 2002/03/02 22:00:14 hal9
3757 Updated 'New Features' list. Ran through spell-checker.
3759 Revision 1.29 2002/03/02 20:34:07 david__schmidt
3760 Update OS/2 build section
3762 Revision 1.28 2002/02/24 14:34:24 jongfoster
3763 Formatting changes. Now changing the doctype to DocBook XML 4.1
3764 will work - no other changes are needed.
3766 Revision 1.27 2002/01/11 14:14:32 hal9
3767 Added a very short section on Templates
3769 Revision 1.26 2002/01/09 20:02:50 hal9
3770 Fix bug re: auto-detect config file changes.
3772 Revision 1.25 2002/01/09 18:20:30 hal9
3773 Touch ups for *.action files.
3775 Revision 1.24 2001/12/02 01:13:42 hal9
3778 Revision 1.23 2001/12/02 00:20:41 hal9
3779 Updates for recent changes.
3781 Revision 1.22 2001/11/05 23:57:51 hal9
3782 Minor update for startup now daemon mode.
3784 Revision 1.21 2001/10/31 21:11:03 hal9
3785 Correct 2 minor errors
3787 Revision 1.18 2001/10/24 18:45:26 hal9
3788 *** empty log message ***
3790 Revision 1.17 2001/10/24 17:10:55 hal9
3791 Catching up with Jon's recent work, and a few other things.
3793 Revision 1.16 2001/10/21 17:19:21 swa
3794 wrong url in documentation
3796 Revision 1.15 2001/10/14 23:46:24 hal9
3797 Various minor changes. Fleshed out SEE ALSO section.
3799 Revision 1.13 2001/10/10 17:28:33 hal9
3802 Revision 1.12 2001/09/28 02:57:04 hal9
3805 Revision 1.11 2001/09/28 02:25:20 hal9
3808 Revision 1.9 2001/09/27 23:50:29 hal9
3809 A few changes. A short section on regular expression in appendix.
3811 Revision 1.8 2001/09/25 00:34:59 hal9
3812 Some additions, and re-arranging.
3814 Revision 1.7 2001/09/24 14:31:36 hal9
3817 Revision 1.6 2001/09/24 14:10:32 hal9
3818 Including David's OS/2 installation instructions.
3820 Revision 1.2 2001/09/13 15:27:40 swa
3823 Revision 1.1 2001/09/12 15:36:41 swa
3824 source files for junkbuster documentation
3826 Revision 1.3 2001/09/10 17:43:59 swa
3827 first proposal of a structure.
3829 Revision 1.2 2001/06/13 14:28:31 swa
3830 docs should have an author.
3832 Revision 1.1 2001/06/13 14:20:37 swa
3833 first import of project's documentation for the webserver.