Changeset a2fcf33 in adblock2privoxy for adblock2privoxy


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

Release 1.4.2

Location:
adblock2privoxy
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • 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.