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