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