Changeset a2fcf33 in adblock2privoxy


Ignore:
Timestamp:
Feb 12, 2016 6:02:44 PM (3 years ago)
Author:
Alexey Zubritskiy <a.zubritskiy@…>
Branches:
master
Parents:
433b59c
Message:

Release 1.4.2

Files:
15 edited

Legend:

Unmodified
Added
Removed
  • adblock2privoxy-utils/adblock2privoxy-utils.cabal

    r433b59c ra2fcf33  
    11name:                adblock2privoxy-utils 
    2 version:             1.4.1 
     2version:             1.4.2 
    33cabal-version:       >= 1.10 
    44build-type:          Simple 
    5 tested-with:         GHC==7.10.2 
     5tested-with:         GHC==7.10.3 
    66author:              Alexey Zubritsky <adblock2privoxy@zubr.me> 
    77homepage:            https://projects.zubr.me/wiki/adblock2privoxy 
     
    4747  location:  ​http://projects.zubr.me/adblock2privoxy.git 
    4848  subdir:    adblock2privoxy-utils 
    49   tag:       1.4.1 
     49  tag:       1.4.2 
  • adblock2privoxy-utils/automation/build_all.sh

    r433b59c ra2fcf33  
    1010'./run_aws_build.sh ami-e0efab88 admin  "../../adblock2privoxy" "distribution/makeDeb" debian7_64' \ 
    1111'./run_aws_build.sh ami-8b9a63e0 admin  "../../adblock2privoxy" "distribution/makeDeb" debian8_64' \ 
    12 './run_aws_build.sh ami-032a5566 fedora "../../adblock2privoxy" "distribution/makeRpm" fedora22_64' \ 
    13 './run_aws_build.sh ami-00443d6a fedora "../../adblock2privoxy" "distribution/makeRpm" fedora23_64' \ 
     12'./run_aws_build.sh ami-62adbc0a fedora "../../adblock2privoxy" "distribution/makeRpm" fedora22_64' \ 
     13'./run_aws_build.sh ami-02321068 fedora "../../adblock2privoxy" "distribution/makeRpm" fedora23_64' \ 
    1414'./run_aws_build.sh ami-02dc4c6b ec2-user "../../adblock2privoxy" "distribution/makeRpm" centos6_64' \ 
    1515'./run_aws_build.sh ami-61bbf104 centos "../../adblock2privoxy" "distribution/makeRpm" centos7_64' 
  • adblock2privoxy-utils/man/man1/adblock2privoxy.1

    r433b59c ra2fcf33  
    1 .\" Automatically generated by Pandoc 1.15.2.1 
     1.\" Automatically generated by Pandoc 1.16.0.2 
    22.\" 
     3.TH "ADBLOCK2PRIVOXY" "1" "2016\-02\-12" "adblock2privoxy 1.4.2" "General Commands Manual" 
    34.hy 
    4 .TH "ADBLOCK2PRIVOXY" "1" "2015\-12\-30" "adblock2privoxy 1.4.1" "General Commands Manual" 
    55.SH ADBLOCK2PRIVOXY 
    66.PP 
     
    2323.PP 
    2424Almost all adblock features are supported including 
     25.RS 
    2526.IP \[bu] 2 
    2627block/unblock requests (on privoxy) 
     
    4647Unsupported: collapse, background, xbl, ping and dtd 
    4748.RE 
     49.RE 
    4850.PP 
    4951Tested with privoxy version 3.0.21. 
    50 Element hiding feature requires a webserver to serve CSS files. 
     52Element hiding (https://adblockplus.org/filters#elemhide) feature 
     53requires a webserver to serve CSS files. 
    5154See Nginx and Apache config examples provided. 
    5255.SS Description 
     
    6366.RS 
    6467.TP 
    65 .B \-v \-\-version 
     68.B \-v, \-\-version 
    6669Show version number 
    6770.RS 
    6871.RE 
    6972.TP 
    70 .B \-p PATH \-\-privoxyDir=PATH 
     73.B \-p PATH, \-\-privoxyDir=PATH 
    7174Privoxy config output path 
    7275.RS 
    7376.RE 
    7477.TP 
    75 .B \-w PATH \-\-webDir=PATH 
     78.B \-w PATH, \-\-webDir=PATH 
    7679Css files output path 
    7780.RS 
    7881.RE 
    7982.TP 
    80 .B \-d DOMAIN \-\-domainCSS=DOMAIN 
     83.B \-d DOMAIN, \-\-domainCSS=DOMAIN 
    8184Domain of CSS web server (required for Element Hide functionality) 
    8285.RS 
    8386.RE 
    8487.TP 
    85 .B \-t PATH \-\-taskFile=PATH 
     88.B \-t PATH, \-\-taskFile=PATH 
    8689Path to task file containing urls to process and options. 
    8790.RS 
    8891.RE 
    8992.TP 
    90 .B \-f \-\-forced 
     93.B \-f, \-\-forced 
    9194Run even if no sources are expired 
    9295.RS 
     
    9497.RE 
    9598.PP 
    96 If taskFile is not specified explicilty, [privoxyDir]/ab2p.task is used. 
    97 .PP 
    98 If task file exists and privoxyDir, webDir or domainCSS is not 
    99 specified, corresponding value is taken from task file. 
    100 .PP 
    101 If webDir is not specified (and cannot be taken from task file), 
    102 privoxyDir value is used for webDir. 
    103 .PP 
    104 If domainCSS is not specified (and cannot be taken from task file), 
    105 Element Hide functionality become disabled (and no webserver is needed). 
    106 .PP 
    107 domainCSS can contain just IP address if no CSS web server has no 
     99If \f[C]taskFile\f[] is not specified explicilty, 
     100\f[C][privoxyDir]/ab2p.task\f[] is used. 
     101.PP 
     102If task file exists and \f[C]privoxyDir\f[], \f[C]webDir\f[] or 
     103\f[C]domainCSS\f[] is not specified, corresponding value is taken from 
     104task file. 
     105.PP 
     106If \f[C]webDir\f[] is not specified and cannot be taken from task file, 
     107\f[C]privoxyDir\f[] value is used for \f[C]webDir\f[]. 
     108.PP 
     109If \f[C]domainCSS\f[] is not specified and cannot be taken from task 
     110file, Element Hide (https://adblockplus.org/filters#elemhide) 
     111\f[B]functionality become disabled\f[]. 
     112No webserver is needed in this case. 
     113.PP 
     114\f[C]domainCSS\f[] can contain just IP address if CSS web server has no 
    108115associated domain. 
     116Use \f[C]localhost\f[] or \f[C]127.0.0.1\f[] if you run your browser on 
     117the same machine with webserver. 
    109118.SS Usage 
    110119.PP 
     
    129138.IP \[bu] 2 
    130139privoxyDir: 
    131 .RS 
     140.RS 2 
    132141.IP \[bu] 2 
    133142ab2p.system.action 
     
    141150.IP \[bu] 2 
    142151webDir: 
    143 .RS 
     152.RS 2 
    144153.IP \[bu] 2 
    145154ab2p.common.css 
     
    151160.IP \[bu] 2 
    152161taskFile: 
    153 .RE 
    154 .RS 
     162.RS 2 
    155163.IP \[bu] 2 
    156164special file containing execution details. 
    157165It can be reused to update privoxy config from same sources with same 
    158166options. 
     167Its name is \f[C]ab2p.task\f[] by default. 
     168.RE 
    159169.RE 
    160170.SS How to apply results 
    161171.IP "1." 3 
    162172Install privoxy. 
    163 Optionally setup it as transparent proxy 
     173Optionally setup it as transparent proxy. 
     174See privoxy installation 
     175manual (http://www.privoxy.org/user-manual/installation.html) for 
     176details. 
    164177.IP "2." 3 
    165 Change privoxy config file. 
     178Change privoxy config file located in 
     179.RS 4 
     180.RS 
     181.IP \[bu] 2 
     182\f[C]/etc/privoxy/config\f[] for linux 
     183.IP \[bu] 2 
     184\f[C]C:\\Program\ Files\\Privoxy\\config.txt\f[] for windows 
     185.PP 
    166186Add following lines: 
    167 .RS 4 
    168187.IP 
    169188.nf 
     
    176195.fi 
    177196.RE 
     197.RE 
    178198.IP "3." 3 
    179 Install nginx or apache webserver 
     199In order to make Element 
     200hiding (https://adblockplus.org/filters#elemhide) work you also need a 
     201webserver to serve CSS files. 
     202You can choose nginx, apache or any other webserver. 
     203See nginx installation 
     204manual (https://www.nginx.com/resources/wiki/start/topics/tutorials/install/), 
     205apache on linux installation 
     206manual (https://httpd.apache.org/docs/2.4/install.html) or apache on 
     207windows intallation 
     208manual (http://www.thesitewizard.com/apache/install-apache-2-windows.shtml) 
     209for details. 
     210.IP "4." 3 
     211Change webserver config. 
     212In examples below 
    180213.RS 4 
    181 .PP 
    182 Nginx config example: 
     214.IP \[bu] 2 
     215replace \f[C]www.example.com\f[] with your domain or IP address (equal 
     216to \f[C]\-\-domainCSS\f[] adblock2privoxy parameter) 
     217.IP \[bu] 2 
     218replace \f[C]/var/www/privoxy\f[] with your CSS files location (equal to 
     219\f[C]\-\-webDir\f[] adblock2privoxy parameter) 
     220.IP \[bu] 2 
     221remember, these examples are simplified to use by unexperienced people. 
     222If you\[aq]re familiar with webservers administration, you\[aq]ll find 
     223better ways to apply these configs. 
     224.PP 
     225Nginx config: add following lines into http section of 
     226\f[C]nginx.conf\f[] file 
     227.RS 
     228.IP \[bu] 2 
     229for linus \f[C]/etc/nginx/nginx.conf\f[] 
     230.IP \[bu] 2 
     231for windows \f[C][nginx\ location]\\conf\\nginx.conf\f[] 
    183232.IP 
    184233.nf 
    185234\f[C] 
    186235server\ { 
    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 \ \ \ \ \ \ \ \ } 
     236\ \ \ \ \ \ listen\ 80; 
     237\ \ \ \ \ \ #ab2p\ css\ domain\ name\ (optional,\ should\ be\ equal\ to\ \-\-domainCSS\ parameter) 
     238\ \ \ \ \ \ server_name\ www.example.com; 
     239 
     240\ \ \ \ \ \ #root\ =\ \-\-webDir\ parameter\ value 
     241\ \ \ \ \ \ root\ /var/www/privoxy; 
     242 
     243\ \ \ \ \ \ location\ ~\ ^/[^/.]+\\..+/ab2p.css$\ { 
     244\ \ \ \ \ \ \ \ \ \ #\ first\ reverse\ domain\ names\ order 
     245\ \ \ \ rewrite\ ^/([^/]*?)\\.([^/.]+)(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?/ab2p.css$\ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css\ last; 
     246\ \ \ \ \ \ } 
     247 
     248\ \ \ \ \ \ location\ ~\ (^.*/+)[^/]+/+ab2p.css\ { 
     249\ \ \ \ \ \ \ \ \ \ #\ then\ try\ to\ get\ CSS\ for\ current\ domain 
     250\ \ \ \ \ \ \ \ \ \ #\ if\ it\ is\ unavailable\ \-\ get\ CSS\ for\ parent\ domain 
     251\ \ \ \ \ \ \ \ \ \ try_files\ $uri\ $1ab2p.css; 
     252\ \ \ \ \ \ } 
    204253} 
    205254\f[] 
    206255.fi 
    207 .PP 
    208 Apache config example: 
     256.RE 
     257.PP 
     258Apache config: put following lines into 
     259.RS 
     260.IP \[bu] 2 
     261for linux: \f[C]/etc/apache2/sites\-available/000\-default.conf\f[] 
     262(replace existing content) 
     263.IP \[bu] 2 
     264for windows: 
     265\f[C]C:\\Program\ Files\\Apache\ Group\\Apache2\\conf\\httpd.conf\f[] 
     266(append to the end) 
    209267.IP 
    210268.nf 
    211269\f[C] 
    212270<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] 
     271\ \ \ \ \ \ #ab2p\ css\ domain\ name\ (optional,\ should\ be\ equal\ to\ \-\-domainCSS\ parameter) 
     272\ \ \ \ \ \ ServerName\ www.example.com 
     273 
     274\ \ \ \ \ \ #root\ =\ \-\-webDir\ parameter\ value 
     275\ \ \ \ \ \ DocumentRoot\ /var/www/privoxy 
     276 
     277 
     278\ \ \ \ \ \ RewriteEngine\ on 
     279 
     280\ \ \ \ \ \ #\ first\ reverse\ domain\ names\ order 
     281\ \ \ \ \ \ RewriteRule\ ^/([^/]*?)\\.([^/.]+)(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?(?:\\.([^/.]+))?/ab2p.css$\ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css\ [N] 
     282 
     283\ \ \ \ \ \ #\ then\ try\ to\ get\ CSS\ for\ current\ domain 
     284\ \ \ \ \ \ #\ if\ it\ is\ unavailable\ \-\ get\ CSS\ for\ parent\ domain 
     285\ \ \ \ \ \ RewriteCond\ %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}\ !\-f 
     286\ \ \ \ \ \ RewriteRule\ (^.*/+)[^/]+/+ab2p.css$\ $1ab2p.css\ [N] 
    229287</VirtualHost> 
    230288\f[] 
    231289.fi 
    232290.RE 
    233 .IP "4)" 3 
    234 Find out abdlock config files to use. 
    235 Some download locations 
    236 .RS 
     291.RE 
     292.IP "5." 3 
     293Get adblock2privoxy output 
     294.RS 4 
     295.RS 
     296.IP \[bu] 2 
     297Either run adblock2privoxy providing privoxy dir, web dir, domain and 
     298adblock input file urls such as 
     299.RS 2 
    237300.IP \[bu] 2 
    238301EasyList (https://easylist.adblockplus.org/en/) 
    239302.IP \[bu] 2 
    240303Russian AD list (https://code.google.com/p/ruadlist/) 
    241 .RE 
    242 .IP "5)" 3 
    243 Run adblock2privoxy providing privoxy dir, web dir, domain and adblock 
    244 input file urls 
    245 .IP "6)" 3 
    246 Restart privoxy and apache to load updated configs 
    247 .PP 
    248 Clone repository from <http://projects.zubr.me/adblock2privoxy.git> 
     304.IP \[bu] 2 
     305and many others from official adblock 
     306repository (https://easylist.adblockplus.org/en/) 
     307.RE 
     308.IP \[bu] 2 
     309Or just download processed lists from downloads 
     310page (https://projects.zubr.me/wiki/adblock2privoxyDownloads) and unpack 
     311\f[C]privoxy\f[] to and \f[C]web\f[] directories content into 
     312.RS 2 
     313.IP \[bu] 2 
     314\f[C]/var/www/privoxy\f[] and \f[C]/var/www/privoxy\f[] for linux 
     315.IP \[bu] 2 
     316\f[C]C:\\Program\ Files\\Privoxy\f[] and 
     317\f[C][your\ webserver\ directory]\f[] for windows 
     318.RE 
     319.RE 
     320.RE 
     321.IP "6." 3 
     322Restart privoxy and webserver to load updated configs 
     323.SS Contribution 
     324.IP \[bu] 2 
     325Clone repository from <http://projects.zubr.me/adblock2privoxy.git>. 
     326.IP \[bu] 2 
     327Report bugs (https://projects.zubr.me/newticket?project=adblock2privoxy) 
    249328.SH AUTHORS 
    250329Alexey Zubritsky <adblock2privoxy\@zubr.me>. 
  • adblock2privoxy-utils/stack.yaml

    re2b555c ra2fcf33  
    22 
    33# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) 
    4 resolver: lts-3.18 
     4resolver: lts-5.2 
    55 
    66# Local packages, usually specified by relative directory name 
  • adblock2privoxy/INSTALL.rst

    r433b59c ra2fcf33  
    55From binary package 
    66------------------- 
     7 
    78There are packages for various systems available at `downloads page <http://projects.zubr.me/wiki/adblock2privoxyDownloads>`_ 
    89 
     
    1213From sources 
    1314------------ 
     15 
    1416You can build and run adblock2privoxy from sources if there is no binary package for your system. 
    1517 
    16 1. Ensure you have Haskell compiler and Cabal 
     18#. Ensure you have Haskell Stack environment 
    1719 
    1820        * Install `Stack <http://docs.haskellstack.org/en/stable/install_and_upgrade.html>`_ for your platform 
    19 2. Run:: 
    2021 
    21         stack setup 
     22#. Build the app:: 
     23 
    2224        stack unpack adblock2privoxy 
    2325        cd adblock2privoxy-* 
     26        stack setup      
    2427        stack build 
     28 
     29#. Run the app:: 
     30 
    2531        stack exec adblock2privoxy -- [YOUR ARGS] 
    2632        #for example: stack exec adblock2privoxy -- -p /etc/privoxy -d example.com https://easylist-downloads.adblockplus.org/easylist.txt 
     
    2834Packaging 
    2935--------- 
     36 
    3037You can create your own binary package for adblock2privoxy. 
    3138 
    32         * Use scripts from `distribution` folder for your platform. 
     39#. Use scripts from `distribution` folder for your platform. 
  • adblock2privoxy/README.rst

    re2b555c ra2fcf33  
    2323Almost all adblock features are supported including 
    2424 
    25 * block/unblock requests (on privoxy) 
    26  
    27   * all syntax features are supported except for regex templates matching host name 
    28  
    29 * hide/unhide page elements (via CSS) 
    30  
    31   * all syntax features are supported 
    32  
    33 * all block request options except for outdated ones: 
    34  
    35   * Supported: script, image, stylesheet, object, xmlhttprequest, object-subrequest, subdocument,document, elemhide, other, popup, third-party, domain=..., match-case, donottrack 
    36   * Unsupported: collapse, background, xbl, ping and dtd 
     25  * block/unblock requests (on privoxy) 
     26 
     27    * all syntax features are supported except for regex templates matching host name 
     28 
     29  * hide/unhide page elements (via CSS) 
     30 
     31    * all syntax features are supported 
     32 
     33  * all block request options except for outdated ones: 
     34 
     35    * Supported: script, image, stylesheet, object, xmlhttprequest, object-subrequest, subdocument,document, elemhide, other, popup, third-party, domain=..., match-case, donottrack 
     36    * Unsupported: collapse, background, xbl, ping and dtd 
    3737 
    3838Tested with privoxy version 3.0.21. 
    39 Element hiding feature requires a webserver to serve CSS files. See Nginx and Apache config examples provided. 
     39`Element hiding <https://adblockplus.org/filters#elemhide>`_ feature requires a webserver to serve CSS files. See Nginx and Apache config examples provided. 
    4040 
    4141Description 
     
    4949------- 
    5050 
    51   -v         --version 
     51  -v,         --version 
    5252      Show version number 
    53   -p PATH    --privoxyDir=PATH 
     53  -p PATH,    --privoxyDir=PATH 
    5454      Privoxy config output path 
    55   -w PATH    --webDir=PATH 
     55  -w PATH,    --webDir=PATH 
    5656      Css files output path 
    57   -d DOMAIN  --domainCSS=DOMAIN 
     57  -d DOMAIN,  --domainCSS=DOMAIN 
    5858      Domain of CSS web server (required for Element Hide functionality) 
    59   -t PATH    --taskFile=PATH 
     59  -t PATH,    --taskFile=PATH 
    6060      Path to task file containing urls to process and options. 
    61   -f         --forced 
     61  -f,         --forced 
    6262      Run even if no sources are expired 
    6363 
    64 If taskFile is not specified explicilty, [privoxyDir]/ab2p.task is used. 
    65  
    66 If task file exists and privoxyDir, webDir or domainCSS is not specified, corresponding value is taken from task file. 
    67  
    68 If webDir is not specified (and cannot be taken from task file), privoxyDir value is used for webDir. 
    69  
    70 If domainCSS is not specified (and cannot be taken from task file), Element Hide functionality become disabled (and no webserver is needed). 
    71  
    72 domainCSS can contain just IP address if no CSS web server has no associated domain. 
     64If ``taskFile`` is not specified explicilty, ``[privoxyDir]/ab2p.task`` is used. 
     65 
     66If task file exists and ``privoxyDir``, ``webDir`` or ``domainCSS`` is not specified, corresponding value is taken from task file. 
     67 
     68If ``webDir`` is not specified and cannot be taken from task file, ``privoxyDir`` value is used for ``webDir``. 
     69 
     70If ``domainCSS`` is not specified and cannot be taken from task file, `Element Hide <https://adblockplus.org/filters#elemhide>`_ **functionality become disabled**. No webserver is needed in this case. 
     71 
     72``domainCSS`` can contain just IP address if CSS web server has no associated domain. Use ``localhost`` or ``127.0.0.1`` if you run your browser on the same machine with webserver. 
    7373 
    7474Usage 
     
    8585The app generates following files 
    8686 
    87         * privoxyDir: 
    88  
    89                 * ab2p.system.action 
    90                 * ab2p.action 
    91                 * ab2p.system.filter 
    92                 * ab2p.filter 
    93  
    94         * webDir: 
    95  
    96                 * ab2p.common.css 
    97                 * ab2p.css 
    98                 * [lot of directories for all levels of domain names] 
    99  
    100         * taskFile: 
    101  
    102     * special file containing execution details. It can be reused to update privoxy config from same sources with same options. 
     87  * privoxyDir: 
     88 
     89    * ab2p.system.action 
     90    * ab2p.action 
     91    * ab2p.system.filter 
     92    * ab2p.filter 
     93 
     94  * webDir: 
     95 
     96    * ab2p.common.css 
     97    * ab2p.css 
     98    * [lot of directories for all levels of domain names] 
     99 
     100  * taskFile: 
     101 
     102    * special file containing execution details. It can be reused to update privoxy config from same sources with same options. Its name is ``ab2p.task`` by default. 
    103103 
    104104How to apply results 
    105105-------------------- 
    106106 
    107 1. Install privoxy. Optionally setup it as transparent proxy 
    108  
    109 2. Change privoxy config file. Add following lines:: 
    110  
    111     actionsfile ab2p.system.action 
    112     actionsfile ab2p.action 
    113     filterfile ab2p.system.filter 
    114     filterfile ab2p.filter 
    115  
    116 3. Install nginx or apache webserver 
    117  
    118    Nginx config example:: 
    119  
    120     server { 
     107#. Install privoxy. Optionally setup it as transparent proxy. See `privoxy installation manual <http://www.privoxy.org/user-manual/installation.html>`_ for details. 
     108 
     109#. Change privoxy config file located in 
     110     
     111    * ``/etc/privoxy/config`` for linux 
     112    * ``C:\Program Files\Privoxy\config.txt`` for windows 
     113 
     114    Add following lines:: 
     115 
     116      actionsfile ab2p.system.action 
     117      actionsfile ab2p.action 
     118      filterfile ab2p.system.filter 
     119      filterfile ab2p.filter 
     120 
     121#. In order to make `Element hiding <https://adblockplus.org/filters#elemhide>`_ work you also need a webserver to serve CSS files. You can choose nginx, apache or any other webserver. 
     122   See `nginx installation manual <https://www.nginx.com/resources/wiki/start/topics/tutorials/install/>`_, 
     123   `apache on linux installation manual <https://httpd.apache.org/docs/2.4/install.html>`_ 
     124   or `apache on windows intallation manual <http://www.thesitewizard.com/apache/install-apache-2-windows.shtml>`_ for details. 
     125 
     126#. Change webserver config. In examples below 
     127 
     128   * replace ``www.example.com`` with your domain or IP address (equal to ``--domainCSS`` adblock2privoxy parameter) 
     129   * replace ``/var/www/privoxy`` with your CSS files location (equal to ``--webDir`` adblock2privoxy parameter) 
     130   * remember, these examples are simplified to use by unexperienced people. If you're familiar with webservers administration, you'll find better ways to apply these configs. 
     131 
     132   Nginx config: add following lines into http section of ``nginx.conf`` file 
     133 
     134    * for linus ``/etc/nginx/nginx.conf``  
     135    * for windows ``[nginx location]\conf\nginx.conf`` 
     136 
     137    :: 
     138 
     139      server { 
    121140            listen 80; 
    122             #ab2p css domain name (optional, should be equal to domainCSS parameter) 
     141            #ab2p css domain name (optional, should be equal to --domainCSS parameter) 
    123142            server_name www.example.com; 
    124143 
    125             #root = webDir parameter value 
     144            #root = --webDir parameter value 
    126145            root /var/www/privoxy; 
    127146 
    128147            location ~ ^/[^/.]+\..+/ab2p.css$ { 
    129                 # first reverse domain names order 
    130                         rewrite ^/([^/]*?)\.([^/.]+)(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?/ab2p.css$ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css last; 
     148                # first reverse domain names order 
     149          rewrite ^/([^/]*?)\.([^/.]+)(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?/ab2p.css$ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css last; 
    131150            } 
    132151 
    133152            location ~ (^.*/+)[^/]+/+ab2p.css { 
    134                 # then try to get CSS for current domain 
    135                 # if it is unavailable - get CSS for parent domain 
    136                 try_files $uri $1ab2p.css; 
     153                # then try to get CSS for current domain 
     154                # if it is unavailable - get CSS for parent domain 
     155                try_files $uri $1ab2p.css; 
    137156            } 
    138     } 
    139  
    140  
    141    Apache config example:: 
    142  
    143     <VirtualHost *:80> 
    144             #ab2p css domain name (optional, should be equal to domainCSS parameter) 
     157      } 
     158 
     159 
     160   Apache config: put following lines into 
     161    
     162    * for linux: ``/etc/apache2/sites-available/000-default.conf`` (replace existing content) 
     163    * for windows: ``C:\Program Files\Apache Group\Apache2\conf\httpd.conf`` (append to the end) 
     164    
     165    :: 
     166 
     167      <VirtualHost *:80> 
     168            #ab2p css domain name (optional, should be equal to --domainCSS parameter) 
    145169            ServerName www.example.com 
    146170 
    147             #root = webDir parameter value 
     171            #root = --webDir parameter value 
    148172            DocumentRoot /var/www/privoxy 
    149173 
     
    158182            RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f 
    159183            RewriteRule (^.*/+)[^/]+/+ab2p.css$ $1ab2p.css [N] 
    160     </VirtualHost> 
    161  
    162 4) Find out abdlock config files to use. Some download locations 
    163  
    164   * `EasyList <https://easylist.adblockplus.org/en/>`_ 
    165   * `Russian AD list <https://code.google.com/p/ruadlist/>`_ 
    166  
    167 5) Run adblock2privoxy providing privoxy dir, web dir, domain and adblock input file urls 
    168  
    169 6) Restart privoxy and apache to load updated configs 
    170  
    171 Clone repository from http://projects.zubr.me/adblock2privoxy.git 
     184      </VirtualHost> 
     185 
     186#. Get adblock2privoxy output 
     187 
     188     * Either run adblock2privoxy providing privoxy dir, web dir, domain and adblock input file urls such as  
     189 
     190       * `EasyList <https://easylist.adblockplus.org/en/>`_ 
     191       * `Russian AD list <https://code.google.com/p/ruadlist/>`_ 
     192       * and many others from `official adblock repository <https://easylist.adblockplus.org/en/>`_ 
     193 
     194     * Or just download processed lists from `downloads page <https://projects.zubr.me/wiki/adblock2privoxyDownloads>`_ and unpack ``privoxy`` to and ``web`` directories content into  
     195 
     196       * ``/var/www/privoxy`` and ``/var/www/privoxy`` for linux 
     197       * ``C:\Program Files\Privoxy`` and ``[your webserver directory]`` for windows 
     198 
     199#. Restart privoxy and webserver to load updated configs 
     200 
     201Contribution 
     202------------ 
     203 
     204* Clone repository from http://projects.zubr.me/adblock2privoxy.git. 
     205* `Report bugs <https://projects.zubr.me/newticket?project=adblock2privoxy>`_ 
  • adblock2privoxy/adblock2privoxy.cabal

    r433b59c ra2fcf33  
    11name:                adblock2privoxy 
    2 version:             1.4.1 
     2version:             1.4.2 
    33cabal-version:       >= 1.10 
    44build-type:          Simple 
    55tested-with: 
    6                      GHC==7.10.2 
     6                     GHC==7.10.3 
    77author:              Alexey Zubritsky <adblock2privoxy@zubr.me> 
    88data-files: 
     
    104104  location:  ​http://projects.zubr.me/adblock2privoxy.git 
    105105  subdir:    adblock2privoxy 
    106   tag:       1.4.1 
     106  tag:       1.4.2 
  • adblock2privoxy/changelog

    rff7ee56 ra2fcf33  
     11.4.2 
     2        * Fixed "commitBuffer: invalid argument (invalid character)" problem 
     3        * Fixed system.action file generation in case when no webserver is used 
     4        * Improved documentation 
     5 
     61.4.0 
     7        * Stack build envirionment and GHC 7.10 
     8        * Problem with network connections should be fixed because of new HTTPS library 
     9 
    1101.3.0 
    2                 * Build and packaging process refactoring 
    3                 * Build script for windows 
    4                 * Installation documentation 
    5                 * CSS server domain changed from hardcoded 'privoxy.zubr.me' to configurable one (ticket #1) 
    6                 * Element hiding CSS generation is skipped if the domain is not specified 
    7                 * Task files contains output paths, so it's possible to run ab2p with single parameter: task file name 
    8                 * Bugfixes for tickets #7, #8, #9 
     11        * Build and packaging process refactoring 
     12        * Build script for windows 
     13        * Installation documentation 
     14        * CSS server domain changed from hardcoded 'privoxy.zubr.me' to configurable one (ticket #1) 
     15        * Element hiding CSS generation is skipped if the domain is not specified 
     16        * Task files contains output paths, so it's possible to run ab2p with single parameter: task file name 
     17        * Bugfixes for tickets #7, #8, #9 
    9181.2.4 
    10             * Documentation and bugfixes 
     19        * Documentation and bugfixes 
    1120 
    12211.1.0 
  • adblock2privoxy/distribution/buildWin.bat

    re2b555c ra2fcf33  
    3434"%stack%" exec --no-ghc-package-path runhaskell -- Setup.hs build 
    3535"%stack%" exec --no-ghc-package-path runhaskell -- Setup.hs install 
     36 
     37cd "%prefix%\doc\*windows*\adblock2privoxy*" 
     38copy "%startpath%\README.rst" . 
     39copy "%startpath%\INSTALL.rst" . 
    3640CD "%prefix%" 
    3741 
  • adblock2privoxy/distribution/debbuild/DEBIAN/control

    r433b59c ra2fcf33  
    11Package:         adblock2privoxy 
    2 Version:         1.4.1 
     2Version:         1.4.2 
    33Depends:         libgmp10 
    44Architecture:    #ARCH# 
  • adblock2privoxy/distribution/makeDeb.sh

    re2b555c ra2fcf33  
    4141cd  $initialDir/result 
    4242echo "rename result" 
    43 version=${cat /etc/debian_version} 
    44 find . -name '*.deb' -exec sh -c 'mv "$0" "${0%.deb}.debian$version.deb"' {} \; 
     43version=$(lsb_release -sr) 
     44find . -name '*.deb' -exec sh -c 'mv "$0" "${0%.deb}.debian_$version.deb"' {} \; 
    4545 
    4646echo "Build is done." 
  • adblock2privoxy/distribution/rpmbuild/SPECS/adblock2privoxy.spec

    r433b59c ra2fcf33  
    11Name:    adblock2privoxy 
    2 Version: 1.4.1 
     2Version: 1.4.2 
    33Release: 1%{?dist} 
    44Summary: Convert adblock config files to privoxy format 
     
    66License: GPL-3 
    77URL:     https://projects.zubr.me/wiki/adblock2privoxy 
    8 Source0: http://hackage.haskell.org/package/adblock2privoxy-1.4.1/adblock2privoxy-1.4.1.tar.gz 
     8Source0: http://hackage.haskell.org/package/adblock2privoxy-1.4.2/adblock2privoxy-1.4.2.tar.gz 
    99Vendor:  Alexey Zubritskiy <adblock2privoxy@zubr.me> 
    1010Group:   Web 
     
    6666 
    6767%changelog 
    68 * Wed Dec 30 2015 Alexey Zubritskiy <adblock2privoxy@zubr.me> - 1.4.1 
    69 - Rpm release for version 1.4.1 (generated from cabal file) 
     68* Fri Feb 12 2016 Alexey Zubritskiy <adblock2privoxy@zubr.me> - 1.4.2 
     69- Rpm release for version 1.4.2 (generated from cabal file) 
  • adblock2privoxy/src/Main.hs

    re2b555c ra2fcf33  
    1515import System.IO 
    1616import Network 
     17import GHC.IO.Encoding 
    1718 
    1819getFileContent :: String -> IO String 
     
    5758main::IO() 
    5859main =  do 
     60        setLocaleEncoding utf8 
     61        setFileSystemEncoding utf8 
     62        setForeignEncoding utf8 
    5963        now <- getCurrentTime 
    6064        args <- getArgs 
  • adblock2privoxy/src/Templates.hs

    re2b555c ra2fcf33  
    3434        copySystem "ab2p.system.filter" 
    3535        where 
    36         filterDomain content = unlines $ filterLine <$> lns 
     36        filterDomain content = unlines . filter (not . null) $ filterLine <$> lns 
    3737                where 
    3838                lns = lines content 
  • adblock2privoxy/stack.yaml

    re2b555c ra2fcf33  
    22 
    33# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) 
    4 resolver: lts-3.18 
     4resolver: lts-5.2 
    55 
    66# Local packages, usually specified by relative directory name 
Note: See TracChangeset for help on using the changeset viewer.