NAME
elsquid - EasyLists for Squid(Guard)
USAGE
elsquid [OPTIONS]
DESCRIPTION
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
Options can be used with a single '-' and can be abbreviated.
- --all
-
Same as --download --createlists --newdbfiles --permissions --reload.
- --Almost-all
-
Same as --all but without the download.
- --download
-
Download easylists from configured urls.
- --createlists
-
Process downloaded easylists and create squid(guard) domain/url/expression lists.
- --newdbfiles
-
Generate new squidguard database files for more performance.
- --permissions
-
Fix permissions/ownership (files must belong to proxy user).
- --reload
-
Reload squid.
- --squidguardconf
-
Dump suggested configuration snippets for Squid and SquidGuard.
- --exampleconf
-
Create an example /etc/elsquid.conf (unless there is already one present).
- --help
-
Print this page.
CONFIGURATION FILE
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:
Section [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
. executable
-
Full path to the squidGuard executable. Defaults to
/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 :-)
Section [squid]
reload_cmd
-
The command needed to reload the Squid service. Defaults to
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.
Section [easylists]
download_dir
-
Directory where the downloaded files go to. Defaults to
/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 :-)
Section [extra]
Here you can put additional domains/urls/expressions to block.
The following keys can be repeated:
domain
url
expression
Section [white]
Here you can put domains/urls/expressions you really don't want to block.
Same syntax as in [extra]
.
FILES
SEE ALSO
http://http://www.squidguard.org/, http://http://www.squid-cache.org/
AUTHOR
Axel Miesen <miesen@quadraginta-duo.de>