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