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