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