mirror of
https://github.com/casjaysdevdocker/squidguard
synced 2025-01-18 12:34:24 -05:00
🗃️ modified: bin/create-blocklists.sh 🗃️
This commit is contained in:
parent
1f4daa5587
commit
e72e1a4cb6
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
SQUID_USER="${SQUID_USER:-squid}"
|
SQUID_USER="${SQUID_USER:-squid}"
|
||||||
SQUID_LOG_DIR="${SQUID_LOG_DIR:-/data/log/squid}"
|
SQUID_LOG_DIR="${SQUID_LOG_DIR:-/data/log/squid}"
|
||||||
REDIRECT_URL="${REDIRECT_URL:-/}"
|
REDIRECT_URL="${REDIRECT_URL:-}"
|
||||||
BLOCKLIST="${BLOCKLIST:-https://github.com/casjay/resources/raw/main/files/shallalist.tar.gz}"
|
BLOCKLIST="${BLOCKLIST:-https://github.com/casjay/resources/raw/main/files/shallalist.tar.gz}"
|
||||||
BLOCKED_CATEGORIES="${BLOCKED_CATEGORIES:-adv,aggressive,porn,spyware,violence,warez}"
|
BLOCKED_CATEGORIES="${BLOCKED_CATEGORIES:-adv,aggressive,porn,spyware,violence,warez}"
|
||||||
|
|
||||||
@ -29,39 +29,11 @@ for CATEGORY in $(echo ${BLOCKED_CATEGORIES} | sed "s/,/ /g"); do
|
|||||||
echo "Category ${CATEGORY} not available!"
|
echo "Category ${CATEGORY} not available!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -r "/tmp/blocklist/${CATEGORY}" "${DB_LOCATION}/"
|
cp -r "/tmp/blocklist/${CATEGORY}" "${DB_LOCATION}/"
|
||||||
|
|
||||||
echo "dest ${CATEGORY} {" >>"${CONFIG_FILE}"
|
|
||||||
|
|
||||||
if [ -e "${DB_LOCATION}/${CATEGORY}/domains" ]; then
|
|
||||||
echo " domainlist ${CATEGORY}/domains" >>"${CONFIG_FILE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "${DB_LOCATION}/${CATEGORY}/urls" ]; then
|
|
||||||
echo " urllist ${CATEGORY}/urls" >>"${CONFIG_FILE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "${DB_LOCATION}/${CATEGORY}/expressions" ]; then
|
|
||||||
echo " expressionlist ${CATEGORY}/expressions" >>"${CONFIG_FILE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "}" >>"${CONFIG_FILE}"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
NOT_LIST="${BLOCKED_CATEGORIES//,/ !}"
|
NOT_LIST="${BLOCKED_CATEGORIES//,/ !}"
|
||||||
|
|
||||||
{
|
|
||||||
echo "acl {"
|
|
||||||
echo " default {"
|
|
||||||
echo " pass !${NOT_LIST} all"
|
|
||||||
echo " redirect $REDIRECT_URL"
|
|
||||||
echo " }"
|
|
||||||
echo "}"
|
|
||||||
} >>"${CONFIG_FILE}"
|
|
||||||
|
|
||||||
squidGuard -b -d -C all
|
|
||||||
|
|
||||||
chown -R ${SQUID_USER}:${SQUID_USER} "${DB_LOCATION}"
|
chown -R ${SQUID_USER}:${SQUID_USER} "${DB_LOCATION}"
|
||||||
chown -R ${SQUID_USER}:${SQUID_USER} "${LOG_LOCATION}"
|
chown -R ${SQUID_USER}:${SQUID_USER} "${LOG_LOCATION}"
|
||||||
chown -R ${SQUID_USER}:${SQUID_USER} "${CONFIG_FILE}"
|
chown -R ${SQUID_USER}:${SQUID_USER} "${CONFIG_FILE}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user