Changeset ff7ee56 in adblock2privoxy


Ignore:
Timestamp:
Jan 4, 2015 3:51:00 AM (5 years ago)
Author:
zubr <a@…>
Branches:
master
Children:
caed8ed
Parents:
b4685e7
Message:

Fixes and docs

Files:
16 edited

Legend:

Unmodified
Added
Removed
  • adblock2privoxy-utils/launches/adblock2privoxy (run file).launch

    rb4685e7 rff7ee56  
    11<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
    22<launchConfiguration type="net.sf.eclipsefp.haskell.debug.core.internal.launch.ExecutableHaskellLaunchDelegate"> 
    3 <stringAttribute key="EXTRA_ARGUMENTS" value="-p ../.out/privoxy -w ../.out/web -d pp.susu ../.data/cntblock.txt"/> 
     3<stringAttribute key="EXTRA_ARGUMENTS" value="-p ../.out/privoxy -w ../.out/web ../.data/cntblock.txt"/> 
    44<stringAttribute key="PROJECT_NAME" value="adblock2privoxy"/> 
    55<stringAttribute key="STANZA" value="adblock2privoxy"/> 
  • adblock2privoxy-utils/launches/adblock2privoxy (run web).launch

    rb4685e7 rff7ee56  
    11<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
    22<launchConfiguration type="net.sf.eclipsefp.haskell.debug.core.internal.launch.ExecutableHaskellLaunchDelegate"> 
    3 <stringAttribute key="EXTRA_ARGUMENTS" value="-p ../.out/privoxy -w ../.out/web -t ../.out/privoxy/ab2p.task https://easylist-downloads.adblockplus.org/easylist.txt https://easylist-downloads.adblockplus.org/easyprivacy.txt https://easylist-downloads.adblockplus.org/advblock.txt https://easylist-downloads.adblockplus.org/bitblock.txt https://easylist-downloads.adblockplus.org/cntblock.txt"/> 
     3<stringAttribute key="EXTRA_ARGUMENTS" value="-p ../.out/privoxy -w ../.out/web https://easylist-downloads.adblockplus.org/easylist.txt https://easylist-downloads.adblockplus.org/easyprivacy.txt https://easylist-downloads.adblockplus.org/advblock.txt https://easylist-downloads.adblockplus.org/bitblock.txt https://easylist-downloads.adblockplus.org/cntblock.txt"/> 
    44<stringAttribute key="PROJECT_NAME" value="adblock2privoxy"/> 
    55<stringAttribute key="STANZA" value="adblock2privoxy"/> 
  • adblock2privoxy-utils/launches/adblock2privoxy (task run).launch

    rb4685e7 rff7ee56  
    11<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
    22<launchConfiguration type="net.sf.eclipsefp.haskell.debug.core.internal.launch.ExecutableHaskellLaunchDelegate"> 
    3 <stringAttribute key="EXTRA_ARGUMENTS" value="-t ../.out/privoxy/ab2p.task -f"/> 
     3<stringAttribute key="EXTRA_ARGUMENTS" value="-d -t ../.out/privoxy/ab2p.task -f"/> 
    44<stringAttribute key="PROJECT_NAME" value="adblock2privoxy"/> 
    55<stringAttribute key="STANZA" value="adblock2privoxy"/> 
  • adblock2privoxy/INSTALL.rst

    rb4685e7 rff7ee56  
    1717 
    1818        * For Windows: you can download `MinGHC installer <https://s3.amazonaws.com/download.fpcomplete.com/minghc/minghc-7.8.3.exe>`_ (It includes GHC 7.8.3 compiler and Cabal) 
    19         * From Linux: Install Haskell platform from your distributive repository or follow the guide from http://fpcomplete.com 
     19        * From Linux: Install Haskell platform from your distributive repository or follow `the guide <http://www.stackage.org/install>`_ 
    20202. Obtain sources. You can  
    2121 
     
    3535 
    3636        * Use scripts from `distribution` folder 
    37         * Or do the same actions as for installing from sources, but use "--prefix=[package directory]" option on configure step. After that you put content of [package directory] to package or archive.  
     37        * Or do the same actions as for installing from sources, but use `--prefix=[package directory]` option on configure step. After that you put content of [package directory] to package or archive.  
    3838 
  • adblock2privoxy/README.rst

    r828fba4 rff7ee56  
    3737   
    3838Tested with privoxy version 3.0.21. 
    39 Element blocking feature requires a webserver to serve CSS files. See Nginx and Apache config examples provided. 
     39Element hiding feature requires a webserver to serve CSS files. See Nginx and Apache config examples provided. 
    4040 
    4141Description 
     
    4848Options 
    4949------- 
     50   
     51  -v         --version            
     52      Show version number 
     53  -p PATH    --privoxyDir=PATH     
     54      Privoxy config output path 
     55  -w PATH    --webDir=PATH        
     56      Css files output path 
     57  -d DOMAIN  --domainCSS=DOMAIN    
     58      Domain of CSS web server (required for Element Hide functionality) 
     59  -t PATH    --taskFile=PATH      
     60      Path to task file containing urls to process and options. 
     61  -f         --forced             
     62      Run even if no sources are expired 
    5063 
    51     -v, --version                
    52         show version number 
    53     -p PATH, --privoxyDir=PATH   
    54         privoxy config output path (required) 
    55     -w PATH, --webDir=PATH       
    56         css files output path (optional, privoxyDir is used by default) 
    57     -t PATH, --taskFile=PATH     
    58         path to task file containing urls to process 
    59     -f, --forced                 
    60         run even if no sources are expired 
     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 functionality become disabled (and no webserver is needed).  
     71 
     72domainCSS can contain just IP address if no CSS web server has no associated domain.   
    6173 
    6274Usage 
     
    6577Example of first run:: 
    6678 
    67     adblock2privoxy -p /etc/privoxy -w /var/www/privoxy -t my_ab2b.task https://easylist-downloads.adblockplus.org/easylist.txt https://easylist-downloads.adblockplus.org/advblock.txt my_custom.txt 
     79    adblock2privoxy -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 
    6880 
    6981Example of subsequent runs:: 
    7082 
    71     adblock2privoxy -p /etc/privoxy -w /var/www/privoxy -t my_ab2b.task 
     83    adblock2privoxy -t my_ab2b.task 
    7284 
    7385The app generates following files 
     
    8496                * ab2p.common.css 
    8597                * ab2p.css 
    86                 * [lot of directories for first level domain names]  
     98                * [lot of directories for all levels of domain names]  
    8799 
    88100        * taskFile: 
    89101 
    90     * special file containing execution details. It can be reused to update privoxy config from same sources.  
     102    * special file containing execution details. It can be reused to update privoxy config from same sources with same options.  
    91103 
    92104How to apply results 
     
    108120    server { 
    109121            listen 80; 
    110             #ab2p css domain name (optional) 
    111             server_name privoxy.zubr.me; 
     122            #ab2p css domain name (optional, should be equal to domainCSS parameter) 
     123            server_name www.example.com; 
    112124 
    113125            #root = webDir parameter value  
     
    130142 
    131143    <VirtualHost *:80> 
    132             #ab2p css domain name (optional) 
     144            #ab2p css domain name (optional, should be equal to domainCSS parameter) 
    133145            ServerName www.example.com  
    134146 
     
    153165  * `Russian AD list <https://code.google.com/p/ruadlist/>`_ 
    154166 
    155 5) Run adblock2privoxy providing privoxy dir, web dir and adblock input file urls 
     1675) Run adblock2privoxy providing privoxy dir, web dir, domain and adblock input file urls 
    156168 
    1571696) Restart privoxy and apache to load updated configs 
  • adblock2privoxy/changelog

    rb4685e7 rff7ee56  
    33                * Build script for windows 
    44                * Installation documentation 
    5                 * CSS server domain changed from hardcoded 'privoxy.zubr.me' to configurable one 
     5                * CSS server domain changed from hardcoded 'privoxy.zubr.me' to configurable one (ticket #1) 
    66                * Element hiding CSS generation is skipped if the domain is not specified 
    77                * Task files contains output paths, so it's possible to run ab2p with single parameter: task file name 
    8                 * Bugfixes for tickets  
     8                * Bugfixes for tickets #7, #8, #9 
    991.2.4 
    1010            * Documentation and bugfixes 
  • adblock2privoxy/src/InputParser.hs

    r6bfb8d3 rff7ee56  
    5555        deriving (Read,Show,Eq) 
    5656 
    57 -- primitive 
     57-- primitive  
    5858type Pattern = String 
    5959type Domain = String 
  • adblock2privoxy/src/Main.hs

    rb4685e7 rff7ee56  
    1717import Network.Socket 
    1818import System.Directory 
    19 import Control.Monad 
    2019 
    2120   
  • adblock2privoxy/src/ParsecExt.hs

    r828fba4 rff7ee56  
    1717import Data.Maybe 
    1818         
    19 -- parser should consume some input to prevent infinite loop 
     19-- parser should consume some input to prevent infinite loop  
    2020manyCases :: (Monoid a, Monoid st) => Parser a -> StateParser st a 
    2121manyCases p = do    acc <- get 
  • adblock2privoxy/src/PatternConverter.hs

    r6bfb8d3 rff7ee56  
    138138                             else [] 
    139139 
    140         -- TODO: process port as an url part 
     140        -- TODO: process port as an url part  
    141141        urlParts :: [StringStateParser (String,String,String)] 
    142142        urlParts = square3 proto (manyCases host) (oneCase query) 
  • adblock2privoxy/src/PolicyTree.hs

    r6bfb8d3 rff7ee56  
    2424showTree lvl (Node name value children)  
    2525    = concat $   
    26         [replicate (lvl * 2) ' ', "\"", name, "\" - ", (show value)] 
     26        [replicate (lvl * 2) ' ', "\"", name, "\" - ", show value] 
    2727        ++ (('\n':) <$> showTree (lvl + 1) <$> children) 
    2828 
     
    9898trimTree :: NodePolicy -> PolicyTree -> PolicyTree 
    9999trimTree trump (Node name policy children) = Node name policy childrenFiltered 
    100     where  
     100    where   
    101101    childrenFiltered = filter (not.redundantChild) childrenTrimmed 
    102102    childrenTrimmed = trimTree trump <$> children 
  • adblock2privoxy/src/ProgramOptions.hs

    rb4685e7 rff7ee56  
    4949     , Option "f" ["forced"] 
    5050         (NoArg (\ opts -> opts { _forced = True })) 
    51          "run even if no sources are expired" 
     51         "Run even if no sources are expired" 
    5252     ] 
    5353 
     
    6666        setDefaults opts = opts   
    6767 
    68 versionText :: String 
     68versionText :: String  
    6969versionText = "adblock2privoxy version " ++ showVersion version 
    7070 
  • adblock2privoxy/src/SourceInfo.hs

    rb4685e7 rff7ee56  
    7373lineComment :: Line -> String 
    7474lineComment (Line _ (Comment text)) = text 
    75 lineComment _ = "" 
     75lineComment _ = ""  
    7676 
    7777parseInfo :: String -> State SourceInfo () 
  • adblock2privoxy/src/Statistics.hs

    r828fba4 rff7ee56  
    2323 
    2424 
    25 getStat :: Line -> Stat-> Stat 
     25getStat :: Line -> Stat-> Stat  
    2626getStat  (Line _ Comment {} ) = increment "Comments" 
    2727getStat  (Line _ Error {}) = increment "Errors" 
  • adblock2privoxy/src/Task.hs

    rb4685e7 rff7ee56  
    1616            = [concat ["ERROR: ", recordSourceText position, " - ", text]] 
    1717        errorLine _ = [] 
    18     in do   
     18    in do    
    1919        outFile <- openFile filename WriteMode 
    2020        _ <- mapM (hPutStrLn outFile) info 
  • adblock2privoxy/src/UrlBlocker.hs

    rb4685e7 rff7ee56  
    1616import qualified Data.Map as Map 
    1717import Data.String.Utils (split) 
    18 import Data.Maybe    
     18import Data.Maybe     
    1919import System.IO   
    2020import System.FilePath 
Note: See TracChangeset for help on using the changeset viewer.