adblock2privoxy (www/adblock2privoxy) Updated: 1 year, 11 months ago Add to my watchlist

Convert adblock config files to privoxy format

Convert adblock config files to privoxy format. AdBlock 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. Privoxy proxy has good potential to block ads at server side, but it experiences acute shortage of updated block lists. This software converts adblock lists to privoxy config files format. Almost all adblock features are supported including block/unblock requests (on privoxy) all syntax features are supported except for regex templates matching host name hide/unhide page elements (via CSS) all syntax features are supported all block request options except for outdated ones: Supported: script, image, stylesheet, object, xmlhttprequest, object-subrequest, subdocument, document, elemhide, other, popup, third-party, domain=..., match-case, donottrack.

Version: 2.1.0 License: GPL-3 GitHub
Maintainers essandess
Categories www haskell
Platforms darwin
  • initialize_always (Always initialize all configuration files. Intended for development and troubleshooting only. Working deployments must disable this variant to prevent configuration files being overwritten at the next upgrade. Existing configuration files are not overwritten by default.)
  • stack (Use stack to build.)

"adblock2privoxy" depends on

run (3)
build (5)
lib (4)

Ports that depend on "adblock2privoxy"

Port notes

After initial installation, it is necessary to kickstart this launch daemon, which does not run at load:

sudo launchctl kickstart -k system/org.macports.adblock2privoxy

The blocklist URLs are specified in the file ${prefix}/etc/adblock2privoxy/adblock2privoxy_blocklist.txt.

Example production run:

adblock2privoxy -p ${prefix}/etc/adblock2privoxy/privoxy \
-w ${prefix}/etc/adblock2privoxy/css -d \
$(< ${prefix}/etc/adblock2privoxy/adblock2privoxy_blocklist.txt)

Update run:

adblock2privoxy -t ${prefix}/etc/adblock2privoxy/privoxy/ab2p.task

The CSS web server domain name or IP address is specified by the environment variables (with default values):


To change site-specific launchd environment variables, use the launchd plist:

${prefix}/share/adblock2privoxy/private.myserver.launchctl-setenv.plist Configure adblock2privoxy PKI by creating a certificate from e.g. Privoxy's certificate authority (CA). As sudo:

# Example, more likely use ${prefix}/etc/privoxy/CA
cp -R ${prefix}/etc/privoxy/ca.macports ca.adblock2privoxy \
&& cd ca.adblock2privoxy
cp ${prefix}/etc/adblock2privoxy/certs/openssl.cnf .
# edit openssl.cnf for your local organizationName, commonName, etc.

# initialize
touch index.txt
echo 1000 > serial

# Server certificates

# Server certificate encrypted key and decrypted key
openssl genpkey -out adblock2privoxy-nginx.key.pem \
-algorithm EC -pkeyopt ec_paramgen_curve:P-384 -aes256 \
-pass file:passphrase.txt
openssl ec -in adblock2privoxy-nginx.key.pem \
-passin file:passphrase.txt \
-out adblock2privoxy-nginx.key.pem.decrypted
chmod go-rwx adblock2privoxy-nginx.key.pem.decrypted

# Server certificate CSR
openssl req -config openssl.cnf -new -sha256 \
-extensions server_cert -key adblock2privoxy-nginx.key.pem \
-passin file:passphrase.txt \
-out adblock2privoxy-nginx.csr.pem -batch

# Server certificate (825 days maximum validity)
openssl ca -config openssl.cnf -days 825 -notext -md sha256 \
-extensions server_cert -in adblock2privoxy-nginx.csr.pem \
-out adblock2privoxy-nginx.cert.pem \
-passin file:passphrase.txt \
-subj '/CN=adblock2privoxy-nginx' -batch

# Server certificate chain of trust
cat adblock2privoxy-nginx.cert.pem ca.cert.pem \
> adblock2privoxy-nginx.chain.pem

# Server certificate and chain validity
openssl verify -CAfile ca.cert.pem adblock2privoxy-nginx.cert.pem
openssl verify -CAfile ca.cert.pem adblock2privoxy-nginx.chain.pem

# Install the adblock2privoxy PKI
cp -p ca.key.pem ca.cert.pem passphrase.txt \
adblock2privoxy-nginx.cert.pem adblock2privoxy-nginx.chain.pem \
adblock2privoxy-nginx.key.pem \
adblock2privoxy-nginx.key.pem.decrypted \
${prefix}/etc/adblock2privoxy/certs Startup items (named 'adblock2privoxy-nginx, adblock2privoxy') have been generated that will aid in starting adblock2privoxy with launchd. They are disabled by default. Execute the following command to start them, and to cause them to launch at startup:

sudo port load adblock2privoxy

Port Health:

Loading Port Health

Installations (30 days)


Requested Installations (30 days)