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