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