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