source: adblock2privoxy/adblock2privoxy-utils/man/man1/adblock2privoxy.1 @ 433b59c

Last change on this file since 433b59c was 433b59c, checked in by Alexey Zubritskiy <a.zubritskiy@…>, 4 years ago

Added aws run automation

  • Property mode set to 100644
File size: 6.3 KB
Line 
1.\" Automatically generated by Pandoc 1.15.2.1
2.\"
3.hy
4.TH "ADBLOCK2PRIVOXY" "1" "2015\-12\-30" "adblock2privoxy 1.4.1" "General Commands Manual"
5.SH ADBLOCK2PRIVOXY
6.PP
7\f[B]Convert adblock config files to privoxy format\f[]
8.SS Synopsis
9.RS
10.PP
11adblock2privoxy [OPTION...] [URL...]
12.RE
13.SS Objectives
14.PP
15AdBlock Plus browser plugin has great block lists provided by big
16community, but it is client software and cannot work on a server as a
17proxy.
18.PP
19Privoxy proxy has good potential to block ads at server side, but it
20experiences acute shortage of updated block lists.
21.PP
22This software converts adblock lists to privoxy config files format.
23.PP
24Almost all adblock features are supported including
25.IP \[bu] 2
26block/unblock requests (on privoxy)
27.RS 2
28.IP \[bu] 2
29all syntax features are supported except for regex templates matching
30host name
31.RE
32.IP \[bu] 2
33hide/unhide page elements (via CSS)
34.RS 2
35.IP \[bu] 2
36all syntax features are supported
37.RE
38.IP \[bu] 2
39all block request options except for outdated ones:
40.RS 2
41.IP \[bu] 2
42Supported: script, image, stylesheet, object, xmlhttprequest,
43object\-subrequest, subdocument,document, elemhide, other, popup,
44third\-party, domain=..., match\-case, donottrack
45.IP \[bu] 2
46Unsupported: collapse, background, xbl, ping and dtd
47.RE
48.PP
49Tested with privoxy version 3.0.21.
50Element hiding feature requires a webserver to serve CSS files.
51See Nginx and Apache config examples provided.
52.SS Description
53.PP
54Adblock files specified by [URL]...
55are converted to privoxy config files and auxiliarly elemHide CSS files.
56Local file names and http(s) addresses are accepted as URLs.
57.PP
58If no source URLs are specified, task file is used to determine sources:
59previously processed sources are processed again if any of them is
60expired.
61Nothing is done if all sources in the task file are up to date.
62.SS Options
63.RS
64.TP
65.B \-v \-\-version
66Show version number
67.RS
68.RE
69.TP
70.B \-p PATH \-\-privoxyDir=PATH
71Privoxy config output path
72.RS
73.RE
74.TP
75.B \-w PATH \-\-webDir=PATH
76Css files output path
77.RS
78.RE
79.TP
80.B \-d DOMAIN \-\-domainCSS=DOMAIN
81Domain of CSS web server (required for Element Hide functionality)
82.RS
83.RE
84.TP
85.B \-t PATH \-\-taskFile=PATH
86Path to task file containing urls to process and options.
87.RS
88.RE
89.TP
90.B \-f \-\-forced
91Run even if no sources are expired
92.RS
93.RE
94.RE
95.PP
96If taskFile is not specified explicilty, [privoxyDir]/ab2p.task is used.
97.PP
98If task file exists and privoxyDir, webDir or domainCSS is not
99specified, corresponding value is taken from task file.
100.PP
101If webDir is not specified (and cannot be taken from task file),
102privoxyDir value is used for webDir.
103.PP
104If domainCSS is not specified (and cannot be taken from task file),
105Element Hide functionality become disabled (and no webserver is needed).
106.PP
107domainCSS can contain just IP address if no CSS web server has no
108associated domain.
109.SS Usage
110.PP
111Example of first run:
112.IP
113.nf
114\f[C]
115adblock2privoxy\ \-p\ /etc/privoxy\ \-w\ /var/www/privoxy\ \-d\ www.example.com\ \-t\ my_ab2b.task\ https://easylist\-downloads.adblockplus.org/easylist.txt\ https://easylist\-downloads.adblockplus.org/advblock.txt\ my_custom.txt
116\f[]
117.fi
118.PP
119Example of subsequent runs:
120.IP
121.nf
122\f[C]
123adblock2privoxy\ \-t\ my_ab2b.task
124\f[]
125.fi
126.PP
127The app generates following files
128.RS
129.IP \[bu] 2
130privoxyDir:
131.RS
132.IP \[bu] 2
133ab2p.system.action
134.IP \[bu] 2
135ab2p.action
136.IP \[bu] 2
137ab2p.system.filter
138.IP \[bu] 2
139ab2p.filter
140.RE
141.IP \[bu] 2
142webDir:
143.RS
144.IP \[bu] 2
145ab2p.common.css
146.IP \[bu] 2
147ab2p.css
148.IP \[bu] 2
149[lot of directories for all levels of domain names]
150.RE
151.IP \[bu] 2
152taskFile:
153.RE
154.RS
155.IP \[bu] 2
156special file containing execution details.
157It can be reused to update privoxy config from same sources with same
158options.
159.RE
160.SS How to apply results
161.IP "1." 3
162Install privoxy.
163Optionally setup it as transparent proxy
164.IP "2." 3
165Change privoxy config file.
166Add following lines:
167.RS 4
168.IP
169.nf
170\f[C]
171actionsfile\ ab2p.system.action
172actionsfile\ ab2p.action
173filterfile\ ab2p.system.filter
174filterfile\ ab2p.filter
175\f[]
176.fi
177.RE
178.IP "3." 3
179Install nginx or apache webserver
180.RS 4
181.PP
182Nginx config example:
183.IP
184.nf
185\f[C]
186server\ {
187\ \ \ \ \ \ \ \ listen\ 80;
188\ \ \ \ \ \ \ \ #ab2p\ css\ domain\ name\ (optional,\ should\ be\ equal\ to\ domainCSS\ parameter)
189\ \ \ \ \ \ \ \ server_name\ www.example.com;
190
191\ \ \ \ \ \ \ \ #root\ =\ webDir\ parameter\ value
192\ \ \ \ \ \ \ \ root\ /var/www/privoxy;
193
194\ \ \ \ \ \ \ \ location\ ~\ ^/[^/.]+\\..+/ab2p.css$\ {
195\ \ \ \ \ \ \ \ \ \ \   #\ first\ reverse\ domain\ names\ order
196\       \       \       rewrite\ ^/([^/]*?)\\.([^/.]+)(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?/ab2p.css$\ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css\ last;
197\ \ \ \ \ \ \ \ }
198
199\ \ \ \ \ \ \ \ location\ ~\ (^.*/+)[^/]+/+ab2p.css\ {
200\ \ \ \ \ \ \ \ \ \ \   #\ then\ try\ to\ get\ CSS\ for\ current\ domain
201\ \ \ \ \ \ \ \ \ \ \   #\ if\ it\ is\ unavailable\ \-\ get\ CSS\ for\ parent\ domain
202\ \ \ \ \ \ \ \ \ \ \   try_files\ $uri\ $1ab2p.css;
203\ \ \ \ \ \ \ \ }
204}
205\f[]
206.fi
207.PP
208Apache config example:
209.IP
210.nf
211\f[C]
212<VirtualHost\ *:80>
213\ \ \ \ \ \ \ \ #ab2p\ css\ domain\ name\ (optional,\ should\ be\ equal\ to\ domainCSS\ parameter)
214\ \ \ \ \ \ \ \ ServerName\ www.example.com
215
216\ \ \ \ \ \ \ \ #root\ =\ webDir\ parameter\ value
217\ \ \ \ \ \ \ \ DocumentRoot\ /var/www/privoxy
218
219
220\ \ \ \ \ \ \ \ RewriteEngine\ on
221
222\ \ \ \ \ \ \ \ #\ first\ reverse\ domain\ names\ order
223\ \ \ \ \ \ \ \ RewriteRule\ ^/([^/]*?)\\.([^/.]+)(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?/ab2p.css$\ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css\ [N]
224
225\ \ \ \ \ \ \ \ #\ then\ try\ to\ get\ CSS\ for\ current\ domain
226\ \ \ \ \ \ \ \ #\ if\ it\ is\ unavailable\ \-\ get\ CSS\ for\ parent\ domain
227\ \ \ \ \ \ \ \ RewriteCond\ %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}\ !\-f
228\ \ \ \ \ \ \ \ RewriteRule\ (^.*/+)[^/]+/+ab2p.css$\ $1ab2p.css\ [N]
229</VirtualHost>
230\f[]
231.fi
232.RE
233.IP "4)" 3
234Find out abdlock config files to use.
235Some download locations
236.RS
237.IP \[bu] 2
238EasyList (https://easylist.adblockplus.org/en/)
239.IP \[bu] 2
240Russian AD list (https://code.google.com/p/ruadlist/)
241.RE
242.IP "5)" 3
243Run adblock2privoxy providing privoxy dir, web dir, domain and adblock
244input file urls
245.IP "6)" 3
246Restart privoxy and apache to load updated configs
247.PP
248Clone repository from <http://projects.zubr.me/adblock2privoxy.git>
249.SH AUTHORS
250Alexey Zubritsky <adblock2privoxy\@zubr.me>.
Note: See TracBrowser for help on using the repository browser.