adblock2privoxy
adblock2privoxy copied to clipboard
*nix installation instructions not working as written
The installation instructions for *nix (debian 12 specifically) did not work as written, constant issues with stack and dependency hell. I am also not familiar with Haskell; maybe a PEBKAC issue. I was able to finally compile from source and install it properly with ghcup though.
I ran the following (as root) to successfully compile and install.
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 sh
mkdir -p /usr/local/etc/adblock2privoxy
rsync -a ./adblock2privoxy* /usr/local/etc/adblock2privoxy
export PATH="/usr/bin:$PATH:/root/.ghcup/bin"
cd /usr/local/etc/adblock2privoxy/adblock2privoxy
cabal update
cabal install . --installdir /usr/local/bin --global
Using ghcup to install haskell instead of stack solved my issues of installation.
Same problem here, thanks for pointing out ghcup works.
Haven't tried stack with --snapshot option
Error: [S-4804] Stack failed to construct a build plan.
While constructing the build plan, Stack encountered the following errors. The 'Stack configuration' refers to the set of package versions specified
by the snapshot (after any dropped packages, or pruned GHC boot packages; if a boot package is replaced, Stack prunes all other such packages that
depend on it) and any extra-deps:
In the dependencies for adblock2privoxy-2.3.0:
* MissingH must match >=1.6.0 && <1.7, but MissingH-1.4.3.0 is in the Stack configuration (latest matching version is 1.6.0.1).
* containers must match >=0.6.7 && <0.7, but containers-0.6.5.1 is in the Stack configuration (latest matching version is 0.6.8).
* directory must match >=1.3.8 && <1.4, but directory-1.3.6.0 is in the Stack configuration (latest matching version is 1.3.8.3).
* filepath must match >=1.4.200 && <1.5, but filepath-1.4.2.1 is in the Stack configuration (latest matching version is 1.4.300.1).
* mtl must match >=2.3.1 && <2.4, but mtl-2.2.2 is in the Stack configuration (latest matching version is 2.3.1).
* network must match >=3.1.4 && <3.2, but network-3.1.1.1 is in the Stack configuration (latest matching version is 3.1.4.0).
* parsec must match >=3.1.16 && <3.2, but parsec-3.1.14.0 is in the Stack configuration (latest matching version is 3.1.17.0).
* strict must match >=0.5 && <0.6, but strict-0.4.0.1 is in the Stack configuration (latest matching version is 0.5).
* text must match >=2.0.2 && <2.1, but text-1.2.4.1 is in the Stack configuration (latest matching version is 2.0.2).
* time must match >=1.12.2 && <1.13, but time-1.9.3 is in the Stack configuration (latest matching version is 1.12.2).
The above is/are needed since adblock2privoxy is a build target.
@lhw365 If you haven't done so already, the commands I provided resulted in a successful installation
The following dependencies are required prior to running (for debian 12): rsync, git, libffi8, libgmp-dev, libgmp10, libncurses-dev, libncurses5, libtinfo5, build-essential, libffi-dev, zlib1g-dev
Same problem here, thanks for pointing out ghcup works.
Haven't tried stack with --snapshot option
Error: [S-4804] Stack failed to construct a build plan.
While constructing the build plan, Stack encountered the following errors. The 'Stack configuration' refers to the set of package versions specified by the snapshot (after any dropped packages, or pruned GHC boot packages; if a boot package is replaced, Stack prunes all other such packages that depend on it) and any extra-deps: In the dependencies for adblock2privoxy-2.3.0: * MissingH must match >=1.6.0 && <1.7, but MissingH-1.4.3.0 is in the Stack configuration (latest matching version is 1.6.0.1). * containers must match >=0.6.7 && <0.7, but containers-0.6.5.1 is in the Stack configuration (latest matching version is 0.6.8). * directory must match >=1.3.8 && <1.4, but directory-1.3.6.0 is in the Stack configuration (latest matching version is 1.3.8.3). * filepath must match >=1.4.200 && <1.5, but filepath-1.4.2.1 is in the Stack configuration (latest matching version is 1.4.300.1). * mtl must match >=2.3.1 && <2.4, but mtl-2.2.2 is in the Stack configuration (latest matching version is 2.3.1). * network must match >=3.1.4 && <3.2, but network-3.1.1.1 is in the Stack configuration (latest matching version is 3.1.4.0). * parsec must match >=3.1.16 && <3.2, but parsec-3.1.14.0 is in the Stack configuration (latest matching version is 3.1.17.0). * strict must match >=0.5 && <0.6, but strict-0.4.0.1 is in the Stack configuration (latest matching version is 0.5). * text must match >=2.0.2 && <2.1, but text-1.2.4.1 is in the Stack configuration (latest matching version is 2.0.2). * time must match >=1.12.2 && <1.13, but time-1.9.3 is in the Stack configuration (latest matching version is 1.12.2). The above is/are needed since adblock2privoxy is a build target.
I have quite a similar issue with a docker-based build. 2.2.0 worked wonderfully using the following (gitlab) build recipe: ab2p-builder.yml
2.3.0 cannot be built using any of the haskell: docker images, resulting in the same build plan errors.
What does work is cabal v2-install adblock2privoxy but that's not the same.
Thanks for posting these issues. There’s several meta-issues that are relevant:
- Indeed, the *nix instructions are years old and have not been updated, and neither has the Linux/rpm build pipeline. Updating all this would be worthwhile, but I think must roll in the considerations below.
- A straightforward
cabal install adblock2privoxyusing the latestcabalandghcversions works, as does, afaik, astackbuild. - In the modern web with modern browsers,
privoxy+adblock2privoxyisn’t going to do much without TLS inspection, a TLS-secured web server foradblock2privoxy’s CSS files, and more. All this requires an integrated secure setup with PKI management, a reverse proxy server, and possibly a PAC file served up on a LAN web server. Furthermore,privoxy’s http-inspection is hardcoded to use RSA2048 certificates, which really sloooooow things down. Fortunately, it’s trivial to patch theprivoxycode to use ECC certificates that offer significant speedups. - This modern
privoxy+adblock2privoxy+PKI+TLS-inspection+reverse-proxy is all implemented for macOS/BSD over at MacPorts. It works great and is fast. Here are the build/install/configuration details:
- https://github.com/macports/macports-ports/blob/master/www/privoxy/Portfile
- https://github.com/macports/macports-ports/blob/master/www/adblock2privoxy/Portfile
- This modern infrastructure on macOS hasn’t been ported to *nix. Doing this should take precedence over updating the *nix build commands for a tool that needs a lot more infrastructure to really work.
For anyone landing here. Just to mention that I have a Docker project that uses Privoxy + adblock2privoxy and works with HTTPS: https://github.com/Tardo/docker-privoxy-https
I don't know Haskell, but I've tried my best to compile this project in the best way possible: https://github.com/Tardo/docker-privoxy-https/blob/930c1a366dff0b4f087e922d08b327bbb5b01eee/Dockerfile#L40
Finally, thanks to those who maintain the adblock2privoxy project for their great work!