Changeset 80a88b2 in adblock2privoxy


Ignore:
Timestamp:
Mar 15, 2014 10:27:34 PM (6 years ago)
Author:
zubr <a@…>
Branches:
master
Children:
5479aa1
Parents:
899fa03
Message:

fixed cabal and readme

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • README

    r899fa03 r80a88b2  
     1Adblock2Privoxy 
    12Convert adblock config files to privoxy format 
    23 
    3 --- Introduction --- 
    4 AdBlock Plus browser plugin has great block list files provided by big community, 
    5 but it is client software and cannot work on a server as proxy. 
     4Introduction 
    65 
    7 Privoxy proxy has good potential to block ads at server side,  
    8 but it experiences acute shortage of updated block lists. 
     6AdBlock Plus browser plugin has great block list files provided by big community, but it is client software and cannot work on a server as proxy. 
    97 
    10 This software converts adblock lists to privoxy config files format.    
     8Privoxy proxy has good potential to block ads at server side, but it experiences acute shortage of updated block lists. 
     9 
     10This software converts adblock lists to privoxy config files format. 
    1111 
    1212Almost all adblock features are supported including 
     13 
    1314- block/unblock requests (on privoxy) 
    14   all syntax features are supported except for regex templates matching host name 
     15    all syntax features are supported except for regex templates matching host name 
    1516- hide/unhide page elements (via CSS) 
    16   all syntax features are supported 
     17    all syntax features are supported 
    1718- all block request options except for outdated ones: 
    18   Supported: script, image, stylesheet, object, xmlhttprequest, object-subrequest, subdocument,  
    19              document, elemhide, other, popup, third-party, domain=..., match-case, donottrack 
    20   Unsupported: collapse, background, xbl, ping and dtd 
    21    
    22 Tested with privoxy version 3.0.21. 
    23 Element blocking feature requires a webserver to serve CSS files. See Nginx and Apache config examples provided. 
     19    Supported: script, image, stylesheet, object, xmlhttprequest, object-subrequest, subdocument,document, elemhide, other, popup, third-party, domain=..., match-case, donottrack 
     20    Unsupported: collapse, background, xbl, ping and dtd 
     21     
     22Tested with privoxy version 3.0.21. Element blocking feature requires a webserver to serve CSS files. See Nginx and Apache config examples provided. 
    2423 
    25 --- Usage --- 
     24Usage 
    2625 
    2726adblock2privoxy [OPTION...] adblockFiles... 
     
    2928  -p PATH  --privoxyDir=PATH  privoxy config output path (required) 
    3029  -w PATH  --webDir=PATH      css files output path (optional, privoxyDir is used by default) 
    31    
    3230Example: adblock2privoxy -p /etc/privoxy -w /var/www/privoxy easylist.txt advblock.txt my_custom.txt 
    3331 
    34 --- How to apply results --- 
     32How to apply results 
    3533 
    36341) Install privoxy. Optionally setup it as transparent proxy 
     35 
    37362) Change privoxy config file: Add following lines 
    3837 
     
    4140filterfile ab2p.system.filter 
    4241filterfile ab2p.filter 
    43  
    44423) Install nginx or apache webserver 
    4543 
    4644Nginx config example: 
    4745 
    48         server { 
    49                 listen 80; 
    50                 #ab2p css domain name (optional) 
    51                 server_name privoxy.zubr.me; 
    52          
    53                 #root = webDir parameter value  
    54                 root /var/www/privoxy;  
    55          
    56                 location ~ ^/[^/.]+\..+/ab2p.css$ { 
    57                         # first reverse domain names order 
    58                                 rewrite ^/([^/]*?)\.([^/.]+)(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?/ab2p.css$ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css last; 
    59                 } 
    60          
    61                 location ~ (^.*/+)[^/]+/+ab2p.css { 
    62                         # then try to get CSS for current domain 
    63                         # if it is unavailable - get CSS for parent domain 
    64                         try_files $uri $1ab2p.css; 
    65                 }  
    66         } 
     46server { 
     47        listen 80; 
     48        #ab2p css domain name (optional) 
     49        server_name privoxy.zubr.me; 
    6750 
     51        #root = webDir parameter value  
     52        root /var/www/privoxy;  
     53 
     54        location ~ ^/[^/.]+\..+/ab2p.css$ { 
     55                # first reverse domain names order 
     56                        rewrite ^/([^/]*?)\.([^/.]+)(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?/ab2p.css$ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css last; 
     57        } 
     58 
     59        location ~ (^.*/+)[^/]+/+ab2p.css { 
     60                # then try to get CSS for current domain 
     61                # if it is unavailable - get CSS for parent domain 
     62                try_files $uri $1ab2p.css; 
     63        }  
     64} 
    6865Apache config example: 
    6966 
    70         <VirtualHost *:80> 
    71                 #ab2p css domain name (optional) 
    72                 ServerName www.example.com  
    73          
    74                 #root = webDir parameter value  
    75                 DocumentRoot /var/www/privoxy 
    76          
    77          
    78                 RewriteEngine on 
    79          
    80                 # first reverse domain names order 
    81                 RewriteRule ^/([^/]*?)\.([^/.]+)(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?/ab2p.css$ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css [N] 
    82          
    83                 # then try to get CSS for current domain 
    84                 # if it is unavailable - get CSS for parent domain 
    85                 RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f 
    86                 RewriteRule (^.*/+)[^/]+/+ab2p.css$ $1ab2p.css [N] 
    87         </VirtualHost> 
     67<VirtualHost *:80> 
     68        #ab2p css domain name (optional) 
     69        ServerName www.example.com  
    8870 
     71        #root = webDir parameter value  
     72        DocumentRoot /var/www/privoxy 
     73 
     74 
     75        RewriteEngine on 
     76 
     77        # first reverse domain names order 
     78        RewriteRule ^/([^/]*?)\.([^/.]+)(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?/ab2p.css$ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css [N] 
     79 
     80        # then try to get CSS for current domain 
     81        # if it is unavailable - get CSS for parent domain 
     82        RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f 
     83        RewriteRule (^.*/+)[^/]+/+ab2p.css$ $1ab2p.css [N] 
     84</VirtualHost> 
    89854) Download adblock config files. Some download locations 
    90 EasyList: https://easylist.adblockplus.org/en/ 
    91 Russian AD list: https://code.google.com/p/ruadlist/ 
     86EasyList: https://easylist.adblockplus.org/en/ 
     87Russian AD list: https://code.google.com/p/ruadlist/ 
    9288 
    93895) Run adblock2privoxy providing privoxy dir, web dir and adblock input files 
     90 
    94916) Restart privoxy and apache to load updated configs 
    9592 
    96   
     93Clone repository from ​http://projects.zubr.me/adblock2privoxy.git 
  • adblock2privoxy.cabal

    r899fa03 r80a88b2  
    11name:           adblock2privoxy 
    2 version:        1.0 
     2version:        1.0.0 
    33cabal-version:  >= 1.6 
    44build-type:     Simple 
     
    3131                                  document, elemhide, other, popup, third-party, domain=..., match-case, donottrack 
    3232                       Unsupported: collapse, background, xbl, ping and dtd 
    33 homepage:       http://zubr.me/ab2p/ 
     33homepage:       https://projects.zubr.me/wiki/adblock2privoxy 
    3434category:       Web 
    3535 
     
    3838  main-is:         Main.hs 
    3939  build-depends:    
    40                    base >= 4, 
     40                   base >= 4 && < 5, 
    4141                   parsec, 
    4242                   mtl, 
     
    6565                   SourceInfo 
    6666 
     67source-repository this 
     68                type:     git 
     69                location: ​http://projects.zubr.me/adblock2privoxy.git 
     70                tag:      1.0.0 
Note: See TracChangeset for help on using the changeset viewer.