Add new filters.
[privoxy.git] / doc / source / privoxy-man-page.sgml
1 <!--
2  File        :  $Source: /cvsroot/ijbswa/current/doc/source/privoxy-man-page.sgml,v $
3
4  Purpose     :  Manual Page
5                 This file belongs into
6                 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
7                 
8  $Id: privoxy-man-page.sgml,v 2.10 2006/10/03 11:12:18 hal9 Exp $
9
10  Copyright (C) 2001-2006 Privoxy Developers http://privoxy.org
11  See LICENSE.
12
13  ========================================================================
14  NOTE: Please read developer-manual/documentation.html before touching 
15  anything in this, or other Privoxy documentation. 
16  ========================================================================
17
18  Doc NOTES: This is some tricky markup! There are some quirks
19  to how this markup is handled. It is not always so co-operative.
20  Please don't change the markup unless you can verify the changes 
21  will improve finished output! 
22  
23  literallayout tags are particularly sensitive to where they are placed.
24  The 'replaceable' and 'command' tags are used here somewhat unconventionally,
25  since it seems to generate the proper formatting (at least for me :).
26
27  Create man page: 'make man'
28
29  Requires docbook2man (short perl script), see CVS
30  http://sources.redhat.com/docbook-tools/. Also requires openjade and SGMLSpm
31  perl module. 
32  
33  For man page references, see:
34  http://www.linuxdoc.org/HOWTO/mini/DocBook-Install/using.html
35  http://docbook.org/tdg/en/html/ch02.html#making-refentry
36
37 -->
38 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN"[
39 <!entity % dummy "IGNORE"> 
40 <!entity p-intro SYSTEM "privoxy.sgml">
41 <!entity seealso SYSTEM "seealso.sgml">
42 <!entity copyright SYSTEM "copyright.sgml">
43 <!entity license SYSTEM "license.sgml">
44 <!entity authors SYSTEM "p-authors.sgml">
45 <!entity p-version "3.0.6">
46 <!entity p-status "UNRELEASED">
47 <!entity % p-not-stable "INCLUDE">
48 <!entity % p-stable "IGNORE">
49 <!entity % p-text "IGNORE">           <!-- define we are not a text only doc -->
50 <!entity % p-authors-formal "IGNORE"> <!-- exclude additional formating      -->
51 <!entity my-copy "(C)">               <!-- db2man barfs on copyright symbol  -->
52 ]>
53
54 <refentry id="privoxy">
55 <refentryinfo>
56  <date>2006-08-24</date>
57 </refentryinfo>
58 <refmeta>
59  <refentrytitle>privoxy</refentrytitle> 
60  <manvolnum>1</manvolnum>
61  <refmiscinfo>
62   Privoxy &p-version;<![%p-not-stable;[ &p-status;]]>
63  </refmiscinfo>
64 </refmeta>
65
66 <refnamediv>
67  <refname><application>privoxy</application></refname>
68  <refpurpose>Privacy Enhancing Proxy</refpurpose>
69 </refnamediv>
70
71 <refsynopsisdiv>
72  <cmdsynopsis> 
73   <command>privoxy</command>
74   <arg><option>--help</option></arg>
75   <arg><option>--version</option></arg>
76   <arg><option>--no-daemon</option></arg>
77   <arg><option>--pidfile </option><replaceable class="parameter">pidfile</replaceable></arg>  
78   <arg><option>--user </option><replaceable class="parameter">user[.group]</replaceable></arg> 
79   <arg><option>--chroot</option></arg>
80   <arg><replaceable class="parameter">configfile</replaceable></arg>        
81  </cmdsynopsis>
82
83 </refsynopsisdiv>
84
85
86 <!--   ~~~~~       New section      ~~~~~     -->
87 <refsect1><title>Options</title>
88  <para>
89   <command>Privoxy</command> may be invoked with the following command line
90   options:
91  </para>
92
93  <variablelist>                                          
94   <varlistentry>
95     <term>--help</term>
96       <listitem>
97        <para>
98          Print brief usage info and exit.
99         </para>
100       </listitem>
101   </varlistentry>
102
103   <varlistentry>
104     <term>--version</term>
105       <listitem>
106        <para>
107          Print version info and exit.
108         </para>
109       </listitem>
110   </varlistentry>
111
112   <varlistentry>
113     <term>--no-daemon</term>
114      <listitem>
115       <para>
116         Don't  become  a daemon, i.e. don't fork and become process group
117         leader, don't detach from controlling tty, and do all logging there.
118       </para>
119     </listitem>
120   </varlistentry>
121
122   <varlistentry>
123     <term>--pidfile <replaceable class="parameter">pidfile</replaceable></term>
124      <listitem>
125       <para>
126         On startup, write the process ID to <replaceable class="parameter">pidfile</replaceable>.
127         Delete the <replaceable class="parameter">pidfile</replaceable> on exit.
128         Failure to create or delete the <replaceable class="parameter">pidfile</replaceable>
129         is non-fatal. If no <command>--pidfile</command> option is given, no PID file will be used.
130       </para>
131     </listitem>
132   </varlistentry>
133
134   <varlistentry>
135     <term>--user <replaceable class="parameter">user[.group]</replaceable></term>
136      <listitem>
137       <para>
138        <!-- Note: replaceable is maybe the wrong tag, but generates  -->
139        <!-- correct looking man output.                              -->
140        After (optionally) writing the PID file, assume the user ID of
141        <replaceable class="parameter">user</replaceable> and the GID of
142        <replaceable class="parameter">group</replaceable>, or, if the optional
143        <replaceable class="parameter">group</replaceable> was not given, the default group of
144        <replaceable class="parameter">user</replaceable>. Exit if the privileges are not
145        sufficient to do so.
146      </para>
147     </listitem>
148   </varlistentry>
149   <varlistentry>
150     <term>--chroot</term>
151      <listitem>
152       <para>
153        Before changing to the user ID given in the --user option, chroot to
154        that user's home directory, i.e. make the kernel pretend to the
155        <command>Privoxy</command> process that the directory tree starts
156        there. If set up carefully, this can limit the impact of possible
157        vulnerabilities in <command>Privoxy</command> to the files contained in
158        that hierarchy. 
159       </para>
160     </listitem>
161   </varlistentry>
162  </variablelist>
163
164  <para>
165   If the <filename>configfile</filename> is not specified on  the  command  line,
166   <command>Privoxy</command>  will  look for a file named
167   <filename>config</filename> in the current directory . If no
168   <filename>configfile</filename> is found, <command>Privoxy</command> will 
169   fail to start.
170  </para>
171
172 </refsect1>
173
174
175 <!--   ~~~~~       New section      ~~~~~     -->
176 <refsect1><title>Description</title>
177 <!-- Include privoxy.sgml boilerplate: -->
178  &p-intro;
179 <!-- end boilerplate -->
180 </refsect1>
181
182
183 <!--   ~~~~~       New section      ~~~~~     -->
184 <refsect1><title>Installation and Usage</title>
185 <para>
186  Browsers must be individually configured to use <command>Privoxy</command> as
187  a HTTP proxy.  The default setting is  for  localhost,  on port  8118
188  (configurable in the main config file).  To set the HTTP proxy in Netscape
189  and Mozilla, go through:  <command>Edit</command>;
190  <command>Preferences</command>;  <command>Advanced</command>;
191  <command>Proxies</command>;  <command>Manual Proxy Configuration</command>;
192  <command>View</command>. 
193 </para>
194 <para>
195  For Firefox, go through: <command>Tools</command>; 
196  <command>Options</command>; <command>General</command>;
197  <command>Connection Settings</command>;
198  <command>Manual Proxy Configuration</command>. 
199 </para>
200 <para>
201  For Internet Explorer, go through: <command>Tools</command>; 
202  <command>Internet Properties</command>; <command>Connections</command>;
203  <command>LAN Settings</command>. 
204 </para>
205 <para>
206  The Secure (SSL) Proxy should also be set to the same values, otherwise
207  https: URLs will not be proxied. Note: <command>Privoxy</command> can only
208  proxy HTTP and HTTPS traffic. Do not try it with FTP or other protocols.
209  HTTPS presents some limitations, and not all features will work with HTTPS 
210  connections.
211 </para>
212
213 <para>
214  For other browsers, check the documentation.
215 </para>
216 </refsect1>
217
218
219 <!--   ~~~~~       New section      ~~~~~     -->
220 <refsect1><title>Configuration</title>
221 <para>
222  <command>Privoxy</command> can be configured with the various configuration
223  files. The default configuration files are: <filename>config</filename>,
224  <filename>default.filter</filename>, and
225  <filename>default.action</filename>. <filename>user.action</filename> should 
226  be used for locally defined exceptions to the default rules of
227  <filename>default.action</filename>, and <filename>user.filter</filename> for 
228  locally defined filters. These are well commented.  On Unix
229  and Unix-like systems, these are located in
230  <filename>/etc/privoxy/</filename> by default. 
231 </para>
232 <para> 
233  <command>Privoxy</command> uses the concept of <command>actions</command> 
234  in order to manipulate the data stream between the browser and remote sites.
235  There are various actions available with specific functions for such things 
236  as blocking web sites, managing cookies, etc. These actions can be invoked
237  individually or combined, and used against individual URLs, or groups of URLs 
238  that can be defined using wildcards and regular expressions. The result is
239  that the user has greatly enhanced control and freedom.
240 </para>
241 <para>
242  The actions list (ad blocks, etc) can also be configured with your
243  web browser at <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>.
244  <command>Privoxy's</command> configuration parameters  can also  be viewed at
245  the same page. In addition, <command>Privoxy</command> can be toggled on/off.
246  This is an internal page, and does not require Internet access.
247 </para>
248 <para>
249  See the <ulink
250  url="http://www.privoxy.org/user-manual/"><citetitle>User Manual</citetitle></ulink> for a detailed
251  explanation of installation, general usage, all configuration options, new
252  features and notes on upgrading.
253 </para>
254 </refsect1>
255
256
257 <!--   ~~~~~       New section      ~~~~~     -->
258 <refsect1><title>Sample Configuration</title>
259 <para>
260  A brief example of what a simple <filename>default.action</filename>
261  configuration might look like:
262 </para>
263
264 <literallayout>
265  # Define a few useful custom aliases for later use
266  {{alias}}
267
268  # Useful aliases that combine more than one action
269  +crunch-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
270  -crunch-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
271  +block-as-image = +block +handle-as-image
272
273  # Fragile sites should have the minimum changes
274  fragile     = -block -deanimate-gifs -fast-redirects -filter \
275                -hide-referer -prevent-cookies -kill-popups
276
277  ## Turn some actions on ################################
278  ## NOTE: Actions are off by default, unless explictily turned on 
279  ## otherwise with the '+' operator.
280
281 { \
282 -add-header \
283 -block \
284 -content-type-overwrite \
285 -crunch-client-header \
286 -crunch-if-none-match \
287 -crunch-outgoing-cookies \
288 -crunch-incoming-cookies \
289 -crunch-server-header \
290 +deanimate-gifs{last} \
291 -downgrade-http-version \
292 -fast-redirects \
293 -filter{js-annoyances} \
294 -filter{js-events} \
295 -filter{html-annoyances} \
296 -filter{content-cookies} \
297 +filter{refresh-tags} \
298 -filter{unsolicited-popups} \
299 -filter{all-popups} \
300 -filter{img-reorder} \
301 -filter{banners-by-size} \
302 -filter{banners-by-link} \
303 +filter{webbugs} \
304 -filter{tiny-textforms} \
305 +filter{jumping-windows} \
306 -filter{frameset-borders} \
307 -filter{demoronizer} \
308 -filter{shockwave-flash} \
309 -filter{quicktime-kioskmode} \
310 -filter{fun} \
311 -filter{crude-parental} \
312 +filter{ie-exploits} \
313 -filter{site-specifics} \
314 -filter{google} \
315 -filter{yahoo} \
316 -filter{msn} \
317 -filter{blogspot} \
318 -filter{xml-to-html} \
319 -filter{html-to-xml} \
320 -filter{no-ping} \
321 -filter{hide-tor-exit-notation} \
322 -filter-client-headers \
323 -filter-server-headers \
324 -force-text-mode \
325 -handle-as-empty-document
326 -handle-as-image \
327 -hide-accept-language \
328 -hide-content-disposition \
329 -hide-if-modified-since \
330 +hide-forwarded-for-headers \
331 +hide-from-header{block} \
332 +hide-referrer{forge} \
333 -hide-user-agent \
334 -inspect-jpegs \
335 -kill-popups \
336 -limit-connect \
337 -overwrite-last-modified \
338 -redirect \
339 +prevent-compression \
340 -send-vanilla-wafer \
341 -send-wafer \
342 +session-cookies-only \
343 +set-image-blocker{pattern} \
344 -treat-forbidden-connects-like-blocks \
345 }
346 / # '/' Match *all* URL patterns
347
348  
349  # Block all URLs that match these patterns
350  { +block }
351   ad.
352   ad[sv].
353   .*ads.
354   banner?.
355   /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
356   .hitbox.com 
357   media./.*(ads|banner)
358
359  # Block, and treat these URL patterns as if they were 'images'.
360  # We would expect these to be ads.
361  { +block-as-image }
362   .ad.doubleclick.net
363   .a[0-9].yimg.com/(?:(?!/i/).)*$
364   ad.*.doubleclick.net
365
366  # Make exceptions for these harmless ones that would be 
367  # caught by our +block patterns just above.
368  { -block }
369   adsl.
370   adobe.
371   advice.
372   .*downloads.
373   # uploads or downloads
374   /.*loads
375 </literallayout>
376
377 <para>
378  Then for a <filename>user.action</filename>, we would put local,
379  narrowly defined exceptions:
380 </para>
381
382 <literallayout>
383  # Re-define aliases as needed here
384  {{alias}}
385
386  # Useful aliases
387  -crunch-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
388  
389  # Set personal exceptions to the policies in default.action #######
390
391  # Sites where we want persistent cookies, so allow *all* cookies
392  { -crunch-cookies -session-cookies-only }
393   .redhat.com
394   .sun.com
395   .msdn.microsoft.com
396  
397  # These sites breaks easily. Use our "fragile" alias here.
398  { fragile }
399   .forbes.com
400   mybank.example.com
401
402  # Replace example.com's style sheet with one of my choosing
403  { +redirect{http://localhost/css-replacements/example.com.css} }
404   example.com/stylesheet.css
405
406 </literallayout>
407
408 <para>
409  See the comments in the configuration files themselves, or the 
410  <citetitle>User Manual</citetitle>
411  for full explanations of the above syntax, and other <command>Privoxy</command>
412  configuration options.
413 </para>
414
415 </refsect1>
416
417
418 <!--   ~~~~~       New section      ~~~~~     -->
419 <refsect1><title>Files</title>
420 <!-- this is a cheesy way to do this, but WTF. -->
421 <literallayout> 
422  <filename>/usr/sbin/privoxy</filename>
423  <filename>/etc/privoxy/config</filename>
424  <filename>/etc/privoxy/default.action</filename>
425  <filename>/etc/privoxy/standard.action</filename>
426  <filename>/etc/privoxy/user.action</filename>
427  <filename>/etc/privoxy/default.filter</filename>
428  <filename>/etc/privoxy/user.filter</filename>
429  <filename>/etc/privoxy/trust</filename>
430  <filename>/etc/privoxy/templates/*</filename>
431  <filename>/var/log/privoxy/logfile</filename>
432 </literallayout>
433
434 <para>
435  Various other files should be included, but may vary depending on platform
436  and build configuration. Additional documentation should be included in the local
437  documentation directory.
438 </para>
439
440 </refsect1>
441
442
443 <!--   ~~~~~       New section      ~~~~~     -->
444 <refsect1><title>Signals</title>
445 <para>
446  <!-- command tag is used here to get proper looking format  -->
447  <command>Privoxy</command> terminates on the <command>SIGINT</command>,
448  <command>SIGTERM</command> and <command>SIGABRT</command> signals. Log
449  rotation scripts may cause a re-opening of the logfile by sending a 
450  <command>SIGHUP</command> to <command>Privoxy</command>. Note that unlike
451  other daemons,  <command>Privoxy</command> does not need to be made aware of
452  config file changes by <command>SIGHUP</command> -- it will detect them
453  automatically. 
454 </para>
455
456 </refsect1>
457
458 <!--   ~~~~~       New section      ~~~~~     -->
459 <refsect1><title>Notes</title>
460 <![%p-not-stable;[
461 <para>
462  This is a &p-status; version of <command>Privoxy</command>. Not 
463  all features are well tested.
464 </para>]]>
465 <para>
466  Please see the <citetitle>User Manual</citetitle> on how to contact the
467  developers, for feature requests, reporting problems, and other questions.
468 </para>
469
470 </refsect1>
471
472 <!--   ~~~~~       New section      ~~~~~     -->
473 <refsect1><title>See Also</title>
474 <!-- Include seealso.sgml boilerplate: -->
475  &seealso;
476 <!-- end boilerplate -->
477 </refsect1>
478
479 <!--   ~~~~~       New section      ~~~~~     -->
480 <refsect1><title>Development Team</title>
481 <!-- Include p-authors.sgml boilerplate: -->
482  &authors;
483 <!-- end boilerplate -->
484 </refsect1>
485
486 <!--   ~~~~~       New section      ~~~~~     -->
487 <refsect1><title>Copyright and License</title>
488
489 <refsect2><title>Copyright</title>
490 <!-- Include copyright.sgml boilerplate: -->
491  &copyright;
492 <!-- end boilerplate -->
493 </refsect2>
494
495 <refsect2><title>License</title>
496 <!-- Include license.sgml boilerplate: -->
497  &license;
498 <!-- end boilerplate -->
499 </refsect2>
500 </refsect1>
501
502 </refentry>