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