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