elsquid - EasyLists for Squid(Guard)
elsquid [OPTIONS]
elsquid utilizes the EasyLists (https://easylist.github.io/) to create database files for central adblocking with Squid/SquidGuard. Amongst others, it can download and convert these lists, and install the resulting files.
All example configs, default settings, etc. were only tested under a Debian Jessie Linux system. But with appropriate adjustments in the config it should work with other distros, too.
Typically you will run this program as root. Feel free to audit the code before!
Options can be used with a single '-' and can be abbreviated.
Same as --download --createlists --newdbfiles --permissions --reload.
Same as --all but without the download.
Download easylists from configured urls.
Process downloaded easylists and create squid(guard) domain/url/expression lists.
Generate new squidguard database files for more performance.
Fix permissions/ownership (files must belong to proxy user).
Reload squid.
Dump suggested configuration snippets for Squid and SquidGuard.
Create an example /etc/elsquid.conf (unless there is already one present).
Print this page.
elsquid's configuration file is /etc/elsquid.conf.
Please create an example as a starting point with --exampleconf if you don't already have one.
The syntax is INI-style. It uses the following sections/directives:
[squidguard]
dbhome
Root of SquidGuards database hierarchy. Defaults to /var/lib/squidguard/db.
elsquid will put the generated files here, with the following hierarchy:
elsquid |-- black | |-- domains | |-- expressions | `-- urls `-- white |-- domains |-- expressions `-- urls
user
group
User and group of the Squid process. Used for chmod'ing the generated files. Defaults to proxy/proxy.
proxy
executable
Full path to the squidGuard executable. Defaults to /usr/bin/squidGuard.
/usr/bin/squidGuard
redirect_url
Redirect URL that is returned by squidGuard in case of blocking. This is only needed to dump an example config snippet. Defaults to http://192.168.1.2/blank.gif, which is probably not what you want :-)
http://192.168.1.2/blank.gif
[squid]
reload_cmd
The command needed to reload the Squid service. Defaults to systemctl reload squid3.
systemctl reload squid3
dstdomain_blacklist
elsquid also writes the domain blacklist into this file. This is intended for direct use with a Squid acl to get better results when blocking HTTPS-requests.
Defaults to /etc/squid3/elsquid-black.txt.
dstdomain_whitelist
Analogous to dstdomain_blacklist.
Defaults to /etc/squid3/elsquid-white.txt.
[easylists]
download_dir
Directory where the downloaded files go to. Defaults to /tmp.
/tmp
list_url
URL of an easylist to use. Can be repeated. No default here.
I personally use:
list_url = https://easylist-downloads.adblockplus.org/easylist.txt
list_url = https://easylist-downloads.adblockplus.org/easylistgermany.txt
The basenames of the urls have to be unique. If they're not... write me an e-mail :-)
[extra]
Here you can put additional domains/urls/expressions to block.
The following keys can be repeated:
domain
url
expression
[white]
Here you can put domains/urls/expressions you really don't want to block.
Same syntax as in [extra].
http://http://www.squidguard.org/, http://http://www.squid-cache.org/
Axel Miesen <miesen@quadraginta-duo.de>
To install App::elsquid, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::elsquid
CPAN shell
perl -MCPAN -e shell install App::elsquid
For more information on module installation, please visit the detailed CPAN module installation guide.