Access Control (ACL) helper for Squid and Screen Squid
IMPORTANT: If you are going to use this program and the Quotas module, you need to configure squid.conf.
This lines you need to add to conf: If your authorization by login:
#qouta acl section
external_acl_type e_block ttl=10 negative_ttl=10 %LOGIN /path/to/bin/go_quotablock -typedb mysql -u login -p pass -h host_of_db -n name_of_db -debug 4 -log /var/log/squid/quoteblock.log -ttl 300
acl a_block external e_block
A shorter record looks like this:
#qouta acl section
external_acl_type e_block ttl=10 negative_ttl=10 %LOGIN /path/to/bin/go_quotablock -u login -p pass -n name_of_db
acl a_block external e_block
Parameters
- typedb mysql
- h localhost
- debug 0
- log /var/log/squid/quoteblock.log
- ttl 300
will be set by default.
If your authorization by IP address:
#qouta acl section
external_acl_type e_block ttl=10 negative_ttl=10 %SRC /path/to/bin/go_quotablock -typedb postgres -u login -p pass -h host_of_db -n name_of_db -debug 4 -log /var/log/squid/quoteblock.log -ttl 300
acl a_block external e_block
If you do not have a golang, please use the installation instruction.
and next
git clone https://github.com/Rid-lin/go-quotablock.git
cd go-quotablock
Edit the makefile. Please enter valid values for:
*DIR =*
*PREFIX =*
*PROXY-USER =*
*PROXY-GROUP =*
where PROXY-USER and PROXY-GROUP is the name of the user and name of the group under which squid runs
make
make install
where squid is the name of the group under which squid runs
- The idea of implementation was taken from here .
- This material also came in handy
- Without translating directives for Squid, I would need more time
- Very simple log format description
Quota Squid Helper
Access Control (ACL) helper for Squid и Screen Squid
ВАЖНО: Если вы собираетесь использовать данную программу и модуль Quotas из программного проекта Screen Squid, Вам необходимо внести правки в squid.conf.
Эти строки необходимо добавить в конфигурацию
Если авторизация по логину:
#qouta acl section
external_acl_type e_block ttl=10 negative_ttl=10 %LOGIN /path/to/bin/go_quotablock [-typedb mysql] -u login -p pass -h host_of_db -n name_of_db [-debug 4] [-log /var/log/squid/quoteblock.log] [-ttl 300]
acl a_block external e_block
Более короткая запись будет выглядеть вот так:
#qouta acl section
external_acl_type e_block ttl=10 negative_ttl=10 %LOGIN /path/to/bin/go_quotablock -u login -p pass -n name_of_db
acl a_block external e_block
Параметры
- typedb mysql
- h localhost
- debug 0
- log /var/log/squid/quoteblock.log
- ttl 300
будут подставлены по-умолчанию.
Если авторизация по IP адресу:
#qouta acl section
external_acl_type e_block ttl=10 negative_ttl=10 %SRC /path/to/bin/go_quotablock -typedb postgres -u login -p pass -h host_of_db -n name_of_db [-debug 4] [-log /var/log/squid/quoteblock.log] [-ttl 300]
acl a_block external e_block
Если у Вас не установлен Golang, пожалуйста воспользуйтесь инструкцией по установке
и далее
git clone https://github.com/Rid-lin/go-quotablock.git
cd go-quotablock
Отредактируйте файл makefile. Укажите верные значения для:
*DIR =*
*PREFIX =*
*PROXY-USER =*
*PROXY-GROUP =*
где PROXY-USER и PROXY-GROUP имя пользователя и группы из-под которого запущен squid
make
make install
- Идея реализации была взята отсюда
- Так же пригодился этот материал
- Без перевода директив для Squid мне понадобилось бы больше времени
- Очень простое описание формата логов