point users to the right feedback forms,
[privoxy.git] / doc / text / user-manual.txt
1
2 Junkbuster User Manual
3
4    By: Junkbuster Developers
5    
6    $Id: user-manual.sgml,v 1.32 2002/03/03 09:26:06 joergs Exp $
7    
8    The user manual gives the users information on how to install and
9    configure Internet Junkbuster. Internet Junkbuster is an application
10    that provides privacy and security to users of the World Wide Web.
11    
12    You can find the latest version of the user manual at
13    [1]http://ijbswa.sourceforge.net/user-manual/.
14    
15    Feel free to send a note to the developers at
16    <[2]ijbswa-developers@lists.sourceforge.net>.
17      _________________________________________________________________
18    
19    Table of Contents
20    1. [3]Introduction
21           
22         1.1. [4]New Features
23                 
24    2. [5]Installation
25           
26         2.1. [6]Source
27         2.2. [7]Red Hat
28         2.3. [8]SuSE
29         2.4. [9]OS/2
30         2.5. [10]Windows
31         2.6. [11]Other
32                 
33    3. [12]Junkbuster Configuration
34           
35         3.1. [13]The Main Configuration File
36         3.2. [14]The Actions File
37         3.3. [15]The Filter File
38         3.4. [16]Templates
39                 
40    4. [17]Quickstart to Using Junkbuster
41    5. [18]Contact the Developers
42    6. [19]Copyright and History
43           
44         6.1. [20]License
45         6.2. [21]History
46                 
47    7. [22]See also
48    8. [23]Appendix
49           
50         8.1. [24]Regular Expressions
51                 
52 1. Introduction
53
54    Internet Junkbuster is a web proxy with advanced filtering
55    capabilities for protecting privacy, filtering web page content,
56    managing cookies, controlling access, and removing ads, banners,
57    pop-ups and other obnoxious Internet Junk. Junkbuster has a very
58    flexible configuration and can be customized to suit individual needs
59    and tastes. Internet Junkbuster has application for both stand-alone
60    systems and multi-user networks.
61    
62    This documentation is included with the current BETA version of
63    Internet Junkbuster and is incomplete at this point. The most up to
64    date reference for the time being is still the comments in the source
65    files and in the individual configuration files. Development of
66    version 3.0 is currently nearing completion, and includes many
67    significant changes and enhancements over earlier versions. The target
68    release date for stable v3.0 RSN.
69    
70    Since this is a BETA version, not all new features are well tested.
71    This documentation may be slightly out of sync as a result. And there
72    may be bugs, though hopefully not many!
73      _________________________________________________________________
74    
75 1.1. New Features
76
77    In addition to Junkbuster's traditional features of ad and banner
78    blocking and cookie management, this is a list of new features
79    currently under development:
80    
81      * Integrated browser based configuration and control utility
82        ([25]http://i.j.b). Browser-based tracing of rule and filter
83        effects.
84      * Modularized configuration that will allow for system wide
85        settings, and individual user settings. (not implemented yet,
86        probably a 3.1 feature)
87      * Blocking of annoying pop-up browser windows.
88      * HTTP/1.1 compliant (most, but not all 1.1 features are supported).
89      * Support for Perl Compatible Regular Expressions in the
90        configuration files, and generally a more sophisticated and
91        flexible configuration syntax over previous versions.
92      * GIF de-animation.
93      * Web page content filtering (removes banners based on size,
94        invisible "web-bugs", JavaScript, pop-ups, status bar abuse, etc.)
95      * Bypass many click-tracking scripts (avoids script redirection).
96      * Multi-threaded (POSIX and native threads).
97      * Auto-detection and re-reading of config file changes.
98      * User-customizable HTML templates (e.g. 404 error page).
99      * Improved cookie management features (e.g. session based cookies).
100      * Builds from source on most UNIX-like systems. Packages available
101        for: Linux (RedHat, SuSE, or Debian), Windows, Sun Solaris, Mac
102        OSX, OS/2.
103      * In addition, the configuration is much more powerful and versatile
104        over-all.
105      _________________________________________________________________
106    
107 2. Installation
108
109    Junkbuster is available as raw source code, or pre-compiled binaries.
110    See the [26]Junkbuster Home Page for current release info. Junkbuster
111    is also available via [27]CVS. This is the recommended approach at
112    this time. But please be aware that CVS is constantly changing, and it
113    may break in mysterious ways.
114      _________________________________________________________________
115    
116 2.1. Source
117
118    For gzipped tar archives, unpack the source:
119    
120  tar xzvf ijb_source_* [.tgz or .tar.gz]
121  cd ijb_source_2.9.10_beta
122
123    For retrieving the current CVS sources, you'll need the CVS package
124    installed first. To download CVS source:
125    
126   cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
127   cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co cu
128 rrent
129   cd current
130
131    This will create a directory named current/, which will contain the
132    source tree.
133    
134    Then, in either case, to build from tarball/CVS source:
135    
136  ./configure      (--help to see options)
137  make             (the make from gnu, gmake for *BSD)
138  su
139  make -n install  (to see where all the files will go)
140  make install     (to really install)
141
142    For Redhat and SuSE Linux RPM packages, see below.
143      _________________________________________________________________
144    
145 2.2. Red Hat
146
147    To build Redhat RPM packages, install source as above. Then:
148    
149  autoheader   [suggested for CVS source]
150  autoconf     [suggested for CVS source]
151  ./configure
152  make redhat-dist
153
154    This will create both binary and src RPMs in the usual places.
155    Example:
156    
157       /usr/src/redhat/RPMS/i686/junkbuster-2.9.10-1.i686.rpm
158    
159       /usr/src/redhat/SRPMS/junkbuster-2.9.10-1.src.rpm
160    
161    To install, of course:
162    
163  rpm -Uvv /usr/src/redhat/RPMS/i686/junkbuster-2.9.10-1.i686.rpm
164
165    This will place the Junkbuster configuration files in
166    /etc/junkbuster/, and log files in /var/log/junkbuster/.
167      _________________________________________________________________
168    
169 2.3. SuSE
170
171    To build SuSE RPM packages, install source as above. Then:
172    
173  autoheader   [suggested for CVS source]
174  autoconf     [suggested for CVS source]
175  ./configure
176  make suse-dist
177
178    This will create both binary and src RPMs in the usual places.
179    Example:
180    
181       /usr/src/packages/RPMS/i686/junkbuster-2.9.10-1.i686.rpm
182    
183       /usr/src/packages/SRPMS/junkbuster-2.9.10-1.src.rpm
184    
185    To install, of course:
186    
187  rpm -Uvv /usr/src/packages/RPMS/i686/junkbuster-2.9.10-1.i686.rpm
188
189    This will place the Junkbuster configuration files in
190    /etc/junkbuster/, and log files in /var/log/junkbuster/.
191      _________________________________________________________________
192    
193 2.4. OS/2
194
195    Junkbuster is packaged in a WarpIN self- installing archive. The
196    self-installing program will be named depending on the release
197    version, something like: ijbos2_setup_1.2.3.exe. In order to install
198    it, simply run this executable or double-click on its icon and follow
199    the WarpIN installation panels. A shadow of the Junkbuster executable
200    will be placed in your startup folder so it will start automatically
201    whenever OS/2 starts.
202    
203    The directory you choose to install Junkbuster into will contain all
204    of the configuration files.
205    
206    If you would like to build binary images on OS/2 yourself, you will
207    need a few Unix-like tools: autoconf, autoheader and sh. These tools
208    will be used to create the required config.h file, which is not part
209    of the source distribution because it differs based on platform. You
210    will also need a compiler. The distribution has been created using IBM
211    VisualAge compilers, but you can use any compiler you like. GCC/EMX
212    has the disadvantage of needing to be single-threaded due to a
213    limitation of EMX's implementation of the select() socket call.
214    
215    In addition to needing the source code distribution as outlined
216    earlier, you will want to extract the os2seutp directory from CVS:
217  cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
218
219  cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co os2
220 setup
221
222    This will create a directory named os2setup/, which will contain the
223    Makefile.vac makefile and os2build.cmd which is used to completely
224    create the binary distribution. The sequence of events for building
225    the executable for yourself goes something like this:
226  cd current
227  autoheader
228  autoconf
229  sh configure
230  cd ..\os2setup
231  nmake -f Makefile.vac
232
233    You will see this sequence laid out in os2build.cmd.
234      _________________________________________________________________
235    
236 2.5. Windows
237
238    Click-click. (I need help on this. Not a clue here. Also for
239    configuration section below. HB.)
240      _________________________________________________________________
241    
242 2.6. Other
243
244    Some quick notes on other Operating Systems.
245    
246    For FreeBSD (and other *BSDs?), the build will require gmake instead
247    of the included make. gmake is available from [28]http://www.gnu.org.
248    The rest should be the same as above for Linux/Unix.
249      _________________________________________________________________
250    
251 3. Junkbuster Configuration
252
253    For Unix, *BSD and Linux, all configuration files are located in
254    /etc/junkbuster/ by default. For MS Windows, OS/2, and AmigaOS these
255    are all in the same directory as the Junkbuster executable. The name
256    and number of configuration files has changed from previous versions,
257    and is subject to change as development progresses.
258    
259    The installed defaults provide a reasonable starting point, though
260    possibly aggressive by some standards. For the time being, there are
261    only three default configuration files (this will change in time):
262    
263      * The main configuration file is named config on Linux, Unix, BSD,
264        OS/2, and AmigaOS and config.txt on Windows.
265      * The ijb.action file is used to define various "actions" relating
266        to images, banners, pop-ups, access restrictions, banners and
267        cookies. There is a CGI based editor for this file that can be
268        accessed via [29]http://i.j.b. This is the easiest method of
269        configuring actions. (Other actions files are included as well
270        with differing levels of filtering and blocking, e.g.
271        ijb-basic.action.)
272      * The re_filterfile file can be used to rewrite the raw page
273        content, including text as well as embedded HTML and JavaScript.
274        
275    ijb.action and re_filterfile can use Perl style regular expressions
276    for maximum flexibility. All files use the "#" character to denote a
277    comment. Such lines are not processed by Junkbuster. After making any
278    changes, there is no need to restart Junkbuster in order for the
279    changes to take effect. Junkbuster should detect such changes
280    automatically.
281    
282    While under development, the configuration content is subject to
283    change. The below documentation may not be accurate by the time you
284    read this. Also, what constitutes a "default" setting, may change, so
285    please check all your configuration files on important issues.
286      _________________________________________________________________
287    
288 3.1. The Main Configuration File
289
290    Again, the main configuration file is named config on Linux/Unix/BSD
291    and OS/2, and config.txt on Windows. Configuration lines consist of an
292    initial keyword followed by a list of values, all separated by
293    whitespace (any number of spaces or tabs). For example:
294    
295      blockfile blocklist.ini
296    
297    Indicates that the blockfile is named "blocklist.ini".
298    
299    A "#" indicates a comment. Any part of a line following a "#" is
300    ignored, except if the "#" is preceded by a "\".
301    
302    Thus, by placing a "#" at the start of an existing configuration line,
303    you can make it a comment and it will be treated as if it weren't
304    there. This is called "commenting out" an option and can be useful to
305    turn off features: If you comment out the "logfile" line, junkbuster
306    will not log to a file at all. Watch for the "default:" section in
307    each explanation to see what happens if the option is left unset (or
308    commented out).
309    
310    Long lines can be continued on the next line by using a "\" as the
311    very last character.
312    
313    There are various aspects of Junkbuster behavior that can be tuned.
314      _________________________________________________________________
315    
316 3.1.1. Defining Other Configuration Files
317
318    Junkbuster can use a number of other files to tell it what ads to
319    block, what cookies to accept, etc. This section of the configuration
320    file tells Junkbuster where to find all those other files.
321    
322    On Windows and AmigaOS, Junkbuster looks for these files in the same
323    directory as the executable. On Unix and OS/2, Junkbuster looks for
324    these files in the current working directory. In either case, an
325    absolute path name can be used to avoid problems.
326    
327    When development goes modular and multi-user, the blocker, filter, and
328    per-user config will be stored in subdirectories of "confdir". For
329    now, only confdir/templates is used for storing HTML templates for CGI
330    results.
331    
332    The location of the configuration files:
333    
334      confdir /etc/junkbuster       # No trailing /, please.
335    
336    The directory where all logging (i.e. logfile and jarfile) takes
337    place. No trailing "/", please:
338    
339      logdir /var/log/junkbuster
340    
341    Note that all file specifications below are relative to the above two
342    directories!
343    
344    The "ijb.action" file contains patterns to specify the actions to
345    apply to requests for each site. Default: Cookies to and from all
346    destinations are kept only during the current browser session (i.e.
347    they are not saved to disk). Pop-ups are disabled for all sites. All
348    sites are filtered if "re_filterfile" specified. No sites are blocked.
349    An empty image is displayed for filtered ads and other images
350    (formerly "tinygif"). The syntax of this file is explained in detail
351    [30]below.
352    
353      actionsfile ijb.action
354    
355    The "re_filterfile" file contains content modification rules. These
356    rules permit powerful changes on the content of Web pages, e.g., you
357    could disable your favorite JavaScript annoyances, rewrite the actual
358    content, or just have some fun replacing "Microsoft" with "MicroSuck"
359    wherever it appears on a Web page. Default: No content modification,
360    or whatever the developers are playing with :-/
361    
362      re_filterfile re_filterfile
363    
364    The logfile is where all logging and error messages are written. The
365    logfile can be useful for tracking down a problem with Junkbuster
366    (e.g., it's not blocking an ad you think it should block) but in most
367    cases you probably will never look at it.
368    
369    Your logfile will grow indefinitely, and you will probably want to
370    periodically remove it. On Unix systems, you can do this with a cron
371    job (see "man cron"). For Redhat, a logrotate script has been
372    included.
373    
374    On SuSE Linux systems, you can place a line like
375    "/var/log/junkbuster.* +1024k 644 nobody.nogroup" in /etc/logfiles,
376    with the effect that cron.daily will automatically archive, gzip, and
377    empty the log, when it exceeds 1M size.
378    
379    Default: Log to the a file named logfile. Comment out to disable
380    logging.
381    
382      logfile logfile
383    
384    The "jarfile" defines where Junkbuster stores the cookies it
385    intercepts. Note that if you use a "jarfile", it may grow quite large.
386    Default: Don't store intercepted cookies.
387    
388      #jarfile jarfile
389    
390    If you specify a "trustfile", Junkbuster will only allow access to
391    sites that are named in the trustfile. You can also mark sites as
392    trusted referrers, with the effect that access to untrusted sites will
393    be granted, if a link from a trusted referrer was used. The link
394    target will then be added to the "trustfile". This is a very
395    restrictive feature that typical users most probably want to leave
396    disabled. Default: Disabled, don't use the trust mechanism.
397    
398      #trustfile trust
399    
400    If you use the trust mechanism, it is a good idea to write up some
401    on-line documentation about your blocking policy and to specify the
402    URL(s) here. They will appear on the page that your users receive when
403    they try to access untrusted content. Use multiple times for multiple
404    URLs. Default: Don't display links on the "untrusted" info page.
405    
406      trust-info-url http://www.your-site.com/why_we_block.html
407      trust-info-url http://www.your-site.com/what_we_allow.html
408      _________________________________________________________________
409    
410 3.1.2. Other Configuration Options
411
412    This part of the configuration file contains options that control how
413    Junkbuster operates.
414    
415    "Admin-address" should be set to the email address of the proxy
416    administrator. It is used in many of the proxy-generated pages.
417    Default: fill@me.in.please.
418    
419      #admin-address fill@me.in.please
420    
421    "Proxy-info-url" can be set to a URL that contains more info about
422    this Junkbuster installation, it's configuration and policies. It is
423    used in many of the proxy-generated pages and its use is highly
424    recommended in multi-user installations, since your users will want to
425    know why certain content is blocked or modified. Default: Don't show a
426    link to on-line documentation.
427    
428      proxy-info-url http://www.your-site.com/proxy.html
429    
430    "Listen-address" specifies the address and port where Junkbuster will
431    listen for connections from your Web browser. The default is to listen
432    on the localhost port 8000, and this is suitable for most users. (In
433    your web browser, under proxy configuration, list the proxy server as
434    "localhost" and the port as "8000").
435    
436    If you already have another service running on port 8000, or if you
437    want to serve requests from other machines (e.g. on your local
438    network) as well, you will need to override the default. The syntax is
439    "listen-address [<ip-address>]:<port>". If you leave out the IP
440    address, junkbuster will bind to all interfaces (addresses) on your
441    machine and may become reachable from the Internet. In that case,
442    consider using access control lists (acl's) (see "aclfile" above), or
443    a firewall.
444    
445    For example, suppose you are running Junkbuster on a machine which has
446    the address 192.168.0.1 on your local private network (192.168.0.0)
447    and has another outside connection with a different address. You want
448    it to serve requests from inside only:
449    
450      listen-address 192.168.0.1:8000
451    
452    If you want it to listen on all addresses (including the outside
453    connection):
454    
455      listen-address :8000
456    
457    If you do this, consider using ACLs (see "aclfile" above). Note: you
458    will need to point your browser(s) to the address and port that you
459    have configured here. Default: localhost:8000 (127.0.0.1:8000).
460    
461    The debug option sets the level of debugging information to log in the
462    logfile (and to the console in the Windows version). A debug level of
463    1 is informative because it will show you each request as it happens.
464    Higher levels of debug are probably only of interest to developers.
465    
466      debug         1 # GPC   = show each GET/POST/CONNECT request
467      debug         2 # CONN  = show each connection status
468      debug         4 # IO    = show I/O status
469      debug         8 # HDR   = show header parsing
470      debug        16 # LOG   = log all data into the logfile
471      debug        32 # FRC   = debug force feature
472      debug        64 # REF   = debug regular expression filter
473      debug       128 #       = debug fast redirects
474      debug       256 #       = debug GIF de-animation
475      debug       512 # CLF   = Common Log Format
476      debug      1024 #       = debug kill pop-ups
477      debug      4096 # INFO  = Startup banner and warnings.
478      debug      8192 # ERROR = Non-fatal errors
479    
480    It is highly recommended that you enable ERROR reporting (debug 8192),
481    at least until the next stable release.
482    
483    The reporting of FATAL errors (i.e. ones which crash JunkBuster) is
484    always on and cannot be disabled.
485    
486    If you want to use CLF (Common Log Format), you should set "debug 512"
487    ONLY, do not enable anything else.
488    
489    Multiple "debug" directives, are OK - they're logical-OR'd together.
490    
491      debug 15 # same as setting the first 4 listed above
492    
493    Default:
494    
495      debug 1 # URLs
496      debug 4096 # Info
497      debug 8192 # Errors - *we highly recommended enabling this*
498    
499    Junkbuster normally uses "multi-threading", a software technique that
500    permits it to handle many different requests simultaneously. In some
501    cases you may wish to disable this -- particularly if you're trying to
502    debug a problem. The "single-threaded" option forces Junkbuster to
503    handle requests sequentially. Default: Multi-threaded mode.
504    
505      #single-threaded
506    
507    "toggle" allows you to temporarily disable all Junkbuster's filtering.
508    Just set "toggle 0".
509    
510    The Windows version of Junkbuster puts an icon in the system tray,
511    which also allows you to change this option. If you right-click on
512    that icon (or select the "Options" menu), one choice is "Enable".
513    Clicking on enable toggles Junkbuster on and off. This is useful if
514    you want to temporarily disable Junkbuster, e.g., to access a site
515    that requires cookies which you would otherwise have blocked. This can
516    also be toggled via a web browser at the Junkbuster internal address
517    of [31]http://i.j.b on any platform.
518    
519    "toggle 1" means Junkbuster runs normally, "toggle 0" means that
520    Junkbuster becomes a non-anonymizing non-blocking proxy. Default: 1
521    (on).
522    
523      toggle 1
524    
525    For content filtering, i.e. the "+filter" and "+deanimate-gif"
526    actions, it is necessary that Junkbuster buffers the entire document
527    body. This can be potentially dangerous, since a server could just
528    keep sending data indefinitely and wait for your RAM to exhaust. With
529    nasty consequences.
530    
531    The buffer-limit option lets you set the maximum size in Kbytes that
532    each buffer may use. When the documents buffer exceeds this size, it
533    is flushed to the client unfiltered and no further attempt to filter
534    the rest of it is made. Remember that there may multiple threads
535    running, which might require increasing the "buffer-limit" Kbytes
536    each, unless you have enabled "single-threaded" above.
537    
538      buffer-limit 4069
539    
540    To enable the web-based ijb.action file editor set enable-edit-actions
541    to 1, or 0 to disable. Note that you must have compiled JunkBuster
542    with support for this feature, otherwise this option has no effect.
543    This internal page can be reached at [32]http://i.j.b.
544    
545    Security note: If this is enabled, anyone who can use the proxy can
546    edit the actions file, and their changes will affect all users. For
547    shared proxies, you probably want to disable this. Default: enabled.
548    
549      enable-edit-actions 1
550    
551    Allow JunkBuster to be toggled on and off remotely, using your web
552    browser. Set "enable-remote-toggle"to 1 to enable, and 0 to disable.
553    Note that you must have compiled JunkBuster with support for this
554    feature, otherwise this option has no effect.
555    
556    Security note: If this is enabled, anyone who can use the proxy can
557    toggle it on or off (see [33]http://i.j.b), and their changes will
558    affect all users. For shared proxies, you probably want to disable
559    this. Default: enabled.
560    
561      enable-remote-toggle 1
562      _________________________________________________________________
563    
564 3.1.3. Access Control List (ACL)
565
566    Access controls are included at the request of some ISPs and systems
567    administrators, and are not usually needed by individual users. Please
568    note the warnings in the FAQ that this proxy is not intended to be a
569    substitute for a firewall or to encourage anyone to defer addressing
570    basic security weaknesses.
571    
572    If no access settings are specified, the proxy talks to anyone that
573    connects. If any access settings file are specified, then the proxy
574    talks only to IP addresses permitted somewhere in this file and not
575    denied later in this file.
576    
577    Summary -- if using an ACL:
578    
579    Client must have permission to receive service.
580    
581    LAST match in ACL wins.
582    
583    Default behavior is to deny service.
584    
585    The syntax for an entry in the Access Control List is:
586    
587      ACTION    SRC_ADDR[/SRC_MASKLEN]    [ DST_ADDR[/DST_MASKLEN] ]
588    
589    Where the individual fields are:
590    
591     ACTION      = "permit-access" or "deny-access"
592     SRC_ADDR    = client hostname or dotted IP address
593     SRC_MASKLEN = number of bits in the subnet mask for the source
594     DST_ADDR    = server or forwarder hostname or dotted IP address
595     DST_MASKLEN = number of bits in the subnet mask for the target
596    
597    The field separator (FS) is whitespace (space or tab).
598    
599    IMPORTANT NOTE: If the junkbuster is using a forwarder (see below) or
600    a gateway for a particular destination URL, the DST_ADDR that is
601    examined is the address of the forwarder or the gateway and NOT the
602    address of the ultimate target. This is necessary because it may be
603    impossible for the local Junkbuster to determine the address of the
604    ultimate target (that's often what gateways are used for).
605    
606    Here are a few examples to show how the ACL features work:
607    
608    "localhost" is OK -- no DST_ADDR implies that ALL destination
609    addresses are OK:
610    
611      permit-access localhost
612    
613    A silly example to illustrate permitting any host on the class-C
614    subnet with Junkbuster to go anywhere:
615    
616      permit-access www.junkbusters.com/24
617    
618    Except deny one particular IP address from using it at all:
619    
620      deny-access ident.junkbusters.com
621    
622    You can also specify an explicit network address and subnet mask.
623    Explicit addresses do not have to be resolved to be used.
624    
625      permit-access 207.153.200.0/24
626    
627    A subnet mask of 0 matches anything, so the next line permits
628    everyone.
629    
630      permit-access 0.0.0.0/0
631    
632    Note, you cannot say:
633    
634      permit-access .org
635    
636    to allow all *.org domains. Every IP address listed must resolve
637    fully.
638    
639    An ISP may want to provide a Junkbuster that is accessible by "the
640    world" and yet restrict use of some of their private content to hosts
641    on its internal network (i.e. its own subscribers). Say, for instance
642    the ISP owns the Class-B IP address block 123.124.0.0 (a 16 bit
643    netmask). This is how they could do it:
644    
645     permit-access 0.0.0.0/0 0.0.0.0/0   # other clients can go anywhere
646                                           # with the following exceptions
647    :
648    
649     deny-access   0.0.0.0/0   123.124.0.0/16 # block all external request
650    s for
651                                              # sites on the ISP's network
652     permit 0.0.0.0/0 www.my_isp.com        # except for the ISP's main
653                                              # web site
654     permit 123.124.0.0/16 0.0.0.0/0          # the ISP's clients can go
655                                              # anywhere
656    
657    Note that if some hostnames are listed with multiple IP addresses, the
658    primary value returned by DNS (via gethostbyname()) is used. Default:
659    Anyone can access the proxy.
660      _________________________________________________________________
661    
662 3.1.4. Forwarding
663
664    This feature allows chaining of HTTP requests via multiple proxies. It
665    can be used to better protect privacy and confidentiality when
666    accessing specific domains by routing requests to those domains to a
667    special purpose filtering proxy such as lpwa.com. Or to use a caching
668    proxy to speed up browsing.
669    
670    It can also be used in an environment with multiple networks to route
671    requests via multiple gateways allowing transparent access to multiple
672    networks without having to modify browser configurations.
673    
674    Also specified here are SOCKS proxies. Junkbuster SOCKS 4 and SOCKS
675    4A. The difference is that SOCKS 4A will resolve the target hostname
676    using DNS on the SOCKS server, not our local DNS client.
677    
678    The syntax of each line is:
679    
680     forward target_domain[:port] http_proxy_host[:port]
681     forward-socks4 target_domain[:port] socks_proxy_host[:port]
682    http_proxy_host[:port]
683     forward-socks4a target_domain[:port] socks_proxy_host[:port]
684    http_proxy_host[:port]
685    
686    If http_proxy_host is ".", then requests are not forwarded to a HTTP
687    proxy but are made directly to the web servers.
688    
689    Lines are checked in sequence, and the last match wins.
690    
691    There is an implicit line equivalent to the following, which specifies
692    that anything not finding a match on the list is to go out without
693    forwarding or gateway protocol, like so:
694    
695      forward .* . # implicit
696    
697    In the following common configuration, everything goes to Lucent's
698    LPWA, except SSL on port 443 (which it doesn't handle):
699    
700     forward .* lpwa.com:8000
701     forward :443 .
702    
703    See the FAQ for instructions on how to automate the login procedure
704    for LPWA. Some users have reported difficulties related to LPWA's use
705    of "." as the last element of the domain, and have said that this can
706    be fixed with this:
707    
708      forward lpwa. lpwa.com:8000
709    
710    (NOTE: the syntax for specifying target_domain has changed since the
711    previous paragraph was written -- it will not work now. More
712    information is welcome.)
713    
714    In this fictitious example, everything goes via an ISP's caching
715    proxy, except requests to that ISP:
716    
717     forward .* caching.myisp.net:8000
718     forward myisp.net .
719    
720    For the @home network, we're told the forwarding configuration is
721    this:
722    
723      forward .* proxy:8080
724    
725    Also, we're told they insist on getting cookies and JavaScript, so you
726    should add home.com to the cookie file. We consider JavaScript a
727    security risk. Java need not be enabled.
728    
729    In this example direct connections are made to all "internal" domains,
730    but everything else goes through Lucent's LPWA by way of the company's
731    SOCKS gateway to the Internet.
732    
733     forward-socks4 .* lpwa.com:8000 firewall.my_company.com:1080
734     forward my_company.com .
735    
736    This is how you could set up a site that always uses SOCKS but no
737    forwarders:
738    
739      forward-socks4a .* . firewall.my_company.com:1080
740    
741    An advanced example for network administrators:
742    
743    If you have links to multiple ISPs that provide various special
744    content to their subscribers, you can configure forwarding to pass
745    requests to the specific host that's connected to that ISP so that
746    everybody can see all of the content on all of the ISPs.
747    
748    This is a bit tricky, but here's an example:
749    
750    host-a has a PPP connection to isp-a.com. And host-b has a PPP
751    connection to isp-b.com. host-a can run a Junkbuster proxy with
752    forwarding like this:
753    
754     forward .* .
755     forward isp-b.com host-b:8000
756    
757    host-b can run a Junkbuster proxy with forwarding like this:
758    
759     forward .* .
760     forward isp-a.com host-a:8000
761    
762    Now, anyone on the Internet (including users on host-a and host-b) can
763    set their browser's proxy to either host-a or host-b and be able to
764    browse the content on isp-a or isp-b.
765    
766    Here's another practical example, for University of Kent at Canterbury
767    students with a network connection in their room, who need to use the
768    University's Squid web cache.
769    
770     forward *. ssbcache.ukc.ac.uk:3128  # Use the proxy, except for:
771     forward .ukc.ac.uk .  # Anything on the same domain as us
772     forward * .  # Host with no domain specified
773     forward 129.12.*.* .  # A dotted IP on our /16 network.
774     forward 127.*.*.* .  # Loopback address
775     forward localhost.localdomain .  # Loopback address
776     forward www.ukc.mirror.ac.uk .  # Specific host
777    
778    If you intend to chain Junkbuster and squid locally, then chain as
779    browser -> squid -> junkbuster is the recommended way.
780    
781    Your squid configuration could then look like this:
782    
783      # Define junkbuster as parent cache
784    
785      cache_peer 127.0.0.1 parent 8000 0 no-query
786    
787      # Define ACL for protocol FTP
788      acl FTP proto FTP
789      # Do not forward ACL FTP to junkbuster
790      always_direct allow FTP
791      # Do not forward ACL CONNECT (https) to junkbuster
792      always_direct allow CONNECT
793      # Forward the rest to junkbuster
794      never_direct allow all
795      _________________________________________________________________
796    
797 3.1.5. Windows GUI Options
798
799    Junkbuster has a number of options specific to the Windows GUI
800    interface:
801    
802    If "activity-animation" is set to 1, the Junkbuster icon will animate
803    when "Junkbuster" is active. To turn off, set to 0.
804    
805      activity-animation 1
806    
807    If "log-messages" is set to 1, Junkbuster will log messages to the
808    console window:
809    
810      log-messages 1
811    
812    If "log-buffer-size" is set to 1, the size of the log buffer, i.e. the
813    amount of memory used for the log messages displayed in the console
814    window, will be limited to "log-max-lines" (see below).
815    
816    Warning: Setting this to 0 will result in the buffer to grow
817    infinitely and eat up all your memory!
818    
819      log-buffer-size 1
820    
821    log-max-lines is the maximum number of lines held in the log buffer.
822    See above.
823    
824      log-max-lines 200
825    
826    If "log-highlight-messages" is set to 1, Junkbuster will highlight
827    portions of the log messages with a bold-faced font:
828    
829      log-highlight-messages 1
830    
831    The font used in the console window:
832    
833      log-font-name Comic Sans MS
834    
835    Font size used in the console window:
836    
837      log-font-size 8
838    
839    "show-on-task-bar" controls whether or not Junkbuster will appear as a
840    button on the Task bar when minimized:
841    
842      show-on-task-bar 0
843    
844    If "close-button-minimizes" is set to 1, the Windows close button will
845    minimize Junkbuster instead of closing the program (close with the
846    exit option on the File menu).
847    
848      close-button-minimizes 1
849    
850    The "hide-console" option is specific to the MS-Win console version of
851    JunkBuster. If this option is used, Junkbuster will disconnect from
852    and hide the command console.
853    
854      #hide-console
855      _________________________________________________________________
856    
857 3.2. The Actions File
858
859    The "ijb.action" file (formerly actionsfile) is used to define what
860    actions Junkbuster takes, and thus determines how images, cookies and
861    various other aspects of HTTP content and transactions are handled.
862    Images can be anything you want, including ads, banners, or just some
863    obnoxious image that you would rather not see. Cookies can be accepted
864    or rejected, or accepted only during the current browser session (i.e.
865    not written to disk). Changes to ijb.action should be immediately
866    visible to Junkbuster without the need to restart.
867    
868    To determine which actions apply to a request, the URL of the request
869    is compared to all patterns in this file. Every time it matches, the
870    list of applicable actions for the URL is incrementally updated. You
871    can trace this process by visiting [34]http://i.j.b/show-url-info.
872    
873    The actions file can be edited with a browser by loading
874    [35]http://i.j.b/, and then select "Edit Actions".
875    
876    There are four types of lines in this file: comments (begin with a "#"
877    character), actions, aliases and patterns, all of which are explained
878    below, as well as the configuration file syntax that Junkbuster
879    understands.
880      _________________________________________________________________
881    
882 3.2.1. URL Domain and Path Syntax
883
884    Generally, a pattern has the form <domain>/<path>, where both the
885    <domain> and <path> part are optional. If you only specify a domain
886    part, the "/" can be left out:
887    
888    www.example.com - is a domain only pattern and will match any request
889    to "www.example.com".
890    
891    www.example.com/ - means exactly the same.
892    
893    www.example.com/index.html - matches only the single document
894    "/index.html" on "www.example.com".
895    
896    /index.html - matches the document "/index.html", regardless of the
897    domain.
898    
899    index.html - matches nothing, since it would be interpreted as a
900    domain name and there is no top-level domain called ".html".
901    
902    The matching of the domain part offers some flexible options: if the
903    domain starts or ends with a dot, it becomes unanchored at that end.
904    For example:
905    
906    .example.com - matches any domain that ENDS in ".example.com".
907    
908    www. - matches any domain that STARTS with "www".
909    
910    Additionally, there are wild-cards that you can use in the domain
911    names themselves. They work pretty similar to shell wild-cards: "*"
912    stands for zero or more arbitrary characters, "?" stands for any
913    single character. And you can define character classes in square
914    brackets and they can be freely mixed:
915    
916    ad*.example.com - matches "adserver.example.com", "ads.example.com",
917    etc but not "sfads.example.com".
918    
919    *ad*.example.com - matches all of the above, and then some.
920    
921    .?pix.com - matches "www.ipix.com", "pictures.epix.com",
922    "a.b.c.d.e.upix.com", etc.
923    
924    www[1-9a-ez].example.com - matches "www1.example.com",
925    "www4.example.com", "wwwd.example.com", "wwwz.example.com", etc., but
926    not "wwww.example.com".
927    
928    If Junkbuster was compiled with "pcre" support (default), Perl
929    compatible regular expressions can be used. See the pcre/docs/
930    directory or "man perlre" (also available on
931    [36]http://www.perldoc.com/perl5.6/pod/perlre.html) for details. A
932    brief discussion of regular expressions is in the [37]Appendix. For
933    instance:
934    
935    /.*/advert[0-9]+\.jpe?g - would match a URL from any domain, with any
936    path that includes "advert" followed immediately by one or more
937    digits, then a "." and ending in either "jpeg" or "jpg". So we match
938    "example.com/ads/advert2.jpg", and
939    "www.example.com/ads/banners/advert39.jpeg", but not
940    "www.example.com/ads/banners/advert39.gif" (no gifs in the example
941    pattern).
942    
943    Please note that matching in the path is case INSENSITIVE by default,
944    but you can switch to case sensitive at any point in the pattern by
945    using the "(?-i)" switch:
946    
947    www.example.com/(?-i)PaTtErN.* - will match only documents whose path
948    starts with "PaTtErN" in exactly this capitalization.
949      _________________________________________________________________
950    
951 3.2.2. Actions
952
953    Actions are enabled if preceded with a "+", and disabled if preceded
954    with a "-". Actions are invoked by enclosing the action name in curly
955    braces (e.g. {+some_action}), followed by a list of URLs to which the
956    action applies. There are three classes of actions:
957    
958      * Boolean (e.g. "+/-block"):
959          {+name}        # enable this action
960          {-name}        # disable this action
961        
962      * parameterized (e.g. "+/-hide-user-agent"):
963          {+name{param}}  # enable action and set parameter to "param"
964          {-name}         # disable action
965        
966      * Multi-value (e.g. "{+/-add-header{Name: value}}",
967        "{+/-wafer{name=value}}"):
968          {+name{param}}   # enable action and add parameter "param"
969          {-name{param}}   # remove the parameter "param"
970          {-name}          # disable this action totally
971        
972    If nothing is specified in this file, no "actions" are taken. So in
973    this case JunkBuster would just be a normal, non-blocking,
974    non-anonymizing proxy. You must specifically enable the privacy and
975    blocking features you need (although the provided default ijb.action
976    file will give a good starting point).
977    
978    Later defined actions always over-ride earlier ones. For multi-valued
979    actions, the actions are applied in the order they are specified.
980    
981    The list of valid Junkbuster "actions" are:
982    
983      * Add the specified HTTP header, which is not checked for validity.
984        You may specify this many times to specify many different headers:
985          +add-header{Name: value}
986        
987      * Block this URL totally.
988          +block
989        
990      * De-animate all animated GIF images, i.e. reduce them to their last
991        frame. This will also shrink the images considerably (in bytes,
992        not pixels!). If the option "first" is given, the first frame of
993        the animation is used as the replacement. If "last" is given, the
994        last frame of the animation is used instead, which probably makes
995        more sense for most banner animations, but also has the risk of
996        not showing the entire last frame (if it is only a delta to an
997        earlier frame).
998          +deanimate-gifs{last}
999          +deanimate-gifs{first}
1000        
1001      * "+downgrade" will downgrade HTTP/1.1 client requests to HTTP/1.0
1002        and downgrade the responses as well. Use this action for servers
1003        that use HTTP/1.1 protocol features that Junkbuster doesn't handle
1004        well yet. HTTP/1.1 is only partially implemented. Default is not
1005        to downgrade requests.
1006          +downgrade
1007        
1008      * Many sites, like yahoo.com, don't just link to other sites.
1009        Instead, they will link to some script on their own server, giving
1010        the destination as a parameter, which will then redirect you to
1011        the final target. URLs resulting from this scheme typically look
1012        like: http://some.place/some_script?http://some.where-else.
1013        Sometimes, there are even multiple consecutive redirects encoded
1014        in the URL. These redirections via scripts make your web browsing
1015        more traceable, since the server from which you follow such a link
1016        can see where you go to. Apart from that, valuable bandwidth and
1017        time is wasted, while your browser ask the server for one redirect
1018        after the other. Plus, it feeds the advertisers.
1019        The "+fast-redirects" option enables interception of these
1020        requests by Junkbuster, who will cut off all but the last valid
1021        URL in the request and send a local redirect back to your browser
1022        without contacting the remote site.
1023          +fast-redirects
1024        
1025      * Filter the website through the re_filterfile:
1026         +filter{filename}
1027        
1028      * Block any existing X-Forwarded-for header, and do not add a new
1029        one:
1030          +hide-forwarded
1031        
1032      * If the browser sends a "From:" header containing your e-mail
1033        address, this either completely removes the header ("block"), or
1034        changes it to the specified e-mail address.
1035          +hide-from{block}
1036          +hide-from{spam@sittingduck.xqq}
1037        
1038      * Don't send the "Referer:" (sic) header to the web site. You can
1039        block it, forge a URL to the same server as the request (which is
1040        preferred because some sites will not send images otherwise) or
1041        set it to a constant string of your choice.
1042          +hide-referer{block}
1043          +hide-referer{forge}
1044          +hide-referer{http://nowhere.com}
1045        
1046      * Alternative spelling of "+hide-referer". It has the same
1047        parameters, and can be freely mixed with, "+hide-referer".
1048        ("referrer" is the correct English spelling, however the HTTP
1049        specification has a bug - it requires it to be spelled "referer".)
1050          +hide-referrer{...}
1051        
1052      * Change the "User-Agent:" header so web servers can't tell your
1053        browser type. Warning! This breaks many web sites. Specify the
1054        user-agent value you want. Example, pretend to be using Netscape
1055        on Linux:
1056          +hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}
1057        
1058      * Treat this URL as an image. This only matters if it's also
1059        "+block"ed, in which case a "blocked" image can be sent rather
1060        than a HTML page. See "+image-blocker{}" below for the control
1061        over what is actually sent.
1062          +image
1063        
1064      * Decides what to do with URLs that end up tagged with "{+block
1065        +image}". There are 4 options. "-image-blocker" will send a HTML
1066        "blocked" page, usually resulting in a "broken image" icon.
1067        "+image-blocker{logo}" will send a "JunkBuster" image.
1068        "+image-blocker{blank}" will send a 1x1 transparent GIF image. And
1069        finally, "+image-blocker{http://xyz.com}" will send a HTTP
1070        temporary redirect to the specified image. This has the advantage
1071        of the icon being being cached by the browser, which will speed up
1072        the display.
1073          +image-blocker{logo}
1074          +image-blocker{blank}
1075          +image-blocker{http://i.j.b/send-banner}
1076        
1077      * By default (i.e. in the absence of a "+limit-connect" action),
1078        Junkbuster will only allow CONNECT requests to port 443, which is
1079        the standard port for https as a precaution.
1080        The CONNECT methods exists in HTTP to allow access to secure
1081        websites (https:// URLs) through proxies. It works very simply:
1082        the proxy connects to the server on the specified port, and then
1083        short-circuits its connections to the client and to the remote
1084        proxy. This can be a big security hole, since CONNECT-enabled
1085        proxies can be abused as TCP relays very easily.
1086        If you want to allow CONNECT for more ports than this, or want to
1087        forbid CONNECT altogether, you can specify a comma separated list
1088        of ports and port ranges (the latter using dashes, with the
1089        minimum defaulting to 0 and max to 65K):
1090          +limit-connect{443} # This is the default and need no be
1091        specified.
1092          +limit-connect{80,443} # Ports 80 and 443 are OK.
1093          +limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to
1094        100
1095           #and above 500 are OK.
1096        
1097      * "+no-compression" prevents the website from compressing the data.
1098        Some websites do this, which can be a problem for Junkbuster,
1099        since "+filter", "+no-popup" and "+gif-deanimate" will not work on
1100        compressed data. This will slow down connections to those
1101        websites, though. Default is "nocompression" is turned on.
1102          +nocompression
1103        
1104      * If the website sets cookies, "no-cookies-keep" will make sure they
1105        are erased when you exit and restart your web browser. This makes
1106        profiling cookies useless, but won't break sites which require
1107        cookies so that you can log in for transactions. Default: on.
1108          +no-cookies-keep
1109        
1110      * Prevent the website from reading cookies:
1111          +no-cookies-read
1112        
1113      * Prevent the website from setting cookies:
1114          +no-cookies-set
1115        
1116      * Filter the website through a built-in filter to disable those
1117        obnoxious JavaScript pop-up windows via window.open(), etc. The
1118        two alternative spellings are equivalent.
1119          +no-popup
1120          +no-popups
1121        
1122      * This action only applies if you are using a jarfile for saving
1123        cookies. It sends a cookie to every site stating that you do not
1124        accept any copyright on cookies sent to you, and asking them not
1125        to track you. Of course, this is a (relatively) unique header they
1126        could use to track you.
1127          +vanilla-wafer
1128        
1129      * This allows you to add an arbitrary cookie. It can be specified
1130        multiple times in order to add as many cookies as you like.
1131          +wafer{name=value}
1132        
1133    The meaning of any of the above is reversed by preceding the action
1134    with a "-", in place of the "+".
1135    
1136    Some examples:
1137    
1138    Turn off cookies by default, then allow a few through for specified
1139    sites:
1140    
1141     # Turn off all persistent cookies
1142     { +no-cookies-read }
1143     { +no-cookies-set }
1144     # Allow cookies for this browser session ONLY
1145     { +no-cookies-keep }
1146     # Exceptions to the above, sites that benefit from persistent cookies
1147     { -no-cookies-read }
1148     { -no-cookies-set }
1149     { -no-cookies-keep }
1150     .javasoft.com
1151     .sun.com
1152     .yahoo.com
1153     .msdn.microsoft.com
1154     .redhat.com
1155     # Alternative way of saying the same thing
1156     {-no-cookies-set -no-cookies-read -no-cookies-keep}
1157     .sourceforge.net
1158     .sf.net
1159    
1160    Now turn off "fast redirects", and then we allow two exceptions:
1161    
1162     # Turn them off!
1163     {+fast-redirects}
1164    
1165     # Reverse it for these two sites, which don't work right without it.
1166     {-fast-redirects}
1167     www.ukc.ac.uk/cgi-bin/wac\.cgi\?
1168     login.yahoo.com
1169    
1170    Turn on page filtering, with one exception for sourceforge:
1171    
1172     # Run everything through the default filter file (re_filterfile):
1173     {+filter}
1174    
1175     # But please don't re_filter code from sourceforge!
1176     {-filter}
1177     .cvs.sourceforge.net
1178    
1179    Now some URLs that we want "blocked", ie we won't see them. Many of
1180    these use regular expressions that will expand to match multiple URLs:
1181    
1182      # Blocklist:
1183      {+block}
1184      /.*/(.*[-_.])?ads?[0-9]?(/|[-_.].*|\.(gif|jpe?g))
1185      /.*/(.*[-_.])?count(er)?(\.cgi|\.dll|\.exe|[?/])
1186      /.*/(ng)?adclient\.cgi
1187      /.*/(plain|live|rotate)[-_.]?ads?/
1188      /.*/(sponsor)s?[0-9]?/
1189      /.*/_?(plain|live)?ads?(-banners)?/
1190      /.*/abanners/
1191      /.*/ad(sdna_image|gifs?)/
1192      /.*/ad(server|stream|juggler)\.(cgi|pl|dll|exe)
1193      /.*/adbanners/
1194      /.*/adserver
1195      /.*/adstream\.cgi
1196      /.*/adv((er)?ts?|ertis(ing|ements?))?/
1197      /.*/banner_?ads/
1198      /.*/banners?/
1199      /.*/banners?\.cgi/
1200      /.*/cgi-bin/centralad/getimage
1201      /.*/images/addver\.gif
1202      /.*/images/marketing/.*\.(gif|jpe?g)
1203      /.*/popupads/
1204      /.*/siteads/
1205      /.*/sponsor.*\.gif
1206      /.*/sponsors?[0-9]?/
1207      /.*/advert[0-9]+\.jpg
1208      /Media/Images/Adds/
1209      /ad_images/
1210      /adimages/
1211      /.*/ads/
1212      /bannerfarm/
1213      /grafikk/annonse/
1214      /graphics/defaultAd/
1215      /image\.ng/AdType
1216      /image\.ng/transactionID
1217      /images/.*/.*_anim\.gif # alvin brattli
1218      /ip_img/.*\.(gif|jpe?g)
1219      /rotateads/
1220      /rotations/
1221      /worldnet/ad\.cgi
1222      /cgi-bin/nph-adclick.exe/
1223      /.*/Image/BannerAdvertising/
1224      /.*/ad-bin/
1225      /.*/adlib/server\.cgi
1226      /autoads/
1227      _________________________________________________________________
1228    
1229 3.2.3. Aliases
1230
1231    Custom "actions", known to Junkbuster as "aliases", can be defined by
1232    combining other "actions". These can in turn be invoked just like the
1233    built-in "actions". Currently, an alias can contain any character
1234    except space, tab, "=", "{" or "}". But please use only "a"- "z",
1235    "0"-"9", "+", and "-". Alias names are not case sensitive, and must be
1236    defined before anything else in the ijb.actionfile ! And there can
1237    only be one set of "aliases" defined.
1238    
1239    Now let's define a few aliases:
1240    
1241     # Useful customer aliases we can use later. These must come first!
1242     {{alias}}
1243     +no-cookies = +no-cookies-set +no-cookies-read
1244     -no-cookies = -no-cookies-set -no-cookies-read
1245     fragile     = -block -no-cookies -filter -fast-redirects -hide-refere
1246    r -no-popups
1247     shop        = -no-cookies -filter -fast-redirects
1248     +imageblock = +block +image
1249     #For people who don't like to type too much:  ;-)
1250     c0 = +no-cookies
1251     c1 = -no-cookies
1252     c2 = -no-cookies-set +no-cookies-read
1253     c3 = +no-cookies-set -no-cookies-read
1254     #... etc.  Customize to your heart's content.
1255    
1256    Some examples using our "shop" and "fragile" aliases from above:
1257    
1258     # These sites are very complex and require
1259     # minimal interference.
1260     {fragile}
1261     .office.microsoft.com
1262     .windowsupdate.microsoft.com
1263     .nytimes.com
1264     # Shopping sites - still want to block ads.
1265     {shop}
1266     .quietpc.com
1267     .worldpay.com   # for quietpc.com
1268     .jungle.com
1269     .scan.co.uk
1270     # These shops require pop-ups
1271     {shop -no-popups}
1272     .dabs.com
1273     .overclockers.co.uk
1274      _________________________________________________________________
1275    
1276 3.3. The Filter File
1277
1278    The filter file defines what filtering of web pages Junkbuster does.
1279    The default filter file is re_filterfile, located in the config
1280    directory. In this file, any document content, whether viewable text
1281    or embedded non-visible content, can be changed.
1282    
1283    This file uses regular expressions to alter or remove any string in
1284    the target page. Some examples from the included default
1285    re_filterfile:
1286    
1287    Stop web pages from displaying annoying messages in the status bar by
1288    deleting such references:
1289    
1290     # The status bar is for displaying link targets, not pointless buzzwo
1291    rds.
1292     # Again, check it out on http://www.airport-cgn.de/.
1293     s/status='.*?';*//ig
1294    
1295    Just for kicks, replace any occurrence of "Microsoft" with
1296    "MicroSuck":
1297    
1298     s/microsoft(?!.com)/MicroSuck/ig
1299    
1300    Kill those auto-refresh tags:
1301    
1302     # Kill refresh tags. I like to refresh myself. Manually.
1303     # check it out on http://www.airport-cgn.de/ and go to the arrivals p
1304    age.
1305     #
1306     s/<meta[^>]*http-equiv[^>]*refresh.*URL=([^>]*?)"?>/<link rev="x-refr
1307    esh" href=$1>/i
1308     s/<meta[^>]*http-equiv="?page-enter"?[^>]*content=[^>]*>/<!--no page
1309    enter for me-->/i
1310      _________________________________________________________________
1311    
1312 3.4. Templates
1313
1314    When Junkbuster displays one of its internal pages, such as a 404 Not
1315    Found error page, it uses the appropriate template. On Linux, BSD, and
1316    Unix, these are locate in /etc/junkbuster/templates by default. These
1317    may be customized, if desired.
1318      _________________________________________________________________
1319    
1320 4. Quickstart to Using Junkbuster
1321
1322    Install package, then run and enjoy! JunkBuster accepts only one
1323    command line option -- the configuration file to be used. Example Unix
1324    startup command:
1325    
1326
1327  # /usr/sbin/junkbuster /etc/junkbuster/config
1328
1329
1330    An init script is provided for SuSE and Redhat.
1331    
1332    For for SuSE: /etc/rc.d/junkbuster start
1333    
1334    For RedHat: /etc/rc.d/init.d/junkbuster start
1335    
1336    If no configuration file is specified on the command line, Junkbuster
1337    will look for a file named config in the current directory. Except on
1338    Win32 where it will try config.txt. If no file is specified on the
1339    command line and no default configuration file can be found,
1340    Junkbuster will fail to start.
1341    
1342    Be sure your browser is set to use the proxy which is by default at
1343    localhost, port 8000. With Netscape (and Mozilla), this can be set
1344    under Edit -> Preferences -> Advanced -> Proxies -> HTTP Proxy. For
1345    Internet Explorer: Tools > Internet Properties -> Connections -> LAN
1346    Setting. Then, check "Use Proxy" and fill in the appropriate info
1347    (Address: localhost, Port: 8000). Include if HTTPS proxy support too.
1348    
1349    The included default configuration files should give a reasonable
1350    starting point, though may be somewhat aggressive in blocking junk.
1351    You will probably want to keep an eye out for sites that require
1352    persistent cookies, and add these to ijb.action as needed. By default,
1353    most of these will be accepted only during the current browser
1354    session, until you add them to the configuration. If you want the
1355    browser to handle this instead, you will need to edit ijb.action and
1356    disable this feature. If you use more than one browser, it would make
1357    more sense to let Junkbuster handle this. In which case, the
1358    browser(s) should be set to accept all cookies.
1359    
1360    If a particular site shows problems loading properly, try adding it to
1361    the {fragile} section of ijb.action. This will turn off most actions
1362    for this site.
1363    
1364    HTTP/1.1 support is not fully implemented. If browsers that support
1365    HTTP/1.1 (like Mozilla or recent versions of I.E.) experience
1366    problems, you might try to force HTTP/1.0 compatibility. For Mozilla,
1367    look under Edit -> Preferences -> Debug -> Networking. Or set the
1368    "+downgrade" config option in ijb.action.
1369    
1370    After running Junkbuster for a while, you can start to fine tune the
1371    configuration to suit your personal, or site, preferences and
1372    requirements. There are many, many aspects that can be customized.
1373    "Actions" (as specified in ijb.action) can be adjusted by pointing
1374    your browser to [38]http://i.j.b/, and then follow the link to "edit
1375    the actions list". (This is an internal page and does not require
1376    Internet access.)
1377    
1378    In fact, various aspects of Junkbuster configuration can be viewed
1379    from this page, including current configuration parameters, source
1380    code version numbers, the browser's request headers, and "actions"
1381    that apply to a given URL. In addition to the ijb.action file editor
1382    mentioned above, Junkbuster can also be turned "on" and "off" from
1383    this page.
1384    
1385    If you encounter problems, please verify it is a Junkbuster bug, by
1386    disabling Junkbuster, and then trying the same page. Also, try another
1387    browser if possible to eliminate browser or site problems. Before
1388    reporting it as a bug, see if there is not a configuration option that
1389    is enabled that is causing the page not to load. You can then add an
1390    exception for that page or site. If a bug, please report it to the
1391    developers (see below).
1392      _________________________________________________________________
1393    
1394 5. Contact the Developers
1395
1396    Feature requests and other questions should be posted to the
1397    [39]Feature request page at SourceForge. There is also an archive
1398    there.
1399    
1400    Anyone interested in actively participating in development and related
1401    discussions can join the appropriate mailing list [40]here. Archives
1402    are available here too.
1403    
1404    Please report bugs, using the form at [41]Sourceforge. Please try to
1405    verify that it is a Junkbuster bug, and not a browser or site bug
1406    first. Also, check to make sure this is not already a known bug.
1407      _________________________________________________________________
1408    
1409 6. Copyright and History
1410
1411 6.1. License
1412
1413    Internet Junkbuster is free software; you can redistribute it and/or
1414    modify it under the terms of the GNU General Public License as
1415    published by the Free Software Foundation; either version 2 of the
1416    License, or (at your option) any later version.
1417    
1418    This program is distributed in the hope that it will be useful, but
1419    WITHOUT ANY WARRANTY; without even the implied warranty of
1420    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1421    General Public License for more details, which is available from
1422    [42]the Free Software Foundation, Inc, 59 Temple Place - Suite 330,
1423    Boston, MA 02111-1307, USA.
1424      _________________________________________________________________
1425    
1426 6.2. History
1427
1428    Junkbuster was originally written by Anonymous Coders and
1429    [43]Junkbuster's Corporation, and was released as free open-source
1430    software under the GNU GPL. [44]Stefan Waldherr made many
1431    improvements, and started the [45]SourceForge project to rekindle
1432    development. The last stable release was v2.0.2, which has now grown
1433    whiskers ;-).
1434      _________________________________________________________________
1435    
1436 7. See also
1437
1438      [46]http://sourceforge.net/projects/ijbswa
1439    
1440      [47]http://ijbswa.sourceforge.net/
1441    
1442      [48]http://i.j.b/
1443    
1444      [49]http://www.junkbusters.com/ht/en/cookies.html
1445    
1446      [50]http://www.waldherr.org/junkbuster/
1447    
1448      [51]http://privacy.net/analyze/
1449    
1450     [52]http://www.squid-cache.org/
1451      _________________________________________________________________
1452    
1453 8. Appendix
1454
1455 8.1. Regular Expressions
1456
1457    Junkbuster can use "regular expressions" in various config files.
1458    Assuming support for "pcre" (Perl Compatible Regular Expressions) is
1459    compiled in, which is the default. Such configuration directives do
1460    not require regular expressions, but they can be used to increase
1461    flexibility by matching a pattern with wild-cards against URLs.
1462    
1463    If you are reading this, you probably don't understand what "regular
1464    expressions" are, or what they can do. So this will be a very brief
1465    introduction only. A full explanation would require a book ;-)
1466    
1467    "Regular expressions" is a way of matching one character expression
1468    against another to see if it matches or not. One of the "expressions"
1469    is a literal string of readable characters (letter, numbers, etc), and
1470    the other is a complex string of literal characters combined with
1471    wild-cards, and other special characters, called meta-characters. The
1472    "meta-characters" have special meanings and are used to build the
1473    complex pattern to be matched against. Perl Compatible Regular
1474    Expressions is an enhanced form of the regular expression language
1475    with backward compatibility.
1476    
1477    To make a simple analogy, we do something similar when we use
1478    wild-card characters when listing files with the dir command in DOS.
1479    *.* matches all filenames. The "special" character here is the
1480    asterisk which matches any and all characters. We can be more specific
1481    and use ? to match just individual characters. So "dir file?.text"
1482    would match "file1.txt", "file2.txt", etc. We are pattern matching,
1483    using a similar technique to "regular expressions"!
1484    
1485    Regular expressions do essentially the same thing, but are much, much
1486    more powerful. There are many more "special characters" and ways of
1487    building complex patterns however. Let's look at a few of the common
1488    ones, and then some examples:
1489    
1490    . - Matches any single character, e.g. "a", "A", "4", ":", or "@".
1491    
1492    ? - The preceding character or expression is matched ZERO or ONE
1493    times. Either/or.
1494    
1495    + - The preceding character or expression is matched ONE or MORE
1496    times.
1497    
1498    * - The preceding character or expression is matched ZERO or MORE
1499    times.
1500    
1501    \ - The "escape" character denotes that the following character should
1502    be taken literally. This is used where one of the special characters
1503    (e.g. ".") needs to be taken literally and not as a special
1504    meta-character.
1505    
1506    [] - Characters enclosed in brackets will be matched if any of the
1507    enclosed characters are encountered.
1508    
1509    () - parentheses are used to group a sub-expression, or multiple
1510    sub-expressions.
1511    
1512    | - The "bar" character works like an "or" conditional statement. A
1513    match is successful if the sub-expression on either side of "|"
1514    matches.
1515    
1516    s/string1/string2/g - This is used to rewrite strings of text.
1517    "string1" is replaced by "string2" in this example.
1518    
1519    These are just some of the ones you are likely to use when matching
1520    URLs with Junkbuster, and is a long way from a definitive list. This
1521    is enough to get us started with a few simple examples which may be
1522    more illuminating:
1523    
1524    /.*/banners/.* - A simple example that uses the common combination of
1525    "." and "*" to denote any character, zero or more times. In other
1526    words, any string at all. So we start with a literal forward slash,
1527    then our regular expression pattern (".*") another literal forward
1528    slash, the string "banners", another forward slash, and lastly another
1529    ".*". We are building a directory path here. This will match any file
1530    with the path that has a directory named "banners" in it. The ".*"
1531    matches any characters, and this could conceivably be more forward
1532    slashes, so it might expand into a much longer looking path. For
1533    example, this could match:
1534    "/eye/hate/spammers/banners/annoy_me_please.gif", or just
1535    "/banners/annoying.html", or almost an infinite number of other
1536    possible combinations, just so it has "banners" in the path somewhere.
1537    
1538    A now something a little more complex:
1539    
1540    /.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have several literal
1541    forward slashes again ("/"), so we are building another expression
1542    that is a file path statement. We have another ".*", so we are
1543    matching against any conceivable sub-path, just so it matches our
1544    expression. The only true literal that must match our pattern is adv,
1545    together with the forward slashes. What comes after the "adv" string
1546    is the interesting part.
1547    
1548    Remember the "?" means the preceding expression (either a literal
1549    character or anything grouped with "(...)" in this case) can exist or
1550    not, since this means either zero or one match. So
1551    "((er)?ts?|ertis(ing|ements?))" is optional, as are the individual
1552    sub-expressions: "(er)", "(ing|ements?)", and the "s". The "|" means
1553    "or". We have two of those. For instance, "(ing|ements?)", can expand
1554    to match either "ing" OR "ements?". What is being done here, is an
1555    attempt at matching as many variations of "advertisement", and
1556    similar, as possible. So this would expand to match just "adv", or
1557    "advert", or "adverts", or "advertising", or "advertisement", or
1558    "advertisements". You get the idea. But it would not match
1559    "advertizements" (with a "z"). We could fix that by changing our
1560    regular expression to: "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/",
1561    which would then match either spelling.
1562    
1563    /.*/advert[0-9]+\.(gif|jpe?g) - Again another path statement with
1564    forward slashes. Anything in the square brackets "[]" can be matched.
1565    This is using "0-9" as a shorthand expression to mean any digit one
1566    through nine. It is the same as saying "0123456789". So any digit
1567    matches. The "+" means one or more of the preceding expression must be
1568    included. The preceding expression here is what is in the square
1569    brackets -- in this case, any digit one through nine. Then, at the
1570    end, we have a grouping: "(gif|jpe?g)". This includes a "|", so this
1571    needs to match the expression on either side of that bar character
1572    also. A simple "gif" on one side, and the other side will in turn
1573    match either "jpeg" or "jpg", since the "?" means the letter "e" is
1574    optional and can be matched once or not at all. So we are building an
1575    expression here to match image GIF or JPEG type image file. It must
1576    include the literal string "advert", then one or more digits, and a
1577    "." (which is now a literal, and not a special character, since it is
1578    escaped with "\"), and lastly either "gif", or "jpeg", or "jpg". Some
1579    possible matches would include: "//advert1.jpg",
1580    "/nasty/ads/advert1234.gif", "/banners/from/hell/advert99.jpg". It
1581    would not match "advert1.gif" (no leading slash), or "/adverts232.jpg"
1582    (the expression does not include an "s"), or "/advert1.jsp" ("jsp" is
1583    not in the expression anywhere).
1584    
1585    s/microsoft(?!.com)/MicroSuck/i - This is a substitution. "MicroSuck"
1586    will replace any occurrence of "microsoft". The "i" at the end of the
1587    expression means ignore case. The "(?!.com)" means the match should
1588    fail if "microsoft" is followed by ".com". In other words, this acts
1589    like a "NOT" modifier. In case this is a hyperlink, we don't want to
1590    break it ;-).
1591    
1592    We are barely scratching the surface of regular expressions here so
1593    that you can understand the default Junkbuster configuration files,
1594    and maybe use this knowledge to customize your own installation. There
1595    is much, much more that can be done with regular expressions. Now that
1596    you know enough to get started, you can learn more on your own :/
1597    
1598    More reading on Perl Compatible Regular expressions:
1599    [53]http://www.perldoc.com/perl5.6/pod/perlre.html
1600
1601 References
1602
1603    1. http://ijbswa.sourceforge.net/user-manual/
1604    2. mailto:ijbswa-developers@lists.sourceforge.net
1605    3. file://localhost/home/swa/sf/current/doc/source/tmp.html#INTRODUCTION
1606    4. file://localhost/home/swa/sf/current/doc/source/tmp.html#AEN27
1607    5. file://localhost/home/swa/sf/current/doc/source/tmp.html#INSTALLATION
1608    6. file://localhost/home/swa/sf/current/doc/source/tmp.html#INSTALLATION-SOURCE
1609    7. file://localhost/home/swa/sf/current/doc/source/tmp.html#INSTALLATION-RH
1610    8. file://localhost/home/swa/sf/current/doc/source/tmp.html#INSTALLATION-SUSE
1611    9. file://localhost/home/swa/sf/current/doc/source/tmp.html#INSTALLATION-OS2
1612   10. file://localhost/home/swa/sf/current/doc/source/tmp.html#INSTALLATION-WIN
1613   11. file://localhost/home/swa/sf/current/doc/source/tmp.html#INSTALLATION-OTHER
1614   12. file://localhost/home/swa/sf/current/doc/source/tmp.html#CONFIGURATION
1615   13. file://localhost/home/swa/sf/current/doc/source/tmp.html#AEN172
1616   14. file://localhost/home/swa/sf/current/doc/source/tmp.html#ACTIONSFILE
1617   15. file://localhost/home/swa/sf/current/doc/source/tmp.html#FILTERFILE
1618   16. file://localhost/home/swa/sf/current/doc/source/tmp.html#AEN1130
1619   17. file://localhost/home/swa/sf/current/doc/source/tmp.html#QUICKSTART
1620   18. file://localhost/home/swa/sf/current/doc/source/tmp.html#CONTACT
1621   19. file://localhost/home/swa/sf/current/doc/source/tmp.html#COPYRIGHT
1622   20. file://localhost/home/swa/sf/current/doc/source/tmp.html#AEN1195
1623   21. file://localhost/home/swa/sf/current/doc/source/tmp.html#AEN1201
1624   22. file://localhost/home/swa/sf/current/doc/source/tmp.html#SEEALSO
1625   23. file://localhost/home/swa/sf/current/doc/source/tmp.html#APPENDIX
1626   24. file://localhost/home/swa/sf/current/doc/source/tmp.html#REGEX
1627   25. http://i.j.b/
1628   26. http://sourceforge.net/projects/ijbswa/
1629   27. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ijbswa/current/
1630   28. http://www.gnu.org/
1631   29. http://i.j.b/
1632   30. file://localhost/home/swa/sf/current/doc/source/tmp.html#ACTIONSFILE
1633   31. http://i.j.b/
1634   32. http://i.j.b/
1635   33. http://i.j.b/
1636   34. http://i.j.b/show-url-info
1637   35. http://i.j.b/
1638   36. http://www.perldoc.com/perl5.6/pod/perlre.html
1639   37. file://localhost/home/swa/sf/current/doc/source/tmp.html#REGEX
1640   38. http://i.j.b/
1641   39. http://sourceforge.net/tracker/?atid=361118&group_id=11118&func=browse
1642   40. http://sourceforge.net/mail/?group_id=11118
1643   41. http://sourceforge.net/tracker/?group_id=11118&atid=111118
1644   42. http://www.gnu.org/copyleft/gpl.html
1645   43. http://www.junkbusters.com/ht/en/ijbfaq.html
1646   44. http://www.waldherr.org/junkbuster/
1647   45. http://sourceforge.net/projects/ijbswa/
1648   46. http://sourceforge.net/projects/ijbswa
1649   47. http://ijbswa.sourceforge.net/
1650   48. http://i.j.b/
1651   49. http://www.junkbusters.com/ht/en/cookies.html
1652   50. http://www.waldherr.org/junkbuster/
1653   51. http://privacy.net/analyze/
1654   52. http://www.squid-cache.org/
1655   53. http://www.perldoc.com/perl5.6/pod/perlre.html