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