Added imageblock{pattern}.
[privoxy.git] / doc / source / user-manual.sgml
1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
2 <!--
3  File        :  $Source: /cvsroot/ijbswa/current/doc/source/user-manual.sgml,v $
4
5  Purpose     :  user manual
6                 This file belongs into
7                 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
8                 
9  $Id: user-manual.sgml,v 1.42 2002/03/07 18:16:55 swa Exp $
10
11  Written by and Copyright (C) 2001 the SourceForge
12  IJBSWA team.  http://ijbswa.sourceforge.net
13
14  Based on the Internet Junkbuster originally written
15  by and Copyright (C) 1997 Anonymous Coders and 
16  Junkbusters Corporation.  http://www.junkbusters.com
17 -->
18
19 <!--
20 Sat 03/02/02 04:53:47 PM
21
22 This should be ready for BETA release.
23
24 Hal Burgiss <hal@foobox.net>
25 -->
26
27 <article id="index">
28 <artheader>
29 <title>Junkbuster User Manual</title>
30
31 <pubdate>$Id: user-manual.sgml,v 1.42 2002/03/07 18:16:55 swa Exp $</pubdate>
32
33 <authorgroup>
34  <author>
35   <affiliation>
36    <orgname>By: Junkbuster Developers</orgname>
37    </affiliation>
38  </author>
39 </authorgroup>
40
41 <abstract>
42  <para>
43   The user manual gives users information on how to install, configure
44   and use <application>Internet Junkbuster</application>.
45   <application>Internet Junkbuster</application> is an application that
46   provides privacy and security to users of the World Wide Web.
47  </para>
48  <para>
49 You can find the latest version of the user manual at  <ulink url="http://ijbswa.sourceforge.net/user-manual/">http://ijbswa.sourceforge.net/user-manual/</ulink>.
50  </para>
51
52  <para>
53   Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>.
54  </para>
55 </abstract>
56
57 </artheader>
58
59
60 <!--   ~~~~~       New section      ~~~~~     -->
61
62 <sect1 id="introduction"><title>Introduction</title>
63 <para>
64  <application>Internet Junkbuster</application> is a web proxy with advanced
65  filtering capabilities for protecting privacy, filtering and modifying web
66  page content, managing cookies, controlling access, and removing ads,
67  banners, pop-ups and other obnoxious Internet Junk.
68  <application>Junkbuster</application> has a very flexible configuration and
69  can be customized to suit individual needs and tastes. <application>Internet
70  Junkbuster</application> has application for both stand-alone systems and
71  multi-user networks.
72 </para>
73
74 <para>
75  This documentation is included with the current BETA version of
76  <application>Internet Junkbuster</application> and is mostly complete at this
77  point. The most up to date reference for the time being is still the comments
78  in the source files and in the individual configuration files. Development
79  of version 3.0 is currently nearing completion, and includes many significant
80  changes and enhancements over earlier versions. The target release date for
81  stable v3.0 is <quote>soon</quote> ;-)
82 </para>
83
84 <para>
85  Since this is a BETA version, not all new features are well tested. This
86  documentation may be slightly out of sync as a result (especially with 
87  CVS sources). And there <emphasis>may be</emphasis> bugs, though hopefully
88  not many! 
89 </para>
90
91
92 <!--   ~~~~~       New section      ~~~~~     -->
93 <sect2>
94 <title>New Features</title>
95 <para>
96  In addition to <application>Junkbuster's</application> traditional features
97  of ad and banner blocking and cookie management, this is a list of new
98  features currently under development:
99 </para>
100
101 <para>
102  <itemizedlist>
103
104  <listitem>
105   <para>
106    Integrated browser based configuration and control utility (<ulink
107    url="http://i.j.b">http://i.j.b</ulink>). Browser-based tracing of rule
108    and filter effects.
109   </para>
110  </listitem> 
111
112  <listitem>
113   <para>
114    Modularized configuration that will allow for system wide settings, and
115    individual user settings. (not implemented yet, probably a 3.1 feature)
116   </para>
117  </listitem> 
118
119  <listitem>
120   <para>
121     Blocking of annoying pop-up browser windows.
122   </para>
123  </listitem> 
124
125  <listitem>
126   <para>
127    HTTP/1.1 compliant (most, but not all 1.1 features are supported).
128   </para>
129  </listitem> 
130
131  <listitem>
132   <para>
133    Support for Perl Compatible Regular Expressions in the configuration files, and 
134    generally a more sophisticated and flexible configuration syntax over
135    previous versions. 
136   </para>
137  </listitem> 
138
139  <listitem>
140   <para>
141    GIF de-animation. 
142   </para>
143  </listitem> 
144  
145  <listitem>
146   <para>
147    Web page content filtering (removes banners based on size,
148    invisible <quote>web-bugs</quote>, JavaScript, pop-ups, status bar abuse,
149    etc.)
150   </para>
151  </listitem> 
152  
153  <listitem>
154   <para>
155    Bypass many click-tracking scripts (avoids script redirection).
156  
157   </para>
158  </listitem> 
159  
160  <listitem>
161   <para>
162    Multi-threaded (POSIX and native threads).
163   </para>
164  </listitem> 
165
166  <listitem>
167   <para>
168    Auto-detection and re-reading of config file changes.
169   </para>
170  </listitem> 
171
172  <listitem>
173   <para>
174    User-customizable HTML templates (e.g. 404 error page).
175   </para>
176  </listitem> 
177
178  <listitem>
179   <para>
180    Improved cookie management features (e.g. session based cookies).
181   </para>
182 </listitem> 
183
184  <listitem>
185   <para>
186    Builds from source on most UNIX-like systems. Packages available for: Linux
187    (RedHat, SuSE, or Debian), Windows, Sun Solaris, Mac OSX, OS/2.
188  
189   </para>
190  </listitem> 
191
192  <listitem>
193   <para>
194    In addition, the configuration is much more powerful and versatile over-all.
195   </para>
196 </listitem> 
197
198  </itemizedlist>
199 </para>
200
201 </sect2>
202
203 </sect1>
204
205 <!--  ~  End section  ~  -->
206
207
208 <!--   ~~~~~       New section      ~~~~~     -->
209 <sect1 id="installation"><title>Installation</title>
210 <para>
211  <application>Junkbuster</application> is available as raw source code, or
212  pre-compiled binaries. See the <ulink
213  url="http://sourceforge.net/projects/ijbswa/">Junkbuster Home Page</ulink>
214  for binaries and current release info. <application>Junkbuster</application>
215  is also available via <ulink
216  url="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ijbswa/current/">CVS</ulink>.
217  This is the recommended approach at this time. But please be aware that CVS 
218  is constantly changing, and it may break in mysterious ways.
219 </para>
220
221 <!--   ~~~~~       New section      ~~~~~     -->
222 <sect2 id="installation-source"><title>Source</title>
223 <para>
224  For gzipped tar archives, unpack the source:
225 </para>
226
227 <para>
228  <screen>
229  tar xzvf ijb_source_* [.tgz or .tar.gz]
230  cd ijb_source_2.9.11_beta
231  </screen>
232 </para>
233
234 <para>
235  For retrieving the current CVS sources, you'll need the CVS 
236  package installed first. To download CVS source:
237 </para>
238
239 <para>
240  <screen>
241   cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
242   cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co current
243   cd current
244  </screen>
245 </para>
246
247 <para>
248  This will create a directory named <filename>current/</filename>, which will 
249  contain the source tree.
250 </para>
251
252 <para>
253  Then, in either case, to build from tarball/CVS source:
254 </para>
255
256 <para>
257  <screen>
258  ./configure      (--help to see options)
259  make             (the make from gnu, gmake for *BSD) 
260  su 
261  make -n install  (to see where all the files will go)
262  make install     (to really install)
263  </screen>
264 </para>
265
266 <para>
267  For Redhat and SuSE Linux RPM packages, see below.
268 </para>
269
270 </sect2>
271
272
273 <!--   ~~~~~       New section      ~~~~~     -->
274 <sect2 id="installation-rh"><title>Red Hat</title>
275 <para>
276  To build Redhat RPM packages, install source as above. Then:
277 </para>
278
279 <para>
280  <screen>
281  autoheader   [suggested for CVS source]
282  autoconf     [suggested for CVS source]
283  ./configure
284  make redhat-dist
285  </screen>
286 </para>
287
288 <para>
289  This will create both binary and src RPMs in the usual places. Example:
290 </para>
291
292 <para>
293  &nbsp;&nbsp;&nbsp;/usr/src/redhat/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
294 </para>
295 <para>
296  &nbsp;&nbsp;&nbsp;/usr/src/redhat/SRPMS/junkbuster-2.9.11-1.src.rpm
297 </para>
298
299 <para>
300  To install, of course:
301 </para>
302
303 <para>
304  <screen>
305  rpm -Uvv /usr/src/redhat/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
306  </screen>
307 </para>
308
309 <para>
310  This will place the <application>Junkbuster</application> configuration 
311  files in <filename>/etc/junkbuster/</filename>, and log files in 
312  <filename>/var/log/junkbuster/</filename>.
313 </para>
314
315 </sect2>
316
317 <!--   ~~~~~       New section      ~~~~~     -->
318 <sect2 id="installation-suse"><title>SuSE</title>
319 <para>
320  To build SuSE RPM packages, install source as above. Then:
321 </para>
322
323 <para>
324  <screen>
325  autoheader   [suggested for CVS source]
326  autoconf     [suggested for CVS source]
327  ./configure
328  make suse-dist
329  </screen>
330 </para>
331
332 <para>
333  This will create both binary and src RPMs in the usual places. Example:
334 </para>
335
336 <para>
337  &nbsp;&nbsp;&nbsp;/usr/src/packages/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
338 </para>
339 <para>
340  &nbsp;&nbsp;&nbsp;/usr/src/packages/SRPMS/junkbuster-2.9.11-1.src.rpm
341 </para>
342
343 <para>
344  To install, of course:
345 </para>
346
347 <para>
348  <screen>
349  rpm -Uvv /usr/src/packages/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
350  </screen>
351 </para>
352
353 <para>
354  This will place the <application>Junkbuster</application> configuration 
355  files in <filename>/etc/junkbuster/</filename>, and log files in 
356  <filename>/var/log/junkbuster/</filename>.
357 </para>
358
359 </sect2>
360
361
362 <!--   ~~~~~       New section      ~~~~~     -->
363 <sect2 id="installation-os2"><title>OS/2</title>
364
365 <!--
366 Thanx David Schmidt!
367 -->
368
369 <para>
370  <application>Junkbuster</application> is packaged in a WarpIN self-
371  installing archive.  The self-installing program will be named depending
372  on the release version, something like:
373  <filename>ijbos2_setup_1.2.3.exe</filename>.  In order to install it, simply
374  run this executable or double-click on its icon and follow the WarpIN
375  installation panels.  A shadow of the <application>Junkbuster</application>
376  executable will be placed in your startup folder so it will start 
377  automatically whenever OS/2 starts.
378 </para>
379
380 <para>
381  The directory you choose to install <application>Junkbuster</application>
382  into will contain all of the configuration files.
383 </para>
384
385 <para>
386  If you would like to build binary images on OS/2 yourself, you will need
387  a few Unix-like tools: autoconf, autoheader and sh.  These tools will be
388  used to create the required config.h file, which is not part of the 
389  source distribution because it differs based on platform.  You will also
390  need a compiler.
391  The distribution has been created using IBM VisualAge compilers, but you
392  can use any compiler you like.  GCC/EMX has the disadvantage of needing 
393  to be single-threaded due to a limitation of EMX's implementation of the
394  select() socket call.
395 </para>
396
397 <para>
398  In addition to needing the source code distribution as outlined earlier,
399  you will want to extract the <filename>os2seutp</filename> directory from CVS:
400  <screen>
401  cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login          
402  cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co os2setup
403  </screen>
404  This will create a directory named os2setup/, which will contain the
405  <filename>Makefile.vac</filename> makefile and <filename>os2build.cmd</filename>
406  which is used to completely create the binary distribution.  The sequence
407  of events for building the executable for yourself goes something like this:
408  <screen>
409  cd current
410  autoheader
411  autoconf
412  sh configure
413  cd ..\os2setup
414  nmake -f Makefile.vac
415  </screen>
416  You will see this sequence laid out in <filename>os2build.cmd</filename>.
417 </para>
418
419 </sect2>
420
421
422 <!--   ~~~~~       New section      ~~~~~     -->
423 <sect2 id="installation-win"><title>Windows</title>
424 <para>Click-click. (I need help on this. Not a clue here. Also for 
425 configuration section below. HB.)
426 </para>
427 </sect2>
428
429 <!--   ~~~~~       New section      ~~~~~     -->
430 <sect2 id="installation-other"><title>Other</title>
431 <para>
432  Some quick notes on other Operating Systems.
433 </para>
434
435 <para>
436  For FreeBSD (and other *BSDs?), the build will require <command>gmake</command> 
437  instead of the included <command>make</command>. <command>gmake</command> is
438  available from <ulink url="http://www.gnu.org">http://www.gnu.org</ulink>.
439  The rest should be the same as above for Linux/Unix.
440 </para>
441
442 </sect2>
443
444 </sect1>
445
446 <!--  ~  End section  ~  -->
447
448
449 <!--   ~~~~~       New section      ~~~~~     -->
450 <sect1 id="configuration"><title>Invoking and Configuring JunkBuster</title>
451 <para>
452  For Unix, *BSD and Linux, all configuration files are located in
453  <filename>/etc/junkbuster/</filename> by default. For MS Windows, OS/2, and
454  AmigaOS these are all in the same directory as the 
455  <application>Junkbuster</application> executable. The name and number of
456  configuration files has changed from previous versions, and is subject to
457  change as development progresses.
458 </para>
459
460 <para>
461  The installed defaults provide a reasonable starting point, though possibly
462  aggressive by some standards. For the time being, there are only three
463  default configuration files (this will change in time):
464 </para>
465
466 <para>
467  <itemizedlist>
468
469   <listitem>
470    <para>
471      The main configuration file is named <filename>config</filename>
472      on Linux, Unix, BSD, OS/2, and AmigaOS and <filename>config.txt</filename>
473      on Windows.
474    </para>
475   </listitem> 
476
477   <listitem>
478    <para>
479     The <filename>ijb.action</filename> file is used  to define various 
480     <quote>actions</quote> relating to images, banners, pop-ups, access
481     restrictions, banners and cookies. There is a CGI based editor for this
482     file that can be accessed via <ulink
483     url="http://i.j.b">http://i.j.b</ulink>. This is the easiest method of
484     configuring actions. (Other actions 
485     files are included as well with differing levels of filtering 
486     and blocking, e.g. <filename>ijb-basic.action</filename>.)
487    </para>
488   </listitem> 
489
490   <listitem>
491    <para>
492     The <filename>re_filterfile</filename> file can be used to rewrite the raw
493     page content, including text as well as embedded HTML and JavaScript.
494    </para>
495   </listitem> 
496
497  </itemizedlist>
498 </para>
499
500 <para>
501  <filename>ijb.action</filename> and <filename>re_filterfile</filename> 
502  can use Perl style regular expressions for maximum flexibility. All files use
503  the <quote><literal>#</literal></quote> character to denote a comment. Such
504  lines are not processed by <application>Junkbuster</application>. After
505  making any changes, there is no need to restart
506  <application>Junkbuster</application> in order for the changes to take
507  effect. <application>Junkbuster</application> should detect such changes 
508  automatically.
509 </para>
510
511 <para>
512  While under development, the configuration content is subject to change. 
513  The below documentation may not be accurate by the time you read this. 
514  Also, what constitutes a <quote>default</quote> setting, may change, so 
515  please check all your configuration files on important issues.
516 </para>
517
518
519
520 <!--   ~~~~~       New section      ~~~~~     -->
521
522 <sect2>
523 <title>Command Line Options</title>
524 <para>
525  <application>JunkBuster</application> may be invoked with the following
526  command-line options:
527 </para>
528
529 <para>
530  <itemizedlist>
531
532  <listitem>
533   <para>
534     <emphasis>--version</emphasis>
535   </para>
536   <para>
537      Print version info and exit, Unix only.
538   </para>
539  </listitem> 
540  <listitem>
541   <para>
542     <emphasis>--help</emphasis>
543   </para>
544   <para>
545    Print a short usage info and exit, Unix only.
546   </para>
547  </listitem> 
548  <listitem>
549   <para>
550    <emphasis>--no-daemon</emphasis>
551   </para>
552   <para>
553    Don't become a daemon, i.e. don't fork and become process group
554    leader, don't detach from controlling tty. Unix only.
555   </para>
556  </listitem> 
557  <listitem>
558   <para>
559    <emphasis>--pidfile FILE</emphasis>
560   
561   </para>
562   <para>
563    On startup, write the process ID to <emphasis>FILE</emphasis>. Delete the
564    <emphasis>FILE</emphasis> on exit. Failiure to create or delete the
565    <emphasis>FILE</emphasis> is non-fatal. If no <emphasis>FILE</emphasis>
566    option is given, no PID file will be used. Unix only.
567   </para>
568  </listitem> 
569  <listitem>
570   <para>
571    <emphasis>--user USER</emphasis>
572   
573   </para>
574   <para>
575    After (optionally) writing the PID file, assume the user  ID  of
576    <emphasis>USER</emphasis>.  Exit if the privileges are not sufficient to do
577    so. Unix only.
578   </para>
579  </listitem> 
580  <listitem>
581   <para>
582     <emphasis>configfile</emphasis>
583   </para>
584   <para>
585     If no <emphasis>configfile</emphasis> is included on the command line, 
586     <application>JunkBuster</application> will look for a file named 
587     <quote>config</quote> in the current directory (except on Win32 
588     where it will look for <quote>config.txt</quote> instead). Specify 
589     full path to avoid confusion.
590   </para>
591  </listitem> 
592
593  </itemizedlist>
594 </para>
595
596 </sect2>
597
598 <!--  ~  End section  ~  -->
599
600
601 <!--   ~~~~~       New section      ~~~~~     -->
602
603 <sect2>
604 <title>The Main Configuration File</title>
605 <para>
606  Again, the main configuration file is named <filename>config</filename> on
607  Linux/Unix/BSD and OS/2, and <filename>config.txt</filename> on Windows.
608  Configuration lines consist of an initial keyword followed by a list of
609  values, all separated by whitespace (any number of spaces or tabs). For
610  example:
611 </para>
612
613 <para>
614  <literal>
615   <msgtext> 
616    <literallayout>
617   <emphasis>blockfile blocklist.ini</emphasis>
618    </literallayout>
619   </msgtext> 
620  </literal>
621 </para>
622
623 <para>
624  Indicates that the blockfile is named <quote>blocklist.ini</quote>.
625 </para>
626
627 <para>
628  A <quote><literal>#</literal></quote> indicates a comment.  Any part of a
629  line following a <quote><literal>#</literal></quote> is ignored, except if
630  the <quote><literal>#</literal></quote> is preceded by a
631  <quote><literal>\</literal></quote>.
632 </para>
633
634 <para>
635  Thus, by placing a <quote><literal>#</literal></quote> at the start of an
636  existing configuration line, you can make it a comment and it will be treated
637  as if it weren't there. This is called <quote>commenting out</quote> an
638  option and can be useful to turn off features: If you comment out the
639  <quote>logfile</quote> line, <application>junkbuster</application> will not
640  log to a file at all. Watch for the <quote>default:</quote> section in each
641  explanation to see what happens if the option is left unset (or commented
642  out). 
643 </para>
644
645 <para>
646  Long lines can be continued on the next line by using a
647  <quote><literal>\</literal></quote> as the very last character.
648 </para>
649
650 <para>
651  There are various aspects of <application>Junkbuster</application> behavior 
652  that can be tuned.
653 </para>
654
655
656 <!--   ~~~~~       New section      ~~~~~     -->
657
658 <sect3>
659 <title>Defining Other Configuration Files</title>
660
661 <para>
662  <application>Junkbuster</application> can use a number of other files to tell it
663  what ads to block, what cookies to accept, etc.  This section of the
664  configuration file tells <application>Junkbuster</application> where to find
665  all those other files. 
666 </para>
667
668 <para>
669  On <application>Windows</application> and <application>AmigaOS</application>,
670  <application>Junkbuster</application> looks for these files in the same
671  directory as the executable.  On Unix and  OS/2,
672  <application>Junkbuster</application> looks for these files in the current
673  working directory. In either case, an absolute path name can be used to
674  avoid problems.
675 </para>
676
677 <para>
678  When development goes modular and multi-user, the blocker, filter, and
679  per-user config will be stored in subdirectories of <quote>confdir</quote>.
680  For now, only <filename>confdir/templates</filename> is used for storing HTML
681  templates for CGI results. 
682 </para>
683
684 <para>
685  The location of the configuration files:
686 </para>
687
688 <para>
689  <literal>
690   <msgtext> 
691    <literallayout>
692   <emphasis>confdir  /etc/junkbuster</emphasis>       # No trailing /, please.
693    </literallayout>
694   </msgtext> 
695  </literal>
696 </para>
697
698 <para>
699  The directory where all logging (i.e. <filename>logfile</filename> and 
700  <filename>jarfile</filename>) takes place. No trailing
701  <quote><literal>/</literal></quote>, please: 
702 </para>
703
704 <para>
705  <literal>
706   <msgtext> 
707    <literallayout>
708   <emphasis>logdir  /var/log/junkbuster</emphasis>
709    </literallayout>
710   </msgtext> 
711  </literal>
712 </para>
713
714 <para>
715  Note that all file specifications below are relative to 
716  the above two directories!
717 </para>
718
719 <para>
720  The <quote>ijb.action</quote> file contains patterns to specify the actions to
721  apply to requests for each site. Default: Cookies to and from all
722  destinations are kept only during the current browser session (i.e. they 
723  are not saved to disk). Pop-ups are disabled for all sites. All sites are
724  filtered if <quote>re_filterfile</quote> specified according to the 
725  contents of <quote>re_filterfile</quote>. No sites are blocked. The 
726  JunkBuster logo is displayed for filtered ads and other images . The syntax
727  of this file is explained in detail <link
728  linkend="actionsfile">below</link>. 
729 </para>
730
731 <para>
732  <literal>
733   <msgtext> 
734    <literallayout>
735   <emphasis>actionsfile  ijb.action</emphasis>
736    </literallayout>
737   </msgtext> 
738  </literal>
739 </para>
740
741 <para>
742  The <quote>re_filterfile</quote> file contains content modification rules.
743  These rules permit powerful changes on the content of Web pages, e.g., you
744  could disable your favorite JavaScript annoyances, rewrite the actual
745  content, or just have some fun replacing <quote>Microsoft</quote> with
746  <quote>MicroSuck</quote> wherever it appears on a Web page. Default: No
747  content modification, or whatever the developers are playing with :-/
748 </para>
749
750 <para>
751  Filtering requires buffering the page content, which may appear to slow down
752  page rendering since nothing is displayed until all content has passed 
753  the filters. (It does not really take longer, but seems that way since 
754  the page is not incrementally displayed.) This effect will be more noticeable
755  on slower connections.
756
757 </para>
758
759 <para>
760  <literal>
761   <msgtext> 
762    <literallayout>
763   <emphasis>re_filterfile  re_filterfile</emphasis>
764    </literallayout>
765   </msgtext> 
766  </literal>
767 </para>
768
769 <para>
770  The logfile is where all logging and error messages are written. The logfile
771  can be useful for tracking down a problem with
772  <application>Junkbuster</application> (e.g., it's not blocking an ad you
773  think it should block) but in most cases you probably will never look at it.
774 </para>
775
776 <para>
777  Your logfile will grow indefinitely, and you will probably want to
778  periodically remove it.  On Unix systems, you can do this with a cron job
779  (see <quote>man cron</quote>). For Redhat, a <command>logrotate</command> 
780  script has been included.
781 </para>
782
783 <para>
784  On SuSE Linux systems, you can place a line like <quote>/var/log/junkbuster.*
785  +1024k 644 nobody.nogroup</quote> in <filename>/etc/logfiles</filename>, with
786  the effect that cron.daily will automatically archive, gzip, and empty the
787  log, when it exceeds 1M size.
788 </para>
789
790 <para>
791  Default: Log to the a file named <filename>logfile</filename>. 
792  Comment out to disable logging.
793 </para>
794
795 <para>
796  <literal>
797   <msgtext> 
798    <literallayout>
799   <emphasis>logfile  logfile</emphasis>
800    </literallayout>
801   </msgtext> 
802  </literal>
803 </para>
804
805 <para>
806  The <quote>jarfile</quote> defines where
807  <application>Junkbuster</application> stores the cookies it intercepts.  Note
808  that if you use a <quote>jarfile</quote>, it may grow quite large. Default:
809  Don't store intercepted cookies.
810 </para>
811
812 <para>
813  <literal>
814   <msgtext> 
815    <literallayout>
816   <emphasis>#jarfile  jarfile</emphasis>
817    </literallayout>
818   </msgtext> 
819  </literal>
820 </para>
821
822 <para>
823  If you specify a <quote>trustfile</quote>,
824  <application>Junkbuster</application> will only allow access to sites that
825  are named in the trustfile. You can also mark sites as trusted referrers,
826  with the effect that access to untrusted sites will be granted, if a link
827  from a trusted referrer was used. The link target will then be added to the
828  <quote>trustfile</quote>. This is a very restrictive feature that typical
829  users most probably want to leave disabled. Default: Disabled, don't use the
830  trust mechanism.
831 </para>
832
833 <para>
834  <literal>
835   <msgtext> 
836    <literallayout>
837   <emphasis>#trustfile  trust</emphasis>
838    </literallayout>
839   </msgtext> 
840  </literal>
841 </para>
842  
843 <para>
844  If you use the trust mechanism, it is a good idea to write up some on-line
845  documentation about your blocking policy and to specify the URL(s) here. They
846  will appear on the page that your users receive when they try to access
847  untrusted content. Use multiple times for multiple URLs. Default: Don't
848  display links on the <quote>untrusted</quote> info page.
849 </para>
850
851 <para>
852  <literal>
853   <msgtext> 
854    <literallayout>
855   <emphasis>trust-info-url http://www.your-site.com/why_we_block.html</emphasis>
856   <emphasis>trust-info-url http://www.your-site.com/what_we_allow.html</emphasis>
857    </literallayout>
858   </msgtext> 
859  </literal>
860 </para>
861
862 </sect3>
863
864 <!--  ~  End section  ~  -->
865
866
867
868 <!--   ~~~~~       New section      ~~~~~     -->
869
870 <sect3>
871 <title>Other Configuration Options</title>
872
873 <para>
874  This part of the configuration file contains options that control how
875  <application>Junkbuster</application> operates.
876 </para>
877
878 <para>
879  <quote>Admin-address</quote> should be set to the email address of the proxy
880  administrator. It is used in many of the proxy-generated pages. Default:
881  fill@me.in.please.
882 </para>
883
884 <para>
885  <literal>
886   <msgtext> 
887    <literallayout>
888   <emphasis>#admin-address  fill@me.in.please</emphasis>
889    </literallayout>
890   </msgtext> 
891  </literal>
892 </para>
893
894 <para>
895  <quote>Proxy-info-url</quote> can be set to a URL that contains more info
896  about this <application>Junkbuster</application> installation, it's
897  configuration and policies. It is used in many of the proxy-generated pages
898  and its use is highly recommended in multi-user installations, since your
899  users will want to know why certain content is blocked or modified. Default:
900  Don't show a link to on-line documentation.
901 </para>
902
903 <para>
904  <literal>
905   <msgtext> 
906    <literallayout>
907   <emphasis>proxy-info-url  http://www.your-site.com/proxy.html</emphasis>
908    </literallayout>
909   </msgtext> 
910  </literal>
911 </para>
912
913 <para>
914  <quote>Listen-address</quote> specifies the address and port where
915  <application>Junkbuster</application> will listen for connections from your
916  Web browser.  The default is to listen on the localhost port 8118, and
917  this is suitable for most users.  (In your web browser, under proxy
918  configuration, list the proxy server as <quote>localhost</quote> and the
919  port as <quote>8118</quote>).
920 </para>
921
922 <para>
923  If you already have another service running on port 8118, or if you want to
924  serve requests from other machines (e.g. on your local network) as well, you
925  will need to override the default. The syntax is 
926  <quote>listen-address [&lt;ip-address&gt;]:&lt;port&gt;</quote>. If you leave
927  out the IP address, <application>junkbuster</application> will bind to all
928  interfaces (addresses) on your machine and may become reachable from the
929  Internet. In that case, consider using access control lists (acl's) (see
930  <quote>aclfile</quote> above), or a firewall.
931 </para>
932
933 <para>
934  For example, suppose you are running <application>Junkbuster</application> on
935  a machine which has the address 192.168.0.1 on your local private network
936  (192.168.0.0) and has another outside connection with a different address.
937  You want it to serve requests from inside only:
938 </para>
939
940 <para>
941  <literal>
942   <msgtext> 
943    <literallayout>
944   <emphasis>listen-address  192.168.0.1:8118</emphasis>
945    </literallayout>
946   </msgtext> 
947  </literal>
948 </para>
949
950 <para>
951  If you want it to listen on all addresses (including the outside
952  connection):
953 </para>
954
955 <para>
956  <literal>
957   <msgtext> 
958    <literallayout>
959   <emphasis>listen-address  :8118</emphasis>
960    </literallayout>
961   </msgtext> 
962  </literal>
963 </para>
964
965 <para>
966  If you do this, consider using ACLs (see <quote>aclfile</quote> above). Note:
967  you will need to point your browser(s) to the address and port that you have
968  configured here. Default: localhost:8118 (127.0.0.1:8118).
969 </para>
970
971 <para>
972  The debug option sets the level of debugging information to log in the
973  logfile (and to the console in the Windows version).  A debug level of 1 is
974  informative because it will show you each request as it happens.  Higher
975  levels of debug are probably only of interest to developers.
976 </para>
977
978 <para>
979  <literal>
980   <msgtext> 
981    <literallayout>
982   debug         1 # GPC   = show each GET/POST/CONNECT request
983   debug         2 # CONN  = show each connection status
984   debug         4 # IO    = show I/O status
985   debug         8 # HDR   = show header parsing
986   debug        16 # LOG   = log all data into the logfile
987   debug        32 # FRC   = debug force feature
988   debug        64 # REF   = debug regular expression filter 
989   debug       128 #       = debug fast redirects
990   debug       256 #       = debug GIF de-animation
991   debug       512 # CLF   = Common Log Format
992   debug      1024 #       = debug kill pop-ups
993   debug      4096 # INFO  = Startup banner and warnings.
994   debug      8192 # ERROR = Non-fatal errors
995     </literallayout>
996   </msgtext>
997  </literal>
998 </para>
999
1000 <para>
1001  It is <emphasis>highly recommended</emphasis> that you enable ERROR
1002  reporting (debug 8192), at least until the next stable release.
1003 </para>
1004
1005 <para>
1006  The reporting of FATAL errors (i.e. ones which crash 
1007  <application>JunkBuster</application>) is always on and cannot be disabled.
1008 </para>
1009
1010 <para>
1011  If you want to use CLF (Common Log Format), you should set <quote>debug
1012  512</quote> ONLY, do not enable anything else.
1013 </para>
1014
1015 <para>
1016  Multiple <quote>debug</quote> directives, are OK - they're logical-OR'd
1017  together. 
1018 </para>
1019
1020 <para>
1021  <literal>
1022   <msgtext> 
1023    <literallayout>
1024   <emphasis>debug    15     # same as setting the first 4 listed above</emphasis>
1025    </literallayout>
1026   </msgtext> 
1027  </literal>
1028 </para>
1029
1030 <para>
1031  Default:
1032 </para>
1033
1034 <para>
1035  <literal>
1036   <msgtext> 
1037    <literallayout>
1038   <emphasis>debug   1     # URLs</emphasis>
1039   <emphasis>debug   4096  # Info</emphasis>
1040   <emphasis>debug   8192  # Errors - *we highly recommended enabling this*</emphasis>
1041    </literallayout>
1042   </msgtext> 
1043  </literal>
1044 </para>
1045
1046 <para>
1047  <application>Junkbuster</application> normally uses
1048  <quote>multi-threading</quote>, a software technique that permits it to
1049  handle many different requests simultaneously. In some cases you may wish to
1050  disable this -- particularly if you're trying to debug a problem.  The
1051  <quote>single-threaded</quote> option forces
1052  <application>Junkbuster</application> to handle requests sequentially.
1053  Default: Multi-threaded mode.
1054 </para>
1055
1056 <para>
1057  <literal>
1058   <msgtext> 
1059    <literallayout>
1060   <emphasis>#single-threaded</emphasis>
1061    </literallayout>
1062   </msgtext> 
1063  </literal>
1064 </para>
1065
1066 <para>
1067  <quote>toggle</quote> allows you to temporarily disable all
1068  <application>Junkbuster's</application>  filtering. Just set <quote>toggle
1069  0</quote>.
1070 </para>
1071
1072 <para>
1073  The Windows version of <application>Junkbuster</application> puts an icon in
1074  the system tray, which also allows you to change this option.  If you
1075  right-click on that icon (or select the <quote>Options</quote> menu), one
1076  choice is <quote>Enable</quote>. Clicking on enable toggles
1077  <application>Junkbuster</application> on and off. This is useful if you want
1078  to temporarily disable <application>Junkbuster</application>, e.g., to access
1079  a site that requires cookies which you would otherwise have blocked. This can also
1080  be toggled via a web browser at the <application>Junkbuster</application>
1081  internal address of <ulink url="http://i.j.b">http://i.j.b</ulink> on 
1082  any platform.
1083 </para>
1084
1085 <para>
1086  <quote>toggle 1</quote> means <application>Junkbuster</application> runs
1087  normally, <quote>toggle 0</quote> means that
1088  <application>Junkbuster</application> becomes a non-anonymizing non-blocking
1089  proxy. Default: 1 (on). 
1090 </para>
1091
1092 <para>
1093  <literal>
1094   <msgtext> 
1095    <literallayout>
1096   <emphasis>toggle    1</emphasis>
1097    </literallayout>
1098   </msgtext> 
1099  </literal>
1100 </para>
1101
1102 <para>
1103  For content filtering, i.e. the <quote>+filter</quote> and
1104  <quote>+deanimate-gif</quote> actions, it is necessary that 
1105  <application>Junkbuster</application> buffers the entire document body.
1106  This can be potentially dangerous, since a server could just keep sending
1107  data indefinitely and wait for your RAM to exhaust. With nasty consequences.
1108 </para>
1109
1110 <para>
1111  The <application>buffer-limit</application> option lets you set the maximum
1112  size in Kbytes that each buffer may use. When the documents buffer exceeds
1113  this size, it is flushed to the client unfiltered and no further attempt to
1114  filter the rest of it is made. Remember that there may multiple threads
1115  running, which might require increasing the <quote>buffer-limit</quote>
1116  Kbytes <emphasis>each</emphasis>, unless you have enabled 
1117  <quote>single-threaded</quote> above.
1118 </para>
1119
1120 <para>
1121  <literal>
1122   <msgtext> 
1123    <literallayout>
1124   <emphasis>buffer-limit    4069</emphasis>
1125    </literallayout>
1126   </msgtext> 
1127  </literal>
1128 </para>
1129
1130 <para>
1131  To enable the web-based <filename>ijb.action</filename> file editor set
1132  <application>enable-edit-actions</application> to 1, or 0 to disable.  Note
1133  that you must have compiled <application>JunkBuster</application> with
1134  support for this feature, otherwise this option has no effect. This 
1135  internal page can be reached at <ulink
1136  url="http://i.j.b">http://i.j.b</ulink>.
1137  </para>
1138
1139 <para>
1140  Security note: If this is enabled, anyone who can use the proxy
1141  can edit the actions file, and their changes will affect all users.
1142  For shared proxies, you probably want to disable this. Default: enabled.
1143 </para>
1144
1145 <para>
1146  <literal>
1147   <msgtext> 
1148    <literallayout>
1149   <emphasis>enable-edit-actions    1</emphasis>
1150    </literallayout>
1151   </msgtext> 
1152  </literal>
1153 </para>
1154
1155 <para>
1156  Allow <application>JunkBuster</application> to be toggled on and off
1157  remotely, using your web browser.  Set <quote>enable-remote-toggle</quote>to
1158  1 to enable, and 0 to disable.  Note that you must have compiled 
1159  <application>JunkBuster</application> with support for this feature,
1160  otherwise this option has no effect.
1161 </para>
1162
1163 <para>
1164  Security note:  If this is enabled, anyone who can use the proxy can toggle
1165  it on or off (see <ulink url="http://i.j.b">http://i.j.b</ulink>), and
1166  their changes will affect all users. For shared proxies, you probably want to
1167  disable this. Default: enabled.
1168 </para>
1169
1170 <para>
1171  <literal>
1172   <msgtext> 
1173    <literallayout>
1174   <emphasis>enable-remote-toggle    1</emphasis>
1175    </literallayout>
1176   </msgtext> 
1177  </literal>
1178 </para>
1179
1180 </sect3>
1181
1182 <!--  ~  End section  ~  -->
1183
1184
1185 <!--   ~~~~~       New section      ~~~~~     -->
1186
1187 <sect3>
1188 <title>Access Control List (ACL)</title>
1189 <para>
1190  Access controls are included at the request of some ISPs and systems
1191  administrators, and are not usually needed by individual users. Please note
1192  the warnings in the FAQ that this proxy is not intended to be a substitute
1193  for a firewall or to encourage anyone to defer addressing basic security
1194  weaknesses.
1195 </para>
1196
1197 <para>
1198  If no access settings are specified, the proxy talks to anyone that
1199  connects. If any access settings file are specified, then the proxy
1200  talks only to IP addresses permitted somewhere in this file and not
1201  denied later in this file.
1202 </para>
1203
1204 <para>
1205  Summary -- if using an ACL:
1206 </para>
1207
1208  <simplelist>
1209   <member>
1210    Client must have permission to receive service.
1211   </member>
1212  </simplelist>
1213  <simplelist>
1214   <member>
1215    LAST match in ACL wins.
1216   </member>
1217  </simplelist>
1218  <simplelist>
1219   <member>
1220    Default behavior is to deny service.
1221   </member>
1222  </simplelist>
1223
1224 <para>
1225  The syntax for an entry in the Access Control List is:
1226 </para>
1227
1228 <para>
1229  <literal>
1230   <msgtext> 
1231    <literallayout>
1232   ACTION    SRC_ADDR[/SRC_MASKLEN]    [ DST_ADDR[/DST_MASKLEN] ]
1233    </literallayout>
1234   </msgtext> 
1235  </literal>
1236 </para>
1237
1238 <para>
1239  Where the individual fields are:
1240 </para>
1241
1242 <para>
1243  <literal>
1244   <msgtext> 
1245    <literallayout>
1246  <emphasis>ACTION</emphasis>      = <quote>permit-access</quote> or <quote>deny-access</quote>
1247
1248  <emphasis>SRC_ADDR</emphasis>    = client hostname or dotted IP address
1249  <emphasis>SRC_MASKLEN</emphasis> = number of bits in the subnet mask for the source
1250
1251  <emphasis>DST_ADDR</emphasis>    = server or forwarder hostname or dotted IP address
1252  <emphasis>DST_MASKLEN</emphasis> = number of bits in the subnet mask for the target
1253    </literallayout>
1254   </msgtext> 
1255  </literal>
1256 </para>
1257
1258
1259 <para> 
1260  The field separator (FS) is whitespace (space or tab).
1261 </para>
1262
1263 <para>
1264  IMPORTANT NOTE: If the <application>junkbuster</application> is using a
1265  forwarder (see below) or a gateway for a particular destination URL, the
1266  <literal>DST_ADDR</literal> that is examined is the address of the forwarder
1267  or the gateway and <emphasis>NOT</emphasis> the address of the ultimate
1268  target. This is necessary because it may be impossible for the local
1269  <application>Junkbuster</application> to determine the address of the
1270  ultimate target (that's often what gateways are used for).
1271 </para>
1272
1273 <para>
1274  Here are a few examples to show how the ACL features work:
1275 </para>
1276
1277 <para>
1278  <quote>localhost</quote> is OK -- no DST_ADDR implies that
1279  <emphasis>ALL</emphasis> destination addresses are OK:
1280 </para>
1281
1282 <para>
1283  <literal>
1284   <msgtext> 
1285    <literallayout>
1286   <emphasis>permit-access  localhost</emphasis>
1287    </literallayout>
1288   </msgtext> 
1289  </literal>
1290 </para>
1291
1292 <para>
1293  A silly example to illustrate permitting any host on the class-C subnet with
1294  <application>Junkbuster</application> to go anywhere:
1295 </para>
1296
1297 <para>
1298  <literal>
1299   <msgtext> 
1300    <literallayout>
1301   <emphasis>permit-access    www.junkbusters.com/24</emphasis>
1302    </literallayout>
1303   </msgtext> 
1304  </literal>
1305 </para>
1306
1307 <para>
1308  Except deny one particular IP address from using it at all:
1309 </para>
1310
1311 <para>
1312  <literal>
1313   <msgtext> 
1314    <literallayout>
1315   <emphasis>deny-access      ident.junkbusters.com</emphasis>
1316    </literallayout>
1317   </msgtext> 
1318  </literal>
1319 </para>
1320
1321 <para>
1322  You can also specify an explicit network address and subnet mask.
1323  Explicit addresses do not have to be resolved to be used.
1324 </para>
1325
1326 <para>
1327  <literal>
1328   <msgtext> 
1329    <literallayout>
1330   <emphasis>permit-access    207.153.200.0/24</emphasis>
1331    </literallayout>
1332   </msgtext> 
1333  </literal>
1334 </para>
1335
1336 <para>
1337  A subnet mask of 0 matches anything, so the next line permits everyone.
1338 </para>
1339
1340 <para>
1341  <literal>
1342   <msgtext> 
1343    <literallayout>
1344   <emphasis>permit-access    0.0.0.0/0</emphasis>
1345    </literallayout>
1346   </msgtext> 
1347  </literal>
1348 </para>
1349
1350 <para>
1351  Note, you <emphasis>cannot</emphasis> say:
1352 </para>
1353
1354 <para>
1355  <literal>
1356   <msgtext> 
1357    <literallayout>
1358   <emphasis>permit-access    .org</emphasis>
1359    </literallayout>
1360   </msgtext> 
1361  </literal>
1362 </para>
1363
1364 <para>
1365  to allow all *.org domains. Every IP address listed must resolve fully.
1366 </para>
1367
1368 <para>
1369  An ISP may want to provide a <application>Junkbuster</application> that is
1370  accessible by <quote>the world</quote> and yet restrict use of some of their
1371  private content to hosts on its internal network (i.e. its own subscribers).
1372  Say, for instance the ISP owns the Class-B IP address block 123.124.0.0 (a 16
1373  bit netmask). This is how they could do it:
1374 </para>
1375
1376 <para>
1377  <literal>
1378   <msgtext> 
1379    <literallayout>
1380  <emphasis>permit-access 0.0.0.0/0   0.0.0.0/0</emphasis>   # other clients can go anywhere 
1381                                        # with the following exceptions:
1382  
1383  <emphasis>deny-access</emphasis>   0.0.0.0/0   123.124.0.0/16 # block all external requests for
1384                                           # sites on the ISP's network
1385
1386  <emphasis>permit 0.0.0.0/0   www.my_isp.com</emphasis>        # except for the ISP's main 
1387                                           # web site
1388
1389  <emphasis>permit 123.124.0.0/16 0.0.0.0/0</emphasis>          # the ISP's clients can go 
1390                                           # anywhere
1391    </literallayout>
1392   </msgtext> 
1393  </literal>
1394 </para>
1395
1396 <para>
1397  Note that if some hostnames are listed with multiple IP addresses, 
1398  the primary value returned by DNS (via gethostbyname()) is used. Default:
1399  Anyone can access the proxy.
1400 </para>
1401
1402 </sect3>
1403
1404 <!--  ~  End section  ~  -->
1405
1406
1407 <!--   ~~~~~       New section      ~~~~~     -->
1408
1409 <sect3>
1410 <title>Forwarding</title>
1411
1412 <para>
1413  This feature allows chaining of HTTP requests via multiple proxies.
1414  It can be used to better protect privacy and confidentiality when
1415  accessing specific domains by routing requests to those domains
1416  to a special purpose filtering proxy such as lpwa.com. Or to use 
1417  a caching proxy to speed up browsing.
1418 </para>
1419
1420 <para>
1421  It can also be used in an environment with multiple networks to route
1422  requests via multiple gateways allowing transparent access to multiple
1423  networks without having to modify browser configurations.
1424 </para>
1425
1426 <para>
1427  Also specified here are SOCKS proxies. <application>Junkbuster</application>
1428  SOCKS 4 and SOCKS 4A. The difference is that SOCKS 4A will resolve the target
1429  hostname using DNS on the SOCKS server, not our local DNS client.
1430 </para>
1431
1432 <para>
1433  The syntax of each line is:
1434 </para>
1435
1436 <para>
1437  <literal>
1438   <msgtext> 
1439    <literallayout>
1440  <emphasis>forward target_domain[:port] http_proxy_host[:port]</emphasis>
1441  <emphasis>forward-socks4  target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]</emphasis>
1442  <emphasis>forward-socks4a target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]</emphasis>
1443    </literallayout>
1444   </msgtext> 
1445  </literal>
1446 </para>
1447
1448 <para>
1449  If http_proxy_host is <quote>.</quote>, then requests are not forwarded to a
1450  HTTP proxy but are made directly to the web servers.
1451 </para>
1452
1453 <para>
1454  Lines are checked in sequence, and the last match wins.
1455 </para>
1456
1457 <para>
1458  There is an implicit line equivalent to the following, which specifies that
1459  anything not finding a match on the list is to go out without forwarding
1460  or gateway protocol, like so:
1461 </para>
1462
1463 <para>
1464  <literal>
1465   <msgtext> 
1466    <literallayout>
1467   <emphasis>forward   .*   .       </emphasis># implicit
1468    </literallayout>
1469   </msgtext> 
1470  </literal>
1471 </para>
1472
1473 <para>
1474  In the following common configuration, everything goes to Lucent's LPWA,
1475  except SSL on port 443 (which it doesn't handle):
1476 </para>
1477
1478 <para>
1479  <literal>
1480   <msgtext> 
1481    <literallayout>
1482  <emphasis>forward   .*     lpwa.com:8000</emphasis>
1483  <emphasis>forward   :443   .</emphasis>
1484    </literallayout>
1485   </msgtext> 
1486  </literal>
1487 </para>
1488
1489 <para>
1490  See the FAQ for instructions on how to automate the login procedure for LPWA.
1491  Some users have reported difficulties related to LPWA's use of
1492  <quote>.</quote> as the last element of the domain, and have said that this
1493  can be fixed with this:
1494 </para>
1495    
1496 <para>
1497  <literal>
1498   <msgtext> 
1499    <literallayout>
1500   <emphasis>forward   lpwa.  lpwa.com:8000</emphasis>
1501    </literallayout>
1502   </msgtext> 
1503  </literal>
1504 </para>
1505  
1506 <para>
1507  (NOTE: the syntax for specifying target_domain has changed since the
1508  previous paragraph was written -- it will not work now.  More information
1509  is welcome.)
1510 </para>
1511
1512 <para>
1513  In this fictitious example, everything goes via an ISP's caching proxy,
1514  except requests to that ISP:
1515 </para>
1516
1517 <para>
1518  <literal>
1519   <msgtext> 
1520    <literallayout>
1521  <emphasis>forward    .*         caching.myisp.net:8000</emphasis>
1522  <emphasis>forward    myisp.net  .</emphasis>
1523    </literallayout>
1524   </msgtext> 
1525  </literal>
1526 </para>
1527
1528 <para>
1529  For the @home network, we're told the forwarding configuration is this:
1530 </para>
1531
1532
1533 <para>
1534  <literal>
1535   <msgtext> 
1536    <literallayout>
1537   <emphasis>forward    .*    proxy:8080</emphasis>
1538    </literallayout>
1539   </msgtext> 
1540  </literal>
1541 </para>
1542
1543 <para>
1544  Also, we're told they insist on getting cookies and JavaScript, so you should 
1545  add home.com to the cookie file. We consider JavaScript a security risk.
1546  Java need not be enabled.
1547 </para>
1548
1549 <para>
1550  In this example direct connections are made to all <quote>internal</quote>
1551  domains, but everything else goes through Lucent's LPWA by way of the
1552  company's SOCKS gateway to the Internet.
1553 </para>
1554
1555 <para>
1556  <literal>
1557   <msgtext> 
1558    <literallayout>
1559  <emphasis>forward-socks4  .*  lpwa.com:8000  firewall.my_company.com:1080</emphasis>
1560  <emphasis>forward    my_company.com  .</emphasis>
1561    </literallayout>
1562   </msgtext> 
1563  </literal>
1564 </para>
1565
1566 <para>
1567  This is how you could set up a site that always uses SOCKS but no forwarders:
1568 </para>
1569
1570 <para>
1571  <literal>
1572   <msgtext> 
1573    <literallayout>
1574   <emphasis>forward-socks4a   .*  .  firewall.my_company.com:1080</emphasis>
1575    </literallayout>
1576   </msgtext> 
1577  </literal>
1578 </para>
1579
1580 <para>
1581  An advanced example for network administrators:
1582 </para>
1583
1584 <para>
1585  If you have links to multiple ISPs that provide various special content to
1586  their subscribers, you can configure forwarding to pass requests to the
1587  specific host that's connected to that ISP so that everybody can see all
1588  of the content on all of the ISPs.
1589 </para>
1590
1591 <para>
1592  This is a bit tricky, but here's an example:
1593 </para>
1594
1595
1596 <para>
1597  host-a has a PPP connection to isp-a.com. And host-b has a PPP connection to
1598  isp-b.com. host-a can run a <application>Junkbuster</application> proxy with
1599  forwarding like this: 
1600 </para>
1601
1602 <para>
1603  <literal>
1604   <msgtext> 
1605    <literallayout>
1606  <emphasis>forward    .*         .</emphasis>
1607  <emphasis>forward    isp-b.com  host-b:8118</emphasis>
1608    </literallayout>
1609   </msgtext> 
1610  </literal>
1611 </para>
1612
1613 <para>
1614  host-b can run a <application>Junkbuster</application> proxy with forwarding
1615  like this: 
1616 </para>
1617
1618 <para>
1619  <literal>
1620   <msgtext> 
1621    <literallayout>
1622  <emphasis>forward    .*          .</emphasis>
1623  <emphasis>forward    isp-a.com   host-a:8118</emphasis>
1624    </literallayout>
1625   </msgtext> 
1626  </literal>
1627 </para>
1628
1629 <para>
1630  Now, <emphasis>anyone</emphasis> on the Internet (including users on host-a
1631  and host-b) can set their browser's proxy to <emphasis>either</emphasis>
1632  host-a or host-b and be able to browse the content on isp-a or isp-b.
1633 </para>
1634
1635 <para>
1636  Here's another practical example, for University of Kent at
1637  Canterbury students with a network connection in their room, who
1638  need to use the University's Squid web cache.
1639 </para>
1640
1641 <para>
1642  <literal>
1643   <msgtext> 
1644    <literallayout>
1645  <emphasis>forward  *. ssbcache.ukc.ac.uk:3128</emphasis>  # Use the proxy, except for:
1646  <emphasis>forward  .ukc.ac.uk            .    </emphasis> # Anything on the same domain as us
1647  <emphasis>forward  *                     .    </emphasis> # Host with no domain specified
1648  <emphasis>forward  129.12.*.*            .    </emphasis> # A dotted IP on our /16 network.
1649  <emphasis>forward  127.*.*.*             .    </emphasis> # Loopback address
1650  <emphasis>forward  localhost.localdomain .    </emphasis> # Loopback address
1651  <emphasis>forward  www.ukc.mirror.ac.uk  .    </emphasis> # Specific host
1652    </literallayout>
1653   </msgtext> 
1654  </literal>
1655 </para>
1656
1657 <para>
1658  If you intend to chain <application>Junkbuster</application> and 
1659  <application>squid</application> locally, then chain as 
1660  <literal>browser -> squid -> junkbuster</literal> is the recommended way. 
1661 </para>
1662
1663 <para>
1664  Your squid configuration could then look like this:
1665 </para>
1666
1667 <para>
1668  <literal>
1669   <msgtext> 
1670    <literallayout>
1671   # Define junkbuster as parent cache 
1672  <!-- per feedback from user...
1673   cache_peer 127.0.0.1 8118 parent 0 no-query 
1674  --> 
1675   cache_peer 127.0.0.1 parent 8118 0 no-query
1676   
1677   # Define ACL for protocol FTP 
1678   acl FTP proto FTP 
1679
1680   # Do not forward ACL FTP to junkbuster 
1681   always_direct allow FTP 
1682
1683   # Do not forward ACL CONNECT (https) to junkbuster 
1684   always_direct allow CONNECT 
1685
1686   # Forward the rest to junkbuster 
1687   never_direct allow all 
1688    </literallayout>
1689   </msgtext> 
1690  </literal>
1691 </para>
1692
1693 </sect3>
1694
1695 <!--  ~  End section  ~  -->
1696
1697
1698 <!--   ~~~~~       New section      ~~~~~     -->
1699
1700 <sect3>
1701 <title>Windows GUI Options</title>
1702 <!--
1703 Removed references to Win32. HB 09/23/01
1704 -->
1705 <para>
1706  <application>Junkbuster</application> has a number of options specific to the
1707  Windows GUI interface:
1708 </para>
1709
1710 <para>
1711  If <quote>activity-animation</quote> is set to 1, the
1712  <application>Junkbuster</application> icon will animate when
1713  <quote>Junkbuster</quote> is active. To turn off, set to 0.
1714 </para>
1715
1716 <para>
1717  <literal>
1718   <msgtext> 
1719    <literallayout>
1720   <emphasis>activity-animation   1</emphasis>
1721    </literallayout>
1722   </msgtext> 
1723  </literal>
1724 </para>
1725
1726 <para>
1727  If <quote>log-messages</quote> is set to 1,
1728  <application>Junkbuster</application> will log messages to the console
1729  window:
1730 </para>
1731
1732 <para>
1733  <literal>
1734   <msgtext> 
1735    <literallayout>
1736   <emphasis>log-messages       1</emphasis>
1737    </literallayout>
1738   </msgtext> 
1739  </literal>
1740 </para>
1741
1742 <para> 
1743  If <quote>log-buffer-size</quote> is set to 1, the size of the log buffer,
1744  i.e. the amount of memory used for the log messages displayed in the
1745  console window, will be limited to <quote>log-max-lines</quote> (see below).
1746 </para>
1747
1748 <para>
1749  Warning: Setting this to 0 will result in the buffer to grow infinitely and
1750  eat up all your memory!
1751 </para>
1752
1753 <para>
1754  <literal>
1755   <msgtext> 
1756    <literallayout>
1757   <emphasis>log-buffer-size      1</emphasis>
1758    </literallayout>
1759   </msgtext> 
1760  </literal>
1761 </para>
1762
1763 <para>
1764  <application>log-max-lines</application> is the maximum number of lines held
1765  in the log buffer. See above.
1766 </para>
1767
1768 <para>
1769  <literal>
1770   <msgtext> 
1771    <literallayout>
1772   <emphasis>log-max-lines      200</emphasis>
1773    </literallayout>
1774   </msgtext> 
1775  </literal>
1776 </para>
1777
1778 <para>
1779  If <quote>log-highlight-messages</quote> is set to 1,
1780  <application>Junkbuster</application> will highlight portions of the log
1781  messages with a bold-faced font:
1782 </para>
1783
1784 <para>
1785  <literal>
1786   <msgtext> 
1787    <literallayout>
1788   <emphasis>log-highlight-messages   1</emphasis>
1789    </literallayout>
1790   </msgtext> 
1791  </literal>
1792 </para>
1793
1794 <para>
1795  The font used in the console window:
1796 </para>
1797
1798 <para>
1799  <literal>
1800   <msgtext> 
1801    <literallayout>
1802   <emphasis>log-font-name        Comic Sans MS</emphasis>
1803    </literallayout>
1804   </msgtext> 
1805  </literal>
1806 </para>
1807
1808 <para>
1809  Font size used in the console window:
1810 </para>
1811
1812 <para>
1813  <literal>
1814   <msgtext> 
1815    <literallayout>
1816   <emphasis>log-font-size        8</emphasis>
1817    </literallayout>
1818   </msgtext> 
1819  </literal>
1820 </para>
1821
1822 <para>  
1823  <quote>show-on-task-bar</quote> controls whether or not
1824  <application>Junkbuster</application> will appear as a button on the Task bar
1825  when minimized:
1826 </para>
1827
1828 <para>
1829  <literal>
1830   <msgtext> 
1831    <literallayout>
1832   <emphasis>show-on-task-bar     0</emphasis>
1833    </literallayout>
1834   </msgtext> 
1835  </literal>
1836 </para>
1837
1838 <para>
1839  If <quote>close-button-minimizes</quote> is set to 1, the Windows close
1840  button will minimize <application>Junkbuster</application> instead of closing
1841  the program (close with the exit option on the File menu).
1842 </para>
1843
1844 <para>
1845  <literal>
1846   <msgtext> 
1847    <literallayout>
1848   <emphasis>close-button-minimizes  1</emphasis>
1849    </literallayout>
1850   </msgtext> 
1851  </literal>
1852 </para>
1853
1854 <para>
1855  The <quote>hide-console</quote> option is specific to the MS-Win console
1856  version of <application>JunkBuster</application>. If this option is used,
1857  <application>Junkbuster</application> will disconnect from and hide  the
1858  command console.
1859 </para>
1860
1861 <para>
1862  <literal>
1863   <msgtext> 
1864    <literallayout>
1865   #hide-console
1866    </literallayout>
1867   </msgtext> 
1868  </literal>
1869 </para>
1870
1871 </sect3>
1872 </sect2>
1873
1874 <!--  ~  End section  ~  -->
1875
1876
1877 <!--   ~~~~~       New section      ~~~~~     -->
1878 <sect2 id="actionsfile">
1879 <title>The Actions File</title>
1880
1881 <para>
1882  The <quote>ijb.action</quote> file (formerly
1883  <filename>actionsfile</filename>) is used to define what actions
1884  <application>Junkbuster</application> takes, and thus determines how images,
1885  cookies and various other aspects of HTTP content and transactions are
1886  handled. Images can be anything you want, including ads, banners, or just
1887  some obnoxious image that you would rather not see. Cookies can be accepted
1888  or rejected, or accepted only during the current browser session (i.e. 
1889  not written to disk). Changes to <filename>ijb.action</filename> should 
1890  be immediately visible to <application>Junkbuster</application> without 
1891  the need to restart.
1892 </para>
1893
1894 <para>
1895  To determine which actions apply to a request, the URL of the request is
1896  compared to all patterns in this file. Every time it matches, the list of
1897  applicable actions for the URL is incrementally updated. You can trace
1898  this process by visiting <ulink
1899  url="http://i.j.b/show-url-info">http://i.j.b/show-url-info</ulink>. 
1900 </para>
1901
1902 <para>
1903  The actions file can be edited with a browser by loading 
1904  <ulink url="http://i.j.b/">http://i.j.b/</ulink>, and then select 
1905  <quote>Edit Actions</quote>.
1906 </para>
1907
1908 <para>
1909  There are four types of lines in this file: comments (begin with a 
1910  <quote>#</quote> character), actions, aliases and patterns, all of which are
1911  explained below, as well as the configuration file syntax that 
1912  <application>Junkbuster</application> understands.
1913
1914 </para>
1915
1916
1917 <!--   ~~~~~       New section      ~~~~~     -->
1918 <sect3>
1919 <title>URL Domain and Path Syntax</title>
1920 <para>
1921  Generally, a pattern has the form &lt;domain&gt;/&lt;path&gt;, where both the
1922  &lt;domain&gt; and &lt;path&gt; part are optional. If you only specify a
1923  domain part, the <quote>/</quote> can be left out:
1924 </para>
1925
1926 <para>
1927  <emphasis>www.example.com</emphasis> - is a domain only pattern and will match any request to
1928  <quote>www.example.com</quote>.
1929 </para>
1930
1931 <para>
1932  <emphasis>www.example.com/</emphasis> - means exactly the same.
1933 </para>
1934
1935 <para>
1936  <emphasis>www.example.com/index.html</emphasis> - matches only the single
1937  document <quote>/index.html</quote> on <quote>www.example.com</quote>.
1938 </para>
1939
1940 <para>
1941  <emphasis>/index.html</emphasis> - matches the document <quote>/index.html</quote>, regardless of
1942  the domain.
1943 </para>
1944
1945 <para>
1946  <emphasis>index.html</emphasis> - matches nothing, since it would be
1947  interpreted as a domain name and there is no top-level domain called
1948  <quote>.html</quote>.
1949 </para>
1950
1951 <para>
1952  The matching of the domain part offers some flexible options: if the
1953  domain starts or ends with a dot, it becomes unanchored at that end. 
1954  For example:
1955 </para>
1956
1957 <para>
1958  <emphasis>.example.com</emphasis> - matches any domain that <emphasis>ENDS</emphasis> in 
1959  <quote>.example.com</quote>.
1960 </para>
1961
1962 <para>
1963  <emphasis>www.</emphasis> - matches any domain that <emphasis>STARTS</emphasis> with
1964  <quote>www</quote>.
1965 </para>
1966
1967 <para>
1968  Additionally, there are wild-cards that you can use in the domain names
1969  themselves. They work pretty similar to shell wild-cards: <quote>*</quote>
1970  stands for zero or more arbitrary characters, <quote>?</quote> stands for
1971  any single character. And you can define character classes in square
1972  brackets and they can be freely mixed:
1973 </para>
1974
1975 <para>
1976  <emphasis>ad*.example.com</emphasis> - matches <quote>adserver.example.com</quote>, 
1977  <quote>ads.example.com</quote>, etc but not <quote>sfads.example.com</quote>.
1978 </para>
1979
1980 <para>
1981  <emphasis>*ad*.example.com</emphasis> - matches all of the above, and then some.
1982 </para>
1983
1984 <para>
1985  <emphasis>.?pix.com</emphasis> - matches <quote>www.ipix.com</quote>,
1986  <quote>pictures.epix.com</quote>, <quote>a.b.c.d.e.upix.com</quote>, etc. 
1987 </para>
1988
1989 <para>
1990  <emphasis>www[1-9a-ez].example.com</emphasis> - matches <quote>www1.example.com</quote>, 
1991  <quote>www4.example.com</quote>, <quote>wwwd.example.com</quote>, 
1992  <quote>wwwz.example.com</quote>, etc., but <emphasis>not</emphasis> 
1993  <quote>wwww.example.com</quote>.
1994 </para>
1995
1996 <para>
1997  If <application>Junkbuster</application> was compiled with
1998  <quote>pcre</quote> support (default), Perl compatible regular expressions
1999  can be used. See the <filename>pcre/docs/</filename> directory or <quote>man
2000  perlre</quote> (also available on  <ulink
2001  url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>)
2002  for details. A brief discussion of regular expressions is in the 
2003  <link linkend="regex">Appendix</link>. For instance:
2004 </para>
2005
2006 <para>
2007  <emphasis>/.*/advert[0-9]+\.jpe?g</emphasis>  - would match a URL from any
2008  domain, with any path that includes <quote>advert</quote> followed
2009  immediately by one or more digits, then a <quote>.</quote> and ending in
2010  either <quote>jpeg</quote> or <quote>jpg</quote>. So we match
2011  <quote>example.com/ads/advert2.jpg</quote>, and
2012  <quote>www.example.com/ads/banners/advert39.jpeg</quote>, but not
2013  <quote>www.example.com/ads/banners/advert39.gif</quote> (no gifs in the
2014  example pattern).
2015 </para>
2016
2017 <para>
2018  Please note that matching in the path is case
2019  <emphasis>INSENSITIVE</emphasis> by default, but you can switch to case
2020  sensitive at any point in the pattern by using the 
2021  <quote>(?-i)</quote> switch:
2022 </para>
2023
2024 <para>
2025  <emphasis>www.example.com/(?-i)PaTtErN.*</emphasis> - will match only
2026  documents whose path starts with <quote>PaTtErN</quote> in
2027  <emphasis>exactly</emphasis> this capitalization.
2028 </para>
2029
2030 </sect3>
2031
2032 <!--  ~  End section  ~  -->
2033
2034
2035
2036 <!--   ~~~~~       New section      ~~~~~     -->
2037
2038 <sect3>
2039 <title>Actions</title>
2040 <para>
2041  Actions are enabled if preceded with a <quote>+</quote>, and disabled if 
2042  preceded with a <quote>-</quote>. Actions are invoked by enclosing the 
2043  action name in curly braces (e.g. {+some_action}), followed by a list of 
2044  URLs to which the action applies. There are three classes of actions:
2045 </para>
2046
2047 <para>
2048  <itemizedlist>
2049
2050  <listitem>
2051   <para>  
2052    Boolean (e.g. <quote>+/-block</quote>):
2053   </para>
2054   <para>
2055    <literal>
2056     <msgtext> 
2057      <literallayout>
2058   <emphasis>{+name}</emphasis>        # enable this action
2059   <emphasis>{-name}</emphasis>        # disable this action
2060      </literallayout>
2061     </msgtext> 
2062    </literal>
2063   </para>
2064  </listitem>
2065
2066
2067  <listitem>
2068   <para>  
2069    parameterized (e.g. <quote>+/-hide-user-agent</quote>):
2070   </para>
2071   <para>
2072    <literal>
2073     <msgtext> 
2074      <literallayout>
2075   <emphasis>{+name{param}}</emphasis>  # enable action and set parameter to <quote>param</quote>
2076   <emphasis>{-name}</emphasis>         # disable action
2077      </literallayout>
2078     </msgtext> 
2079    </literal>
2080   </para>
2081  </listitem>
2082  
2083  <listitem>
2084   <para>  
2085    Multi-value (e.g. <quote>{+/-add-header{Name: value}}</quote>, <quote>{+/-wafer{name=value}}</quote>):
2086   </para>
2087   <para>
2088    <literal>
2089     <msgtext> 
2090      <literallayout>
2091   <emphasis>{+name{param}}</emphasis>   # enable action and add parameter <quote>param</quote>
2092   <emphasis>{-name{param}}</emphasis>   # remove the parameter <quote>param</quote>
2093   <emphasis>{-name}</emphasis>          # disable this action totally
2094      </literallayout>
2095     </msgtext> 
2096    </literal>
2097   </para>
2098  </listitem>
2099
2100  </itemizedlist>
2101 </para>
2102
2103 <para>
2104  If nothing is specified in this file, no <quote>actions</quote> are taken.
2105  So in this case <application>JunkBuster</application> would just be a
2106  normal, non-blocking, non-anonymizing proxy. You must specifically
2107  enable the privacy and blocking features you need (although the 
2108  provided default <filename>ijb.action</filename> file will 
2109  give a good starting point).
2110 </para>
2111
2112 <para>
2113  Later defined actions always over-ride earlier ones.  For multi-valued
2114  actions, the actions are applied in the order they are specified.
2115 </para>
2116
2117 <para>
2118  The list of valid <application>Junkbuster</application> <quote>actions</quote> are:
2119 </para>
2120
2121 <para>
2122  <itemizedlist>
2123  
2124  <listitem>
2125   <para>  
2126    Add the specified HTTP header, which is not checked for validity.
2127    You may specify this many times to specify many different headers:
2128   </para>
2129   <para>
2130    <literal>
2131     <msgtext> 
2132      <literallayout>
2133   <emphasis>+add-header{Name: value}</emphasis>
2134      </literallayout>
2135     </msgtext> 
2136    </literal>
2137   </para>
2138  </listitem>
2139  
2140  
2141  <listitem>
2142   <para>  
2143    Block this URL totally.
2144   </para>
2145   <para>
2146    <literal>
2147     <msgtext> 
2148      <literallayout>
2149   <emphasis>+block</emphasis>
2150      </literallayout>
2151     </msgtext> 
2152    </literal>
2153   </para>
2154  </listitem>
2155  
2156  
2157  <listitem>
2158   <para>  
2159    De-animate all animated GIF images, i.e. reduce them to their last frame.
2160    This will also shrink the images considerably (in bytes, not pixels!). If
2161    the option <quote>first</quote> is given, the first frame of the animation
2162    is used as the replacement. If <quote>last</quote> is given, the last frame
2163    of the animation is used instead, which probably makes more sense for most
2164    banner animations, but also has the risk of not showing the entire last
2165    frame (if it is only a delta to an earlier frame).
2166   </para>
2167   <para>
2168    <literal>
2169     <msgtext> 
2170      <literallayout>
2171   <emphasis>+deanimate-gifs{last}</emphasis>
2172   <emphasis>+deanimate-gifs{first}</emphasis>
2173      </literallayout>
2174     </msgtext> 
2175    </literal>
2176   </para>
2177  </listitem>
2178  
2179  <listitem>
2180   <para>
2181    <quote>+downgrade</quote> will downgrade HTTP/1.1 client requests to
2182    HTTP/1.0 and downgrade the responses as well. Use this action for servers
2183    that use HTTP/1.1 protocol features that
2184    <application>Junkbuster</application> doesn't handle well yet. HTTP/1.1 
2185    is only partially implemented. Default is not to downgrade requests.
2186   </para>
2187   <para>
2188    <literal>
2189     <msgtext> 
2190      <literallayout>
2191   <emphasis>+downgrade</emphasis>
2192      </literallayout>
2193     </msgtext> 
2194    </literal>
2195   </para>
2196  </listitem> 
2197  
2198  <listitem>
2199   <para>  
2200    Many sites, like yahoo.com, don't just link to other sites. Instead, they
2201    will link to some script on their own server, giving the destination as a
2202    parameter, which will then redirect you to the final target. URLs resulting
2203    from this scheme typically look like:
2204    http://some.place/some_script?http://some.where-else.
2205   </para>
2206   <para>
2207    Sometimes, there are even multiple consecutive redirects encoded in the
2208    URL. These redirections via scripts make your web browsing more traceable,
2209    since the server from which you follow such a link can see where you go to.
2210    Apart from that, valuable bandwidth and time is wasted, while your browser
2211    ask the server for one redirect after the other. Plus, it feeds the
2212    advertisers.
2213   </para>
2214   <para>
2215    The <quote>+fast-redirects</quote> option enables interception of these
2216    requests by <application>Junkbuster</application>, who will cut off all but
2217    the last valid URL in the request and send a local redirect back to your
2218    browser without contacting the remote site.
2219   </para>
2220   <para>
2221    <literal>
2222     <msgtext> 
2223      <literallayout>
2224   <emphasis>+fast-redirects</emphasis>
2225      </literallayout>
2226     </msgtext> 
2227    </literal>
2228   </para>
2229  </listitem>
2230
2231  <listitem>
2232   <para>  
2233    Filter the website through the re_filterfile:
2234   </para>
2235   <para>
2236    <literal>
2237     <msgtext> 
2238      <literallayout>
2239  <emphasis>+filter{filename}</emphasis>
2240      </literallayout>
2241     </msgtext> 
2242    </literal>
2243   </para>
2244  </listitem>
2245
2246  <listitem>
2247   <para>  
2248    Block any existing X-Forwarded-for header, and do not add a new one:
2249   </para>
2250   <para>
2251    <literal>
2252     <msgtext> 
2253      <literallayout>
2254   <emphasis>+hide-forwarded</emphasis>
2255      </literallayout>
2256     </msgtext> 
2257    </literal>
2258   </para>
2259  </listitem>
2260
2261  <listitem>
2262   <para>  
2263    If the browser sends a <quote>From:</quote> header containing your e-mail
2264    address, this either completely removes the header (<quote>block</quote>), or
2265    changes it to the specified e-mail address.
2266   </para>
2267   <para>
2268    <literal>
2269     <msgtext> 
2270      <literallayout>
2271   <emphasis>+hide-from{block}</emphasis>
2272   <emphasis>+hide-from{spam@sittingduck.xqq}</emphasis>
2273      </literallayout>
2274     </msgtext> 
2275    </literal>
2276   </para>
2277  </listitem>
2278  
2279  <listitem>
2280   <para>  
2281    Don't send the <quote>Referer:</quote> (sic) header to the web site.  You
2282    can block it, forge a URL to the same server as the request (which is
2283    preferred because some sites will not send images otherwise) or set it to a
2284    constant string of your choice.
2285   </para>
2286   <para>
2287    <literal>
2288     <msgtext> 
2289      <literallayout>
2290   <emphasis>+hide-referer{block}</emphasis>
2291   <emphasis>+hide-referer{forge}</emphasis>
2292   <emphasis>+hide-referer{http://nowhere.com}</emphasis>
2293      </literallayout>
2294     </msgtext> 
2295    </literal>
2296   </para>
2297  </listitem>
2298  
2299  <listitem>
2300   <para>  
2301    Alternative spelling of <quote>+hide-referer</quote>.  It has the same
2302    parameters, and can be freely mixed with, <quote>+hide-referer</quote>.
2303    (<quote>referrer</quote> is the correct English spelling, however the HTTP
2304    specification has a bug - it requires it to be spelled <quote>referer</quote>.) 
2305   </para>
2306   <para>
2307    <literal>
2308     <msgtext> 
2309      <literallayout>
2310   <emphasis>+hide-referrer{...}</emphasis>
2311      </literallayout>
2312     </msgtext> 
2313    </literal>
2314   </para>
2315  </listitem>
2316
2317  <listitem>
2318   <para>  
2319    Change the <quote>User-Agent:</quote> header so web servers can't tell your
2320    browser type.  Warning! This breaks many web sites.  Specify the
2321    user-agent value you want. Example, pretend to be using Netscape on
2322    Linux:
2323   </para>
2324   <para>
2325    <literal>
2326     <msgtext> 
2327      <literallayout>
2328   <emphasis>+hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}</emphasis>
2329      </literallayout>
2330     </msgtext> 
2331    </literal>
2332   </para>
2333  <!-- 
2334   <para>
2335    Or to identify yourself explicitly as a <quote>Junkbuster</quote> user:
2336   </para>
2337   <para>
2338    <literal>
2339     <msgtext> 
2340      <literallayout>
2341   <emphasis>+hide-user-agent{JunkBuster/1.0}</emphasis>
2342      </literallayout>
2343     </msgtext> 
2344    </literal>
2345   </para>
2346    (Don't change the version number from 1.0 - after all, why tell them?)
2347   <para>
2348   </para>
2349   <para>
2350    <literal>
2351     <msgtext> 
2352      <literallayout>
2353   <emphasis>+hide-user-agent{browser-type}</emphasis>
2354      </literallayout>
2355     </msgtext> 
2356    </literal>
2357   </para>
2358 -->
2359  </listitem>
2360
2361  <listitem>
2362   <para>  
2363    Treat this URL as an image.  This only matters if it's also <quote>+block</quote>ed,
2364     in which case a <quote>blocked</quote> image can be sent rather than a HTML page.
2365     See <quote>+image-blocker{}</quote> below for the control over what is actually sent.
2366   </para>
2367   <para>
2368    <literal>
2369     <msgtext> 
2370      <literallayout>
2371   <emphasis>+image</emphasis>
2372      </literallayout>
2373     </msgtext> 
2374    </literal>
2375   </para>
2376  </listitem>
2377  
2378  <listitem>
2379   <para>  
2380    Decides what to do with URLs that end up tagged with <quote>{+block
2381    +image}</quote>, e.g an advertizement. There are five options.
2382    <quote>-image-blocker</quote> will send a HTML <quote>blocked</quote> page,
2383    usually resulting in a <quote>broken image</quote> icon.
2384    <quote>+image-blocker{logo}</quote> will send a <quote>JunkBuster</quote>
2385    logo image. <quote>+image-blocker{blank}</quote> will send a 1x1
2386    transparent GIF image. And finally,
2387    <quote>+image-blocker{http://xyz.com}</quote> will send a HTTP temporary
2388    redirect to the specified image. This has the advantage of the icon being
2389    being cached by the browser, which will speed up the display.
2390    <quote>+image-blocker{pattern}</quote> will send a checkboard type pattern,
2391    which scales better than the logo (which can get blocky if the browser 
2392    enlarges it too much).
2393   </para>
2394   <para>
2395    <literal>
2396     <msgtext> 
2397      <literallayout>
2398   <emphasis>+image-blocker{logo}</emphasis>
2399   <emphasis>+image-blocker{blank}</emphasis>
2400   <emphasis>+image-blocker{http://i.j.b/send-banner}</emphasis>
2401      </literallayout>
2402     </msgtext> 
2403    </literal>
2404   </para>
2405  </listitem>
2406  
2407  <listitem>
2408    <para> 
2409    By default (i.e. in the absence of a <quote>+limit-connect</quote>
2410    action), <application>Junkbuster</application> will only allow CONNECT
2411    requests to port 443, which is the standard port for https as a 
2412    precaution.
2413   </para>
2414  
2415   <para>
2416    The CONNECT methods exists in HTTP to allow access to secure websites
2417    (https:// URLs) through proxies. It works very simply: the proxy
2418    connects to the server on the specified port, and then short-circuits
2419    its connections to the client <emphasis>and</emphasis> to the remote proxy.
2420    This can be a big security hole, since CONNECT-enabled proxies can
2421    be abused as TCP relays very easily.
2422   </para>
2423   
2424   <para> 
2425    If you want to allow CONNECT for more ports than this, or want to forbid
2426    CONNECT altogether, you can specify a comma separated list of ports and
2427    port ranges (the latter using dashes, with the minimum defaulting to 0 and
2428    max to 65K):
2429   </para>
2430
2431   <para>
2432    <literal>
2433     <msgtext> 
2434      <literallayout>
2435   <emphasis>+limit-connect{443}                 # This is the default and need no be specified.</emphasis>
2436   <emphasis>+limit-connect{80,443}              # Ports 80 and 443 are OK.</emphasis>
2437   <emphasis>+limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100</emphasis>
2438   <emphasis>                                    #and above 500 are OK.</emphasis>
2439      </literallayout>
2440     </msgtext> 
2441    </literal>
2442   </para>
2443
2444  </listitem> 
2445  
2446  <listitem>
2447   <para>
2448    <quote>+no-compression</quote> prevents the website from compressing the
2449    data. Some websites do this, which can be a problem for
2450    <application>Junkbuster</application>, since <quote>+filter</quote>,
2451    <quote>+no-popup</quote> and <quote>+gif-deanimate</quote> will not work on
2452    compressed data. This will slow down connections to those websites,
2453    though. Default is <quote>nocompression</quote> is turned on.
2454   </para>
2455
2456   <para>
2457    <literal>
2458     <msgtext> 
2459      <literallayout>
2460   <emphasis>+nocompression</emphasis>
2461      </literallayout>
2462     </msgtext> 
2463    </literal>
2464   </para>
2465  </listitem> 
2466  
2467  <listitem>
2468   <para>  
2469    If the website sets cookies, <quote>no-cookies-keep</quote> will make sure
2470    they are erased when you exit and restart your web browser. This makes
2471    profiling cookies useless, but won't break sites which require cookies so
2472    that you can log in for transactions. Default: on.
2473   </para>
2474   <para>
2475    <literal>
2476     <msgtext> 
2477      <literallayout>
2478   <emphasis>+no-cookies-keep</emphasis>
2479      </literallayout>
2480     </msgtext> 
2481    </literal>
2482   </para>
2483  </listitem>
2484  
2485  <listitem>
2486   <para>  
2487    Prevent the website from reading cookies:
2488   </para>
2489   <para>
2490    <literal>
2491     <msgtext> 
2492      <literallayout>
2493   <emphasis>+no-cookies-read</emphasis>
2494      </literallayout>
2495     </msgtext> 
2496    </literal>
2497   </para>
2498  </listitem>
2499  
2500  <listitem>
2501   <para>  
2502    Prevent the website from setting cookies:
2503   </para>
2504   <para>
2505    <literal>
2506     <msgtext> 
2507      <literallayout>
2508   <emphasis>+no-cookies-set</emphasis>
2509      </literallayout>
2510     </msgtext> 
2511    </literal>
2512   </para>
2513  </listitem>
2514  
2515  <listitem>
2516   <para>  
2517    Filter the website through a built-in filter to disable those obnoxious 
2518    JavaScript pop-up windows via window.open(), etc. The two alternative
2519    spellings are equivalent.
2520   </para>
2521   <para>
2522    <literal>
2523     <msgtext> 
2524      <literallayout>
2525   <emphasis>+no-popup</emphasis>
2526   <emphasis>+no-popups</emphasis>
2527      </literallayout>
2528     </msgtext> 
2529    </literal>
2530   </para>
2531  </listitem>
2532  
2533  <listitem>
2534   <para>  
2535    This action only applies if you are using a <filename>jarfile</filename>
2536    for saving cookies. It sends a cookie to every site stating that you do not
2537    accept any copyright on cookies sent to you, and asking them not to track
2538    you.  Of course, this is a (relatively) unique header they could use to
2539    track you.
2540   </para>
2541   <para>
2542    <literal>
2543     <msgtext> 
2544      <literallayout>
2545   <emphasis>+vanilla-wafer</emphasis>
2546      </literallayout>
2547     </msgtext> 
2548    </literal>
2549   </para>
2550  </listitem>
2551  
2552  <listitem>
2553   <para>  
2554    This allows you to add an arbitrary cookie. It can be specified multiple
2555    times in order to add as many cookies as you like.
2556   </para>
2557   <para>
2558    <literal>
2559     <msgtext> 
2560      <literallayout>
2561   <emphasis>+wafer{name=value}</emphasis>
2562      </literallayout>
2563     </msgtext> 
2564    </literal>
2565   </para>
2566  </listitem>
2567
2568  </itemizedlist>
2569 </para>
2570
2571 <para>
2572  The meaning of any of the above is reversed by preceding the action with a 
2573  <quote>-</quote>, in place of the <quote>+</quote>.
2574 </para>
2575
2576 <para>
2577  Some examples:
2578 </para>
2579
2580 <para>
2581  Turn off cookies by default, then allow a few through for specified sites:
2582 </para>
2583   
2584 <para>
2585  <literal>
2586   <msgtext> 
2587    <literallayout>
2588  # Turn off all persistent cookies
2589  { +no-cookies-read }
2590  { +no-cookies-set }
2591  # Allow cookies for this browser session ONLY
2592  { +no-cookies-keep }
2593
2594  # Exceptions to the above, sites that benefit from persistent cookies
2595  { -no-cookies-read }
2596  { -no-cookies-set }
2597  { -no-cookies-keep }
2598  .javasoft.com
2599  .sun.com
2600  .yahoo.com
2601  .msdn.microsoft.com
2602  .redhat.com
2603
2604  # Alternative way of saying the same thing
2605  {-no-cookies-set -no-cookies-read -no-cookies-keep}
2606  .sourceforge.net
2607  .sf.net
2608    </literallayout>
2609   </msgtext> 
2610  </literal>
2611 </para>
2612
2613 <para>
2614  Now turn off <quote>fast redirects</quote>, and then we allow two exceptions:
2615 </para>
2616
2617 <para>
2618  <literal>
2619   <msgtext> 
2620    <literallayout>
2621  # Turn them off!
2622  {+fast-redirects}
2623  
2624  # Reverse it for these two sites, which don't work right without it.
2625  {-fast-redirects}
2626  www.ukc.ac.uk/cgi-bin/wac\.cgi\?
2627  login.yahoo.com
2628    </literallayout>
2629   </msgtext> 
2630  </literal>
2631 </para>
2632
2633 <para>
2634  Turn on page filtering, with one exception for sourceforge:
2635 </para>
2636
2637 <para>
2638  <literal>
2639   <msgtext> 
2640    <literallayout>
2641  # Run everything through the default filter file (<filename>re_filterfile</filename>):
2642  {+filter}
2643  
2644  # But please don't re_filter code from sourceforge!
2645  {-filter}
2646  .cvs.sourceforge.net
2647    </literallayout>
2648   </msgtext> 
2649  </literal>
2650 </para>
2651
2652 <para>
2653  Now some URLs that we want <quote>blocked</quote>, ie we won't see them.
2654  Many of these use regular expressions that will expand to match multiple 
2655  URLs:
2656 </para>
2657
2658 <para>
2659  <literal>
2660   <msgtext> 
2661    <literallayout>
2662   # Blocklist:
2663   {+block}
2664   /.*/(.*[-_.])?ads?[0-9]?(/|[-_.].*|\.(gif|jpe?g))
2665   /.*/(.*[-_.])?count(er)?(\.cgi|\.dll|\.exe|[?/])
2666   /.*/(ng)?adclient\.cgi
2667   /.*/(plain|live|rotate)[-_.]?ads?/
2668   /.*/(sponsor)s?[0-9]?/
2669   /.*/_?(plain|live)?ads?(-banners)?/
2670   /.*/abanners/
2671   /.*/ad(sdna_image|gifs?)/
2672   /.*/ad(server|stream|juggler)\.(cgi|pl|dll|exe)
2673   /.*/adbanners/
2674   /.*/adserver
2675   /.*/adstream\.cgi
2676   /.*/adv((er)?ts?|ertis(ing|ements?))?/
2677   /.*/banner_?ads/
2678   /.*/banners?/
2679   /.*/banners?\.cgi/
2680   /.*/cgi-bin/centralad/getimage
2681   /.*/images/addver\.gif
2682   /.*/images/marketing/.*\.(gif|jpe?g)
2683   /.*/popupads/
2684   /.*/siteads/
2685   /.*/sponsor.*\.gif
2686   /.*/sponsors?[0-9]?/
2687   /.*/advert[0-9]+\.jpg
2688   /Media/Images/Adds/
2689   /ad_images/
2690   /adimages/
2691   /.*/ads/
2692   /bannerfarm/
2693   /grafikk/annonse/
2694   /graphics/defaultAd/
2695   /image\.ng/AdType
2696   /image\.ng/transactionID
2697   /images/.*/.*_anim\.gif # alvin brattli
2698   /ip_img/.*\.(gif|jpe?g)
2699   /rotateads/
2700   /rotations/ 
2701   /worldnet/ad\.cgi
2702   /cgi-bin/nph-adclick.exe/
2703   /.*/Image/BannerAdvertising/
2704   /.*/ad-bin/
2705   /.*/adlib/server\.cgi
2706   /autoads/
2707    </literallayout>
2708   </msgtext> 
2709  </literal>
2710 </para>
2711
2712 </sect3>
2713
2714 <!--  ~  End section  ~  -->
2715
2716
2717 <!--   ~~~~~       New section      ~~~~~     -->
2718 <sect3>
2719 <title>Aliases</title>
2720 <para>
2721  Custom <quote>actions</quote>, known to <application>Junkbuster</application>
2722  as <quote>aliases</quote>, can be defined by combining other <quote>actions</quote>.
2723  These can in turn be invoked just like the built-in <quote>actions</quote>.
2724  Currently, an alias can contain any character except space, tab, <quote>=</quote>,
2725  <quote>{</quote> or <quote>}</quote>. But please use only <quote>a</quote>-
2726  <quote>z</quote>, <quote>0</quote>-<quote>9</quote>, <quote>+</quote>, and
2727  <quote>-</quote>. Alias names are not case sensitive, and 
2728  <emphasis>must be defined  before anything</emphasis> else in the
2729  <filename>ijb.action</filename>file ! And there can only be one set of
2730  <quote>aliases</quote> defined.
2731 </para>
2732
2733 <para>
2734  Now let's define a few aliases:
2735 </para>
2736
2737 <para>
2738  <literal>
2739   <msgtext> 
2740    <literallayout>
2741  # Useful customer aliases we can use later. These must come first!
2742  {{alias}}
2743  +no-cookies = +no-cookies-set +no-cookies-read
2744  -no-cookies = -no-cookies-set -no-cookies-read
2745  fragile     = -block -no-cookies -filter -fast-redirects -hide-referer -no-popups
2746  shop        = -no-cookies -filter -fast-redirects
2747  +imageblock = +block +image
2748
2749  #For people who don't like to type too much:  ;-)
2750  c0 = +no-cookies
2751  c1 = -no-cookies
2752  c2 = -no-cookies-set +no-cookies-read
2753  c3 = +no-cookies-set -no-cookies-read
2754  #... etc.  Customize to your heart's content.
2755    </literallayout>
2756   </msgtext> 
2757  </literal>
2758 </para>
2759
2760 <para>
2761  Some examples using our <quote>shop</quote> and <quote>fragile</quote>
2762  aliases from above:
2763 </para>
2764
2765 <para>
2766  <literal>
2767   <msgtext> 
2768    <literallayout>
2769  # These sites are very complex and require
2770  # minimal interference.
2771  {fragile}
2772  .office.microsoft.com
2773  .windowsupdate.microsoft.com
2774  .nytimes.com
2775
2776  # Shopping sites - still want to block ads.
2777  {shop}
2778  .quietpc.com
2779  .worldpay.com   # for quietpc.com
2780  .jungle.com
2781  .scan.co.uk
2782
2783  # These shops require pop-ups
2784  {shop -no-popups}
2785  .dabs.com
2786  .overclockers.co.uk
2787    </literallayout>
2788   </msgtext> 
2789  </literal>
2790 </para>
2791
2792 </sect3>
2793 </sect2>
2794
2795 <!--  ~  End section  ~  -->
2796
2797
2798 <!--   ~~~~~       New section      ~~~~~     -->
2799 <sect2 id="filterfile">
2800 <title>The Filter File</title>
2801 <para>
2802  The filter file defines what filtering of web pages
2803  <application>Junkbuster</application> does. The default filter file is 
2804  <filename>re_filterfile</filename>, located in the config directory. In this 
2805  file, <emphasis>any document content</emphasis>, whether viewable text or
2806  embedded non-visible content, can be changed. 
2807 </para>
2808
2809 <para>
2810  This file uses regular expressions to alter or remove any string in the
2811  target page. Some examples from the included default <filename>re_filterfile</filename>:
2812 </para>
2813
2814 <para>
2815  Stop web pages from displaying annoying messages in the status bar by
2816  deleting such references:
2817 </para>
2818
2819 <para>
2820  <literal>
2821   <msgtext> 
2822    <literallayout>
2823  # The status bar is for displaying link targets, not pointless buzzwords.
2824  # Again, check it out on http://www.airport-cgn.de/.
2825  s/status='.*?';*//ig
2826    </literallayout>
2827   </msgtext> 
2828  </literal>
2829 </para>
2830
2831 <para>
2832  Just for kicks, replace any occurrence of <quote>Microsoft</quote> with
2833  <quote>MicroSuck</quote>: 
2834 </para>
2835
2836 <para>
2837  <literal>
2838   <msgtext> 
2839    <literallayout>
2840  s/microsoft(?!.com)/MicroSuck/ig
2841    </literallayout>
2842   </msgtext> 
2843  </literal>
2844 </para>
2845
2846 <para>
2847  Kill those auto-refresh tags:
2848 </para>
2849
2850 <para>
2851  <literal>
2852   <msgtext> 
2853    <literallayout>
2854  # Kill refresh tags. I like to refresh myself. Manually.
2855  # check it out on http://www.airport-cgn.de/ and go to the arrivals page.
2856  #
2857  s/&lt;meta[^&gt;]*http-equiv[^&gt;]*refresh.*URL=([^&gt;]*?)"?&gt;/&lt;link rev="x-refresh" href=$1&gt;/i
2858  s/&lt;meta[^&gt;]*http-equiv="?page-enter"?[^&gt;]*content=[^&gt;]*&gt;/&lt;!--no page enter for me--&gt;/i
2859    </literallayout>
2860   </msgtext> 
2861  </literal>
2862 </para>
2863
2864 </sect2>
2865
2866 <!--  ~  End section  ~  -->
2867
2868
2869
2870 <!--   ~~~~~       New section      ~~~~~     -->
2871
2872 <sect2>
2873 <title>Templates</title>
2874 <para>
2875  When <application>Junkbuster</application> displays one of its internal 
2876  pages, such as a 404 Not Found error page, it uses the appropriate template.
2877  On Linux, BSD, and Unix, these are locate in
2878  <filename>/etc/junkbuster/templates</filename> by default. These may be
2879  customized, if desired.
2880
2881 </para>
2882 </sect2>
2883
2884 </sect1>
2885
2886 <!--  ~  End section  ~  -->
2887
2888
2889
2890 <!--   ~~~~~       New section      ~~~~~     -->
2891 <sect1 id="quickstart"><title>Quickstart to Using Junkbuster</title>
2892 <para>
2893  Install package, then run and enjoy! <application>JunkBuster</application> 
2894  accepts only one command line option -- the configuration file to be 
2895  used. Example Unix startup command:
2896 </para>
2897
2898 <para>
2899  <screen>
2900  
2901  # /usr/sbin/junkbuster /etc/junkbuster/config
2902  
2903  </screen>
2904 </para>
2905
2906 <para>
2907  An init script is provided for SuSE and Redhat.
2908 </para>
2909
2910 <para>
2911 For for SuSE: /etc/rc.d/junkbuster start
2912 </para>
2913
2914 <para>
2915 For RedHat: /etc/rc.d/init.d/junkbuster start
2916 </para>
2917
2918
2919 <para>
2920  If no configuration file is specified on the command line,
2921  <application>Junkbuster</application> will look for a file named
2922  <filename>config</filename> in the current directory. Except on Win32 where
2923  it will try <filename>config.txt</filename>. If no file is specified on the
2924  command line and no default configuration file can be found, 
2925  <application>Junkbuster</application> will fail to start.
2926 </para>
2927
2928 <para>
2929  Be sure your browser is set to use the proxy which is by default at
2930  localhost, port 8118. With <application>Netscape</application> (and
2931  <application>Mozilla</application>), this can be set under <literal>Edit
2932  -&gt; Preferences -&gt; Advanced -&gt; Proxies -&gt; HTTP Proxy</literal>.
2933  For <application>Internet Explorer</application>: <literal>Tools &gt;
2934  Internet Properties -&gt; Connections -&gt; LAN Setting</literal>. Then,
2935  check <quote>Use Proxy</quote> and fill in the appropriate info (Address:
2936  localhost, Port: 8118). Include if HTTPS proxy support too.
2937 </para>
2938
2939 <para>
2940  The included default configuration files should give a reasonable starting
2941  point, though may be somewhat aggressive in blocking junk. You will probably
2942  want to keep an eye out for sites that require persistent cookies, and add these to
2943  <filename>ijb.action</filename> as needed. By default, most of these will
2944  be accepted only during the current browser session, until you add them to
2945  the configuration. If you want the browser to handle this instead, you will
2946  need to edit <filename>ijb.action</filename> and disable this feature. If you
2947  use more than one browser, it would make more sense to let
2948  <application>Junkbuster</application> handle this. In which case, the
2949  browser(s) should be set to accept all cookies.
2950 </para>
2951
2952 <para>
2953  If a particular site shows problems loading properly, try adding it 
2954  to the <literal>{fragile}</literal> section of
2955  <filename>ijb.action</filename>. This will turn off most actions for 
2956  this site.
2957 </para>
2958
2959 <para>
2960  <application>Junkbuster</application> is HTTP/1.1 compliant,  but not all 1.1
2961  features are as yet implemented. If browsers that support HTTP/1.1 (like
2962  <application>Mozilla</application> or recent versions of I.E.) experience
2963  problems, you might try to force HTTP/1.0 compatibility. For Mozilla, look
2964  under <literal>Edit -&gt; Preferences -&gt; Debug -&gt; Networking</literal>.
2965  Or set the <quote>+downgrade</quote> config option in
2966  <filename>ijb.action</filename>.
2967 </para>
2968
2969 <para>
2970  After running <application>Junkbuster</application> for a while, you can 
2971  start to fine tune the configuration to suit your personal, or site, 
2972  preferences and requirements. There are many, many aspects that can 
2973  be customized. <quote>Actions</quote> (as specified in <filename>ijb.action</filename>) 
2974  can be adjusted by pointing your browser to 
2975  <ulink url="http://i.j.b/">http://i.j.b/</ulink>, 
2976  and then follow the link to <quote>edit the actions list</quote>. 
2977  (This is an internal page and does not require Internet access.)
2978 </para>
2979
2980 <para>
2981  In fact, various aspects of <application>Junkbuster</application>
2982  configuration can be viewed from this page, including 
2983  current configuration parameters, source code version numbers, 
2984  the browser's request headers, and <quote>actions</quote> that apply 
2985  to a given URL. In addition to the <filename>ijb.action</filename> file 
2986  editor mentioned above, <application>Junkbuster</application> can also 
2987  be turned <quote>on</quote> and <quote>off</quote> from this page.
2988 </para>
2989
2990 <para>
2991  If you encounter problems, please verify it is a
2992  <application>Junkbuster</application> bug, by disabling
2993  <application>Junkbuster</application>, and then trying the same page. 
2994  Also, try another browser if possible to eliminate browser or site 
2995  problems. Before reporting it as a bug, see if there is not a configuration 
2996  option that is enabled that is causing the page not to load. You can 
2997  then add an exception for that page or site. If a bug, please report it to
2998  the developers (see below). 
2999 </para>
3000
3001 </sect1>
3002
3003
3004 <!--   ~~~~~       New section      ~~~~~     -->
3005 <sect1 id="contact"><title>Contacting the Developers, Bug Reporting and Feature
3006 Requests</title>
3007 <para>
3008 We value your feedback. However, to provide you with the best support,
3009 please note:
3010
3011  <itemizedlist>
3012
3013   <listitem><para>Use the <ulink url="http://sourceforge.net/tracker/?group_id=11118&#38;atid=211118">Sourceforge support forum</ulink> to get
3014   help.</para></listitem>
3015  
3016   <listitem><para>Submit bugs only thru our <ulink url="http://sourceforge.net/tracker/?group_id=11118&#38;atid=111118">Sourceforge bug
3017       forum</ulink>. 
3018 Make sure that the bug has not already been submitted.  Please try to
3019 verify that it is a <application>Junkbuster</application> bug, and not
3020 a browser or site bug first. If you are using your own custom configuration,
3021 please try the stock configs to see if the problem is a configuration
3022 related bug.  And if not using the latest development snapshot, please
3023 try the latest one. Or even better, CVS sources.</para>
3024 </listitem>
3025
3026  
3027   <listitem><para>Submit feature requests only thru our <ulink
3028       url="http://sourceforge.net/tracker/?atid=361118&#38;group_id=11118&#38;func=browse">Sourceforge feature request forum</ulink>.</para></listitem>
3029
3030
3031  </itemizedlist>
3032
3033 </para>
3034
3035 <para>
3036 For any other issues, feel free to use the <ulink url="http://sourceforge.net/mail/?group_id=11118">mailing lists</ulink>.
3037 </para>
3038
3039 <para>
3040  Anyone interested in actively participating in development and related 
3041  discussions can join the appropriate mailing list  
3042  <ulink url="http://sourceforge.net/mail/?group_id=11118">here</ulink>.
3043  Archives are available here too.
3044 </para>
3045
3046 </sect1>
3047
3048
3049 <!--   ~~~~~       New section      ~~~~~     -->
3050 <sect1 id="copyright"><title>Copyright and History</title>
3051
3052 <sect2>
3053 <title>License</title>
3054 <para>
3055  <application>Internet Junkbuster</application> is free software; you can
3056  redistribute it and/or modify it under the terms of the GNU General Public
3057  License as published by the Free Software Foundation; either version 2 of the
3058  License, or (at your option) any later version.
3059 </para>
3060
3061 <para>
3062  This program is distributed in the hope that it will be useful, but WITHOUT
3063  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
3064  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
3065  details, which is available from <ulink
3066  url="http://www.gnu.org/copyleft/gpl.html">the Free Software Foundation,
3067  Inc</ulink>, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
3068 </para>
3069
3070 </sect2>
3071
3072 <!--  ~  End section  ~  -->
3073
3074
3075 <!--   ~~~~~       New section      ~~~~~     -->
3076
3077 <sect2>
3078 <title>History</title>
3079 <para>
3080  <application>Junkbuster</application> was originally written by Anonymous 
3081  Coders and <ulink
3082  url="http://www.junkbusters.com/ht/en/ijbfaq.html">Junkbuster's
3083  Corporation</ulink>, and was released as free open-source software under the
3084  GNU GPL. <ulink url="http://www.waldherr.org/junkbuster/">Stefan
3085  Waldherr</ulink> made many improvements, and started the <ulink
3086  url="http://sourceforge.net/projects/ijbswa/">SourceForge project</ulink> to
3087  rekindle development. There are now several active developers contributing.
3088  The last stable release was v2.0.2, which has now grown whiskers ;-).
3089 </para>
3090
3091 </sect2>
3092
3093 </sect1>
3094
3095 <!--   ~~~~~       New section      ~~~~~     -->
3096 <sect1 id="seealso"><title>See also</title>
3097 <para>
3098  
3099  <simplelist>
3100   <member>
3101    &nbsp; <ulink url="http://sourceforge.net/projects/ijbswa">http://sourceforge.net/projects/ijbswa</ulink>
3102   </member>
3103  </simplelist>
3104  <simplelist>
3105   <member>
3106    &nbsp; <ulink url="http://ijbswa.sourceforge.net/">http://ijbswa.sourceforge.net/</ulink>
3107   </member>
3108  </simplelist>
3109  <simplelist>
3110   <member>
3111    &nbsp; <ulink url="http://i.j.b/">http://i.j.b/</ulink>
3112   </member>
3113  </simplelist>
3114  <simplelist>
3115   <member>
3116    &nbsp; <ulink url="http://www.junkbusters.com/ht/en/cookies.html">http://www.junkbusters.com/ht/en/cookies.html</ulink>
3117   </member>
3118  </simplelist>
3119  <simplelist>
3120   <member>
3121    &nbsp; <ulink url="http://www.waldherr.org/junkbuster/">http://www.waldherr.org/junkbuster/</ulink>
3122   </member>
3123  </simplelist>
3124  <simplelist>
3125   <member>
3126    &nbsp; <ulink url="http://privacy.net/analyze/">http://privacy.net/analyze/</ulink>
3127   </member>
3128  </simplelist>
3129  <simplelist>
3130   <member>
3131    &nbsp;<ulink url="http://www.squid-cache.org/">http://www.squid-cache.org/</ulink>
3132   </member>
3133  </simplelist>
3134
3135 </para>
3136 </sect1>
3137
3138
3139
3140 <!--   ~~~~~       New section      ~~~~~     -->
3141 <sect1 id="appendix"><title>Appendix</title>
3142
3143
3144 <!--   ~~~~~       New section      ~~~~~     -->
3145 <sect2 id="regex">
3146 <title>Regular Expressions</title>
3147 <para>
3148  <application>Junkbuster</application> can use <quote>regular expressions</quote> 
3149  in various config files. Assuming support for <quote>pcre</quote> (Perl
3150  Compatible Regular Expressions) is compiled in, which is the default. Such
3151  configuration directives do not require regular expressions, but they can be
3152  used to increase flexibility by matching a pattern with wild-cards against
3153  URLs.
3154 </para>
3155
3156 <para>
3157  If you are reading this, you probably don't understand what <quote>regular
3158  expressions</quote> are, or what they can do. So this will be a very brief
3159  introduction only. A full explanation would require a book ;-)
3160 </para>
3161
3162 <para>
3163  <quote>Regular expressions</quote> is a way of matching one character
3164  expression against another to see if it matches or not. One of the
3165  <quote>expressions</quote> is a literal string of readable characters
3166  (letter, numbers, etc), and the other is a complex string of literal
3167  characters combined with wild-cards, and other special characters, called
3168  meta-characters. The <quote>meta-characters</quote> have special meanings and
3169  are used to build the complex pattern to be matched against. Perl Compatible
3170  Regular Expressions is an enhanced form of the regular expression language
3171  with backward compatibility.
3172 </para>
3173
3174 <para>
3175  To make a simple analogy, we do something similar when we use wild-card
3176  characters when listing files with the <command>dir</command> command in DOS. 
3177  <literal>*.*</literal> matches all filenames. The <quote>special</quote>
3178  character here is the asterisk which matches any and all characters. We can be
3179  more specific and use <literal>?</literal> to match just individual
3180  characters. So <quote>dir file?.text</quote> would match
3181  <quote>file1.txt</quote>, <quote>file2.txt</quote>, etc. We are pattern
3182  matching, using a similar technique to <quote>regular expressions</quote>!
3183 </para>
3184
3185 <para>
3186  Regular expressions do essentially the same thing, but are much, much more
3187  powerful. There are many more <quote>special characters</quote> and ways of 
3188  building complex patterns however. Let's look at a few of the common ones,
3189  and then some examples:
3190 </para>
3191
3192 <simplelist>
3193  <member>
3194   <emphasis>.</emphasis> - Matches any single character, e.g. <quote>a</quote>,
3195   <quote>A</quote>, <quote>4</quote>, <quote>:</quote>, or <quote>@</quote>.
3196  </member>
3197 </simplelist>
3198
3199 <simplelist>
3200  <member>
3201   <emphasis>?</emphasis> - The preceding character or expression is matched ZERO or ONE
3202   times. Either/or.
3203  </member>
3204 </simplelist>
3205
3206 <simplelist>
3207  <member>
3208   <emphasis>+</emphasis> - The preceding character or expression is matched ONE or MORE
3209   times.
3210  </member>
3211 </simplelist>
3212
3213 <simplelist>
3214  <member>
3215   <emphasis>*</emphasis> - The preceding character or expression is matched ZERO or MORE
3216   times.
3217  </member>
3218 </simplelist>
3219
3220 <simplelist>
3221  <member>
3222   <emphasis>\</emphasis> - The <quote>escape</quote> character denotes that
3223   the following character should be taken literally. This is used where one of the 
3224   special characters (e.g. <quote>.</quote>) needs to be taken literally and
3225   not as a special meta-character.
3226  </member>
3227 </simplelist>
3228
3229 <simplelist>
3230  <member>
3231   <emphasis>[]</emphasis> - Characters enclosed in brackets will be matched if
3232   any of the enclosed characters are encountered.
3233  </member>
3234 </simplelist>
3235
3236 <simplelist>
3237  <member>
3238   <emphasis>()</emphasis> - parentheses are used to group a sub-expression,
3239   or multiple sub-expressions.
3240  </member>
3241 </simplelist>
3242
3243 <simplelist>
3244  <member>
3245   <emphasis>|</emphasis> - The <quote>bar</quote> character works like an
3246   <quote>or</quote> conditional statement. A match is successful if the
3247   sub-expression on either side of <quote>|</quote> matches.
3248  </member>
3249 </simplelist>
3250
3251 <simplelist>
3252  <member>
3253   <emphasis>s/string1/string2/g</emphasis> - This is used to rewrite strings of text. 
3254   <quote>string1</quote> is replaced by <quote>string2</quote> in this
3255   example.
3256  </member>
3257 </simplelist>
3258
3259 <para>
3260  These are just some of the ones you are likely to use when matching URLs with 
3261  <application>Junkbuster</application>, and is a long way from a definitive
3262  list. This is enough to get us started with a few simple examples which may
3263  be more illuminating:
3264 </para>
3265
3266 <para>
3267  <emphasis><literal>/.*/banners/.*</literal></emphasis> - A  simple example
3268  that uses the common combination of <quote>.</quote> and <quote>*</quote> to 
3269  denote any character, zero or more times. In other words, any string at all.
3270  So we start with a literal forward slash, then our regular expression pattern 
3271  (<quote>.*</quote>) another literal forward slash, the string
3272  <quote>banners</quote>, another forward slash, and lastly another
3273  <quote>.*</quote>. We are building 
3274  a directory path here. This will match any file with the path that has a
3275  directory named <quote>banners</quote> in it. The <quote>.*</quote> matches
3276  any characters, and this could conceivably be more forward slashes, so it
3277  might expand into a much longer looking path. For example, this could match:
3278  <quote>/eye/hate/spammers/banners/annoy_me_please.gif</quote>, or just
3279  <quote>/banners/annoying.html</quote>, or almost an infinite number of other
3280  possible combinations, just so it has <quote>banners</quote> in the path
3281  somewhere.
3282 </para>
3283
3284 <para>
3285  A now something a little more complex:
3286 </para>
3287
3288 <para>
3289  <emphasis><literal>/.*/adv((er)?ts?|ertis(ing|ements?))?/</literal></emphasis> - 
3290  We have several literal forward slashes again (<quote>/</quote>), so we are
3291  building another expression that is a file path statement. We have another 
3292  <quote>.*</quote>, so we are matching against any conceivable sub-path, just so
3293  it matches our expression. The only true literal that <emphasis>must
3294  match</emphasis> our pattern is <application>adv</application>, together with
3295  the forward slashes. What comes after the <quote>adv</quote> string is the
3296  interesting part. 
3297 </para>
3298
3299 <para>
3300  Remember the <quote>?</quote> means the preceding expression (either a
3301  literal character or anything grouped with <quote>(...)</quote> in this case)
3302  can exist or not, since this means either zero or one match. So
3303  <quote>((er)?ts?|ertis(ing|ements?))</quote> is optional, as are the
3304  individual sub-expressions: <quote>(er)</quote>,
3305  <quote>(ing|ements?)</quote>, and the <quote>s</quote>. The <quote>|</quote>
3306  means <quote>or</quote>. We have two of those. For instance, 
3307  <quote>(ing|ements?)</quote>, can expand to match either <quote>ing</quote> 
3308  <emphasis>OR</emphasis> <quote>ements?</quote>. What is being done here, is an
3309  attempt at matching as many variations of <quote>advertisement</quote>, and 
3310  similar, as possible. So this would expand to match just <quote>adv</quote>,
3311  or <quote>advert</quote>, or <quote>adverts</quote>, or
3312  <quote>advertising</quote>, or <quote>advertisement</quote>, or
3313  <quote>advertisements</quote>. You get the idea. But it would not match 
3314  <quote>advertizements</quote> (with a <quote>z</quote>). We could fix that by
3315  changing our regular expression to: 
3316  <quote>/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/</quote>, which would then match
3317  either spelling.
3318 </para>
3319
3320 <para>
3321  <emphasis><literal>/.*/advert[0-9]+\.(gif|jpe?g)</literal></emphasis> - Again 
3322  another path statement with forward slashes. Anything in the square brackets 
3323  <quote>[]</quote> can be matched. This is using <quote>0-9</quote> as a
3324  shorthand expression to mean any digit one through nine. It is the same as
3325  saying <quote>0123456789</quote>. So any digit matches. The <quote>+</quote>
3326  means one or more of the preceding expression must be included. The preceding 
3327  expression here is what is in the square brackets -- in this case, any digit 
3328  one through nine. Then, at the end, we have a grouping: <quote>(gif|jpe?g)</quote>. 
3329  This includes a <quote>|</quote>, so this needs to match the expression on
3330  either side of that bar character also. A simple <quote>gif</quote> on one side, and the other
3331  side will in turn match either <quote>jpeg</quote> or <quote>jpg</quote>,
3332  since the <quote>?</quote> means the letter <quote>e</quote> is optional and
3333  can be matched once or not at all. So we are building an expression here to
3334  match image GIF or JPEG type image file. It must include the literal
3335  string <quote>advert</quote>, then one or more digits, and a <quote>.</quote>
3336  (which is now a literal, and not a special character, since it is escaped
3337  with <quote>\</quote>), and lastly either <quote>gif</quote>, or
3338  <quote>jpeg</quote>, or <quote>jpg</quote>. Some possible matches would
3339  include: <quote>//advert1.jpg</quote>,
3340  <quote>/nasty/ads/advert1234.gif</quote>,
3341  <quote>/banners/from/hell/advert99.jpg</quote>. It would not match
3342  <quote>advert1.gif</quote> (no leading slash), or
3343  <quote>/adverts232.jpg</quote> (the expression does not include an
3344  <quote>s</quote>), or <quote>/advert1.jsp</quote> (<quote>jsp</quote> is not
3345  in the expression anywhere).
3346 </para>
3347
3348 <para>
3349  <emphasis><literal>s/microsoft(?!.com)/MicroSuck/i</literal></emphasis> - This is 
3350  a substitution. <quote>MicroSuck</quote> will replace any occurrence of 
3351  <quote>microsoft</quote>.  The <quote>i</quote> at the end of the expression
3352  means ignore case. The <quote>(?!.com)</quote> means 
3353  the match should fail if <quote>microsoft</quote> is followed by
3354  <quote>.com</quote>. In other words, this acts like a <quote>NOT</quote>
3355  modifier. In case this is a hyperlink, we don't want to break it ;-).
3356 </para>
3357
3358 <para>
3359  We are barely scratching the surface of regular expressions here so that you
3360  can understand the default <application>Junkbuster</application>
3361  configuration files, and maybe use this knowledge to customize your own
3362  installation. There is much, much more that can be done with regular
3363  expressions. Now that you know enough to get started, you can learn more on
3364  your own :/
3365 </para>
3366
3367 <para>
3368  More reading on Perl Compatible Regular expressions: 
3369  <ulink url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>
3370 </para>
3371
3372 </sect2>
3373
3374 </sect1>
3375
3376  <!--
3377
3378  This program is free software; you can redistribute it 
3379  and/or modify it under the terms of the GNU General
3380  Public License as published by the Free Software
3381  Foundation; either version 2 of the License, or (at
3382  your option) any later version.
3383
3384  This program is distributed in the hope that it will
3385  be useful, but WITHOUT ANY WARRANTY; without even the
3386  implied warranty of MERCHANTABILITY or FITNESS FOR A
3387  PARTICULAR PURPOSE.  See the GNU General Public
3388  License for more details.
3389
3390  The GNU General Public License should be included with
3391  this file.  If not, you can view it at
3392  http://www.gnu.org/copyleft/gpl.html
3393  or write to the Free Software Foundation, Inc., 59
3394  Temple Place - Suite 330, Boston, MA  02111-1307, USA.
3395
3396  $Log: user-manual.sgml,v $
3397  Revision 1.42  2002/03/07 18:16:55  swa
3398  looks better
3399
3400  Revision 1.41  2002/03/07 16:46:43  hal9
3401  Fix a few markup problems for jade.
3402
3403  Revision 1.40  2002/03/07 16:28:39  swa
3404  provide correct feedback channels
3405
3406  Revision 1.39  2002/03/06 16:19:28  hal9
3407  Note on perceived filtering slowdown per FR.
3408
3409  Revision 1.38  2002/03/05 23:55:14  hal9
3410  Stupid I did it again. Double hyphen in comment breaks jade.
3411
3412  Revision 1.37  2002/03/05 23:53:49  hal9
3413  jade barfs on '- -' embedded in comments. - -user option broke it.
3414
3415  Revision 1.36  2002/03/05 22:53:28  hal9
3416  Add new - - user option.
3417
3418  Revision 1.35  2002/03/05 00:17:27  hal9
3419  Added section on command line options.
3420
3421  Revision 1.34  2002/03/04 19:32:07  oes
3422  Changed default port to 8118
3423
3424  Revision 1.33  2002/03/03 19:46:13  hal9
3425  Emphasis on where/how to report bugs, etc
3426
3427  Revision 1.32  2002/03/03 09:26:06  joergs
3428  AmigaOS changes, config is now loaded from PROGDIR: instead of
3429  AmiTCP:db/junkbuster/ if no configuration file is specified on the
3430  command line.
3431
3432  Revision 1.31  2002/03/02 22:45:52  david__schmidt
3433  Just tweaking
3434
3435  Revision 1.30  2002/03/02 22:00:14  hal9
3436  Updated 'New Features' list. Ran through spell-checker.
3437
3438  Revision 1.29  2002/03/02 20:34:07  david__schmidt
3439  Update OS/2 build section
3440
3441  Revision 1.28  2002/02/24 14:34:24  jongfoster
3442  Formatting changes.  Now changing the doctype to DocBook XML 4.1
3443  will work - no other changes are needed.
3444
3445  Revision 1.27  2002/01/11 14:14:32  hal9
3446  Added a very short section on Templates
3447
3448  Revision 1.26  2002/01/09 20:02:50  hal9
3449  Fix bug re: auto-detect config file changes.
3450
3451  Revision 1.25  2002/01/09 18:20:30  hal9
3452  Touch ups for *.action files.
3453
3454  Revision 1.24  2001/12/02 01:13:42  hal9
3455  Fix typo.
3456
3457  Revision 1.23  2001/12/02 00:20:41  hal9
3458  Updates for recent changes.
3459
3460  Revision 1.22  2001/11/05 23:57:51  hal9
3461  Minor update for startup now daemon mode.
3462
3463  Revision 1.21  2001/10/31 21:11:03  hal9
3464  Correct 2 minor errors
3465
3466  Revision 1.18  2001/10/24 18:45:26  hal9
3467  *** empty log message ***
3468
3469  Revision 1.17  2001/10/24 17:10:55  hal9
3470  Catching up with Jon's recent work, and a few other things.
3471
3472  Revision 1.16  2001/10/21 17:19:21  swa
3473  wrong url in documentation
3474
3475  Revision 1.15  2001/10/14 23:46:24  hal9
3476  Various minor changes. Fleshed out SEE ALSO section.
3477
3478  Revision 1.13  2001/10/10 17:28:33  hal9
3479  Very minor changes.
3480
3481  Revision 1.12  2001/09/28 02:57:04  hal9
3482  Ditto :/
3483
3484  Revision 1.11  2001/09/28 02:25:20  hal9
3485  Ditto.
3486
3487  Revision 1.9  2001/09/27 23:50:29  hal9
3488  A few changes. A short section on regular expression in appendix.
3489
3490  Revision 1.8  2001/09/25 00:34:59  hal9
3491  Some additions, and re-arranging.
3492
3493  Revision 1.7  2001/09/24 14:31:36  hal9
3494  Diddling.
3495
3496  Revision 1.6  2001/09/24 14:10:32  hal9
3497  Including David's OS/2 installation instructions.
3498
3499  Revision 1.2  2001/09/13 15:27:40  swa
3500  cosmetics
3501
3502  Revision 1.1  2001/09/12 15:36:41  swa
3503  source files for junkbuster documentation
3504
3505  Revision 1.3  2001/09/10 17:43:59  swa
3506  first proposal of a structure.
3507
3508  Revision 1.2  2001/06/13 14:28:31  swa
3509  docs should have an author.
3510
3511  Revision 1.1  2001/06/13 14:20:37  swa
3512  first import of project's documentation for the webserver.
3513
3514  -->
3515
3516 </article>