Hinzugefügt:

* URL-Filter


git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@185 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2006-06-30 14:25:35 +00:00
parent f28d0ddc6d
commit 10e4f2395e
23 changed files with 12128 additions and 7 deletions

View File

@@ -33,4 +33,9 @@ HOME=/
find /var/log/logwatch/ -ctime +${LOGWATCH_KEEP=56} -exec rm -f '{}' ';'
# hddshutdown
00 * * * * /usr/local/bin/hddshutdown >/dev/null
00 * * * * /usr/local/bin/hddshutdown >/dev/null
# URL Filter
%nightly * 3-5 /var/ipfire/urlfilter/autoupdate/cron.daily
%weekly * 3-5 /var/ipfire/urlfilter/autoupdate/cron.weekly
%monthly * 3-5 * /var/ipfire/urlfilter/autoupdate/cron.monthly

View File

@@ -73,3 +73,12 @@ compress
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
/var/log/squidGuard/*.log {
weekly
rotate 4
copytruncate
compress
notifempty
missingok
}

View File

@@ -18,7 +18,8 @@ MaxSpareServers 2
StartServers 2
MaxClients 10
MaxRequestsPerChild 100
Port 444
Port 81
Listen 81
Listen 444
User nobody
Group nobody
@@ -44,7 +45,7 @@ RewriteRule .* - [F]
AuthName "Restricted"
AuthType Basic
AuthUserFile /var/ipfire/auth/users
require user admin
Require user admin
</DirectoryMatch>
ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/
<Directory /home/httpd/cgi-bin>

View File

@@ -0,0 +1,522 @@
#!/usr/bin/perl
#
# $Id: autoupdate.pl,v 1.0 2005/06/15 00:00:00 marco Exp $
#
use strict;
my $make_clean = 1;
my $swroot = "/var/ipfire";
my $target = "$swroot/urlfilter/download";
my $dbdir = "$swroot/urlfilter/blacklists";
my $sourceurlfile = "$swroot/urlfilter/autoupdate/autoupdate.urls";
my $updconffile = "$swroot/urlfilter/autoupdate/autoupdate.conf";
my $updflagfile = "$swroot/urlfilter/blacklists/.autoupdate.last";
my %cgiparams;
my %updatesettings;
my $blacklist_url;
my $blacklist_src;
my $source_url;
my $source_name;
my @source_urllist;
my $blacklist;
my $category;
my $exitcode = 1;
if (-e "$sourceurlfile")
{
open(FILE, $sourceurlfile);
@source_urllist = <FILE>;
close(FILE);
}
if (-e "$updconffile") { &readhash("$updconffile", \%updatesettings); }
if (@ARGV[0] =~ m@^(f|h)tt?ps?://@) { $updatesettings{'UPDATE_SOURCE'} = @ARGV[0]; }
if ($updatesettings{'UPDATE_SOURCE'} eq 'custom')
{
$blacklist_url=$updatesettings{'CUSTOM_UPDATE_URL'};
} else {
$blacklist_url=$updatesettings{'UPDATE_SOURCE'};
foreach (@source_urllist)
{
chomp;
$source_name = substr($_,0,rindex($_,","));
$source_url = substr($_,index($_,",")+1);
if ($blacklist_url eq $source_url) { $blacklist_src=$source_name; }
}
}
if ($blacklist_src eq '') { $blacklist_src="custom source URL"; }
$blacklist_url =~ s/\&/\\\&/;
$blacklist=substr($blacklist_url,rindex($blacklist_url,"/")+1);
if (($blacklist =~ /\?/) || (!($blacklist =~ /\.t(ar\.)?gz$/))) { $blacklist = 'blacklist.tar.gz'; }
$blacklist=$target.'/'.$blacklist;
unless ($blacklist_url eq '')
{
if (-d $target) { system("rm -rf $target"); }
system("mkdir $target");
system("/usr/bin/wget -o $target/wget.log -O $blacklist $blacklist_url");
if (-e $blacklist)
{
system("/bin/tar --no-same-owner -xzf $blacklist -C $target");
if (-d "$target/blacklists")
{
open(FILE, ">$target/update.conf");
flock FILE, 2;
print FILE "logdir $target\n";
print FILE "dbhome $target/blacklists\n\n";
foreach (<$target/blacklists/*>)
{
if ((-d $_) && ((-s "$_/domains") || (-s "$_/urls")))
{
$category=substr($_,rindex($_,"/")+1);
print FILE "dest $category {\n";
if (-s "$_/domains") { print FILE " domainlist $category/domains\n"; }
if (-s "$_/urls") { print FILE " urllist $category/urls\n"; }
print FILE "}\n\n";
}
}
print FILE "acl {\n";
print FILE " default {\n";
print FILE " pass none\n";
print FILE " }\n";
print FILE "}\n";
close FILE;
system("/usr/sbin/squidGuard -d -c $target/update.conf -C all");
system("cp -r $target/blacklists/* $dbdir");
system("chown -R nobody.nobody $dbdir");
foreach $category (<$dbdir/*>)
{
if (-d $category)
{
system("chmod 755 $category &> /dev/null");
foreach $blacklist (<$category/*>)
{
if (-f $blacklist){ system("chmod 644 $blacklist &> /dev/null"); }
if (-d $blacklist){ system("chmod 755 $blacklist &> /dev/null"); }
}
system("chmod 666 $category/*.db &> /dev/null");
}
}
system("touch $updflagfile");
system("chown nobody.nobody $updflagfile");
system("/usr/local/bin/restartsquid");
system("logger -t installpackage[urlfilter] \"URL filter blacklist - Update from $blacklist_src completed\"");
$exitcode = 0;
} else {
system("logger -t installpackage[urlfilter] \"URL filter blacklist - ERROR: Not a valid URL filter blacklist\"");
}
} else {
system("logger -t installpackage[urlfilter] \"URL filter blacklist - ERROR: Unable to retrieve blacklist from $blacklist_src\"");
}
} else {
system("logger -t installpackage[urlfilter] \"URL filter blacklist - ERROR: No update source defined\"");
}
if ((-d $target) && ($make_clean)) { system("rm -rf $target"); }
exit $exitcode;
# -------------------------------------------------------------------
sub readhash
{
my $filename = $_[0];
my $hash = $_[1];
my ($var, $val);
if (-e $filename)
{
open(FILE, $filename) or die "Unable to read file $filename";
while (<FILE>)
{
chop;
($var, $val) = split /=/, $_, 2;
if ($var)
{
$val =~ s/^\'//g;
$val =~ s/\'$//g;
# Untaint variables read from hash
$var =~ /([A-Za-z0-9_-]*)/; $var = $1;
$val =~ /([\w\W]*)/; $val = $1;
$hash->{$var} = $val;
}
}
close FILE;
}
}
# -------------------------------------------------------------------
#!/usr/bin/perl
#
# $Id: autoupdate.pl,v 1.0 2005/06/15 00:00:00 marco Exp $
#
use strict;
my $make_clean = 1;
my $swroot = "/var/ipfire";
my $target = "$swroot/urlfilter/download";
my $dbdir = "$swroot/urlfilter/blacklists";
my $sourceurlfile = "$swroot/urlfilter/autoupdate/autoupdate.urls";
my $updconffile = "$swroot/urlfilter/autoupdate/autoupdate.conf";
my $updflagfile = "$swroot/urlfilter/blacklists/.autoupdate.last";
my %cgiparams;
my %updatesettings;
my $blacklist_url;
my $blacklist_src;
my $source_url;
my $source_name;
my @source_urllist;
my $blacklist;
my $category;
my $exitcode = 1;
if (-e "$sourceurlfile")
{
open(FILE, $sourceurlfile);
@source_urllist = <FILE>;
close(FILE);
}
if (-e "$updconffile") { &readhash("$updconffile", \%updatesettings); }
if (@ARGV[0] =~ m@^(f|h)tt?ps?://@) { $updatesettings{'UPDATE_SOURCE'} = @ARGV[0]; }
if ($updatesettings{'UPDATE_SOURCE'} eq 'custom')
{
$blacklist_url=$updatesettings{'CUSTOM_UPDATE_URL'};
} else {
$blacklist_url=$updatesettings{'UPDATE_SOURCE'};
foreach (@source_urllist)
{
chomp;
$source_name = substr($_,0,rindex($_,","));
$source_url = substr($_,index($_,",")+1);
if ($blacklist_url eq $source_url) { $blacklist_src=$source_name; }
}
}
if ($blacklist_src eq '') { $blacklist_src="custom source URL"; }
$blacklist_url =~ s/\&/\\\&/;
$blacklist=substr($blacklist_url,rindex($blacklist_url,"/")+1);
if (($blacklist =~ /\?/) || (!($blacklist =~ /\.t(ar\.)?gz$/))) { $blacklist = 'blacklist.tar.gz'; }
$blacklist=$target.'/'.$blacklist;
unless ($blacklist_url eq '')
{
if (-d $target) { system("rm -rf $target"); }
system("mkdir $target");
system("/usr/bin/wget -o $target/wget.log -O $blacklist $blacklist_url");
if (-e $blacklist)
{
system("/bin/tar --no-same-owner -xzf $blacklist -C $target");
if (-d "$target/blacklists")
{
open(FILE, ">$target/update.conf");
flock FILE, 2;
print FILE "logdir $target\n";
print FILE "dbhome $target/blacklists\n\n";
foreach (<$target/blacklists/*>)
{
if ((-d $_) && ((-s "$_/domains") || (-s "$_/urls")))
{
$category=substr($_,rindex($_,"/")+1);
print FILE "dest $category {\n";
if (-s "$_/domains") { print FILE " domainlist $category/domains\n"; }
if (-s "$_/urls") { print FILE " urllist $category/urls\n"; }
print FILE "}\n\n";
}
}
print FILE "acl {\n";
print FILE " default {\n";
print FILE " pass none\n";
print FILE " }\n";
print FILE "}\n";
close FILE;
system("/usr/sbin/squidGuard -d -c $target/update.conf -C all");
system("cp -r $target/blacklists/* $dbdir");
system("chown -R nobody.nobody $dbdir");
foreach $category (<$dbdir/*>)
{
if (-d $category)
{
system("chmod 755 $category &> /dev/null");
foreach $blacklist (<$category/*>)
{
if (-f $blacklist){ system("chmod 644 $blacklist &> /dev/null"); }
if (-d $blacklist){ system("chmod 755 $blacklist &> /dev/null"); }
}
system("chmod 666 $category/*.db &> /dev/null");
}
}
system("touch $updflagfile");
system("chown nobody.nobody $updflagfile");
system("/usr/local/bin/restartsquid");
system("logger -t installpackage[urlfilter] \"URL filter blacklist - Update from $blacklist_src completed\"");
$exitcode = 0;
} else {
system("logger -t installpackage[urlfilter] \"URL filter blacklist - ERROR: Not a valid URL filter blacklist\"");
}
} else {
system("logger -t installpackage[urlfilter] \"URL filter blacklist - ERROR: Unable to retrieve blacklist from $blacklist_src\"");
}
} else {
system("logger -t installpackage[urlfilter] \"URL filter blacklist - ERROR: No update source defined\"");
}
if ((-d $target) && ($make_clean)) { system("rm -rf $target"); }
exit $exitcode;
# -------------------------------------------------------------------
sub readhash
{
my $filename = $_[0];
my $hash = $_[1];
my ($var, $val);
if (-e $filename)
{
open(FILE, $filename) or die "Unable to read file $filename";
while (<FILE>)
{
chop;
($var, $val) = split /=/, $_, 2;
if ($var)
{
$val =~ s/^\'//g;
$val =~ s/\'$//g;
# Untaint variables read from hash
$var =~ /([A-Za-z0-9_-]*)/; $var = $1;
$val =~ /([\w\W]*)/; $val = $1;
$hash->{$var} = $val;
}
}
close FILE;
}
}
# -------------------------------------------------------------------
#!/usr/bin/perl
#
# $Id: autoupdate.pl,v 1.0 2005/06/15 00:00:00 marco Exp $
#
use strict;
my $make_clean = 1;
my $swroot = "/var/ipfire";
my $target = "$swroot/urlfilter/download";
my $dbdir = "$swroot/urlfilter/blacklists";
my $sourceurlfile = "$swroot/urlfilter/autoupdate/autoupdate.urls";
my $updconffile = "$swroot/urlfilter/autoupdate/autoupdate.conf";
my $updflagfile = "$swroot/urlfilter/blacklists/.autoupdate.last";
my %cgiparams;
my %updatesettings;
my $blacklist_url;
my $blacklist_src;
my $source_url;
my $source_name;
my @source_urllist;
my $blacklist;
my $category;
my $exitcode = 1;
if (-e "$sourceurlfile")
{
open(FILE, $sourceurlfile);
@source_urllist = <FILE>;
close(FILE);
}
if (-e "$updconffile") { &readhash("$updconffile", \%updatesettings); }
if (@ARGV[0] =~ m@^(f|h)tt?ps?://@) { $updatesettings{'UPDATE_SOURCE'} = @ARGV[0]; }
if ($updatesettings{'UPDATE_SOURCE'} eq 'custom')
{
$blacklist_url=$updatesettings{'CUSTOM_UPDATE_URL'};
} else {
$blacklist_url=$updatesettings{'UPDATE_SOURCE'};
foreach (@source_urllist)
{
chomp;
$source_name = substr($_,0,rindex($_,","));
$source_url = substr($_,index($_,",")+1);
if ($blacklist_url eq $source_url) { $blacklist_src=$source_name; }
}
}
if ($blacklist_src eq '') { $blacklist_src="custom source URL"; }
$blacklist_url =~ s/\&/\\\&/;
$blacklist=substr($blacklist_url,rindex($blacklist_url,"/")+1);
if (($blacklist =~ /\?/) || (!($blacklist =~ /\.t(ar\.)?gz$/))) { $blacklist = 'blacklist.tar.gz'; }
$blacklist=$target.'/'.$blacklist;
unless ($blacklist_url eq '')
{
if (-d $target) { system("rm -rf $target"); }
system("mkdir $target");
system("/usr/bin/wget -o $target/wget.log -O $blacklist $blacklist_url");
if (-e $blacklist)
{
system("/bin/tar --no-same-owner -xzf $blacklist -C $target");
if (-d "$target/blacklists")
{
open(FILE, ">$target/update.conf");
flock FILE, 2;
print FILE "logdir $target\n";
print FILE "dbhome $target/blacklists\n\n";
foreach (<$target/blacklists/*>)
{
if ((-d $_) && ((-s "$_/domains") || (-s "$_/urls")))
{
$category=substr($_,rindex($_,"/")+1);
print FILE "dest $category {\n";
if (-s "$_/domains") { print FILE " domainlist $category/domains\n"; }
if (-s "$_/urls") { print FILE " urllist $category/urls\n"; }
print FILE "}\n\n";
}
}
print FILE "acl {\n";
print FILE " default {\n";
print FILE " pass none\n";
print FILE " }\n";
print FILE "}\n";
close FILE;
system("/usr/sbin/squidGuard -d -c $target/update.conf -C all");
system("cp -r $target/blacklists/* $dbdir");
system("chown -R nobody.nobody $dbdir");
foreach $category (<$dbdir/*>)
{
if (-d $category)
{
system("chmod 755 $category &> /dev/null");
foreach $blacklist (<$category/*>)
{
if (-f $blacklist){ system("chmod 644 $blacklist &> /dev/null"); }
if (-d $blacklist){ system("chmod 755 $blacklist &> /dev/null"); }
}
system("chmod 666 $category/*.db &> /dev/null");
}
}
system("touch $updflagfile");
system("chown nobody.nobody $updflagfile");
system("/usr/local/bin/restartsquid");
system("logger -t installpackage[urlfilter] \"URL filter blacklist - Update from $blacklist_src completed\"");
$exitcode = 0;
} else {
system("logger -t installpackage[urlfilter] \"URL filter blacklist - ERROR: Not a valid URL filter blacklist\"");
}
} else {
system("logger -t installpackage[urlfilter] \"URL filter blacklist - ERROR: Unable to retrieve blacklist from $blacklist_src\"");
}
} else {
system("logger -t installpackage[urlfilter] \"URL filter blacklist - ERROR: No update source defined\"");
}
if ((-d $target) && ($make_clean)) { system("rm -rf $target"); }
exit $exitcode;
# -------------------------------------------------------------------
sub readhash
{
my $filename = $_[0];
my $hash = $_[1];
my ($var, $val);
if (-e $filename)
{
open(FILE, $filename) or die "Unable to read file $filename";
while (<FILE>)
{
chop;
($var, $val) = split /=/, $_, 2;
if ($var)
{
$val =~ s/^\'//g;
$val =~ s/\'$//g;
# Untaint variables read from hash
$var =~ /([A-Za-z0-9_-]*)/; $var = $1;
$val =~ /([\w\W]*)/; $val = $1;
$hash->{$var} = $val;
}
}
close FILE;
}
}
# -------------------------------------------------------------------

View File

@@ -0,0 +1,9 @@
squidGuard,http://ftp.teledanmark.no/pub/www/proxy/squidGuard/contrib/blacklists.tar.gz
MESD,http://squidguard.mesd.k12.or.us/blacklists.tgz
Univ. Toulouse,ftp://ftp.univ-tlse1.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz
squidGuard,http://ftp.teledanmark.no/pub/www/proxy/squidGuard/contrib/blacklists.tar.gz
MESD,http://squidguard.mesd.k12.or.us/blacklists.tgz
Univ. Toulouse,ftp://ftp.univ-tlse1.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz
squidGuard,http://ftp.teledanmark.no/pub/www/proxy/squidGuard/contrib/blacklists.tar.gz
MESD,http://squidguard.mesd.k12.or.us/blacklists.tgz
Univ. Toulouse,ftp://ftp.univ-tlse1.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz

Binary file not shown.

View File

@@ -0,0 +1,159 @@
#!/usr/bin/perl
$swroot="/var/ipfire";
$logdir="/var/log/squidGuard";
$dbdir="/var/ipfire/urlfilter/blacklists";
print "Creating configuration file ";
foreach $blacklist (<$dbdir/*>)
{
if (-d $blacklist)
{
$lastslashpos = rindex($blacklist,"/");
$section = substr($blacklist,$lastslashpos+1);
push(@categories,$section);
}
}
open(FILE, ">$swroot/urlfilter/squidGuard.conf");
print FILE "logdir $logdir\n";
print FILE "dbhome $dbdir\n\n";
foreach $category (@categories)
{
print FILE "dest $category {\n";
if (-e "$dbdir/$category/domains") {
print FILE " domainlist $category\/domains\n";
}
if (-e "$dbdir/$category/urls") {
print FILE " urllist $category\/urls\n";
}
print FILE "}\n\n";
}
print FILE "acl {\n";
print FILE " default {\n";
print FILE " pass all\n";
print FILE " }\n";
print FILE "}\n";
close FILE;
print "\n";
print "Building blacklist databases ";
system("$swroot/urlfilter/bin/prebuild.pl");
print "\n";
print "Creating custom directories ";
mkdir("$dbdir/custom");
mkdir("$dbdir/custom/allowed");
mkdir("$dbdir/custom/blocked");
system("touch $dbdir/custom/allowed/domains");
system("touch $dbdir/custom/allowed/urls");
system("touch $dbdir/custom/blocked/domains");
system("touch $dbdir/custom/blocked/urls");
print "\n";
exit
#!/usr/bin/perl
$swroot="/var/ipfire";
$logdir="/var/log/squidGuard";
$dbdir="/var/ipfire/urlfilter/blacklists";
print "Creating configuration file ";
foreach $blacklist (<$dbdir/*>)
{
if (-d $blacklist)
{
$lastslashpos = rindex($blacklist,"/");
$section = substr($blacklist,$lastslashpos+1);
push(@categories,$section);
}
}
open(FILE, ">$swroot/urlfilter/squidGuard.conf");
print FILE "logdir $logdir\n";
print FILE "dbhome $dbdir\n\n";
foreach $category (@categories)
{
print FILE "dest $category {\n";
if (-e "$dbdir/$category/domains") {
print FILE " domainlist $category\/domains\n";
}
if (-e "$dbdir/$category/urls") {
print FILE " urllist $category\/urls\n";
}
print FILE "}\n\n";
}
print FILE "acl {\n";
print FILE " default {\n";
print FILE " pass all\n";
print FILE " }\n";
print FILE "}\n";
close FILE;
print "\n";
print "Building blacklist databases ";
system("$swroot/urlfilter/bin/prebuild.pl");
print "\n";
print "Creating custom directories ";
mkdir("$dbdir/custom");
mkdir("$dbdir/custom/allowed");
mkdir("$dbdir/custom/blocked");
system("touch $dbdir/custom/allowed/domains");
system("touch $dbdir/custom/allowed/urls");
system("touch $dbdir/custom/blocked/domains");
system("touch $dbdir/custom/blocked/urls");
print "\n";
exit
#!/usr/bin/perl
$swroot="/var/ipfire";
$logdir="/var/log/squidGuard";
$dbdir="/var/ipfire/urlfilter/blacklists";
print "Creating configuration file ";
foreach $blacklist (<$dbdir/*>)
{
if (-d $blacklist)
{
$lastslashpos = rindex($blacklist,"/");
$section = substr($blacklist,$lastslashpos+1);
push(@categories,$section);
}
}
open(FILE, ">$swroot/urlfilter/squidGuard.conf");
print FILE "logdir $logdir\n";
print FILE "dbhome $dbdir\n\n";
foreach $category (@categories)
{
print FILE "dest $category {\n";
if (-e "$dbdir/$category/domains") {
print FILE " domainlist $category\/domains\n";
}
if (-e "$dbdir/$category/urls") {
print FILE " urllist $category\/urls\n";
}
print FILE "}\n\n";
}
print FILE "acl {\n";
print FILE " default {\n";
print FILE " pass all\n";
print FILE " }\n";
print FILE "}\n";
close FILE;
print "\n";
print "Building blacklist databases ";
system("$swroot/urlfilter/bin/prebuild.pl");
print "\n";
print "Creating custom directories ";
mkdir("$dbdir/custom");
mkdir("$dbdir/custom/allowed");
mkdir("$dbdir/custom/blocked");
system("touch $dbdir/custom/allowed/domains");
system("touch $dbdir/custom/allowed/urls");
system("touch $dbdir/custom/blocked/domains");
system("touch $dbdir/custom/blocked/urls");
print "\n";
exit

View File

@@ -0,0 +1,96 @@
#!/usr/bin/perl
#
# This code is distributed under the terms of the GPL
#
# (c) written from scratch
#
# $Id: prebuild.pl,v 0.3 2005/04/16 00:00:00 marco Exp $
#
$dbdir="/var/ipfire/urlfilter/blacklists";
system("/usr/bin/squidGuard -C all");
if (-e "$dbdir/custom/allowed/domains.db") { unlink("$dbdir/custom/allowed/domains.db"); }
if (-e "$dbdir/custom/allowed/urls.db") { unlink("$dbdir/custom/allowed/urls.db"); }
if (-e "$dbdir/custom/blocked/domains.db") { unlink("$dbdir/custom/blocked/domains.db"); }
if (-e "$dbdir/custom/blocked/urls.db") { unlink("$dbdir/custom/blocked/urls.db"); }
system("chown -R nobody.nobody $dbdir");
foreach $category (<$dbdir/*>)
{
if (-d $category){
system("chmod 755 $category &> /dev/null");
foreach $blacklist (<$category/*>)
{
if (-f $blacklist){ system("chmod 644 $blacklist &> /dev/null"); }
if (-d $blacklist){ system("chmod 755 $blacklist &> /dev/null"); }
}
system("chmod 666 $category/*.db &> /dev/null");
}
}
#!/usr/bin/perl
#
# This code is distributed under the terms of the GPL
#
# (c) written from scratch
#
# $Id: prebuild.pl,v 0.3 2005/04/16 00:00:00 marco Exp $
#
$dbdir="/var/ipfire/urlfilter/blacklists";
system("/usr/bin/squidGuard -C all");
if (-e "$dbdir/custom/allowed/domains.db") { unlink("$dbdir/custom/allowed/domains.db"); }
if (-e "$dbdir/custom/allowed/urls.db") { unlink("$dbdir/custom/allowed/urls.db"); }
if (-e "$dbdir/custom/blocked/domains.db") { unlink("$dbdir/custom/blocked/domains.db"); }
if (-e "$dbdir/custom/blocked/urls.db") { unlink("$dbdir/custom/blocked/urls.db"); }
system("chown -R nobody.nobody $dbdir");
foreach $category (<$dbdir/*>)
{
if (-d $category){
system("chmod 755 $category &> /dev/null");
foreach $blacklist (<$category/*>)
{
if (-f $blacklist){ system("chmod 644 $blacklist &> /dev/null"); }
if (-d $blacklist){ system("chmod 755 $blacklist &> /dev/null"); }
}
system("chmod 666 $category/*.db &> /dev/null");
}
}
#!/usr/bin/perl
#
# This code is distributed under the terms of the GPL
#
# (c) written from scratch
#
# $Id: prebuild.pl,v 0.3 2005/04/16 00:00:00 marco Exp $
#
$dbdir="/var/ipfire/urlfilter/blacklists";
system("/usr/bin/squidGuard -C all");
if (-e "$dbdir/custom/allowed/domains.db") { unlink("$dbdir/custom/allowed/domains.db"); }
if (-e "$dbdir/custom/allowed/urls.db") { unlink("$dbdir/custom/allowed/urls.db"); }
if (-e "$dbdir/custom/blocked/domains.db") { unlink("$dbdir/custom/blocked/domains.db"); }
if (-e "$dbdir/custom/blocked/urls.db") { unlink("$dbdir/custom/blocked/urls.db"); }
system("chown -R nobody.nobody $dbdir");
foreach $category (<$dbdir/*>)
{
if (-d $category){
system("chmod 755 $category &> /dev/null");
foreach $blacklist (<$category/*>)
{
if (-f $blacklist){ system("chmod 644 $blacklist &> /dev/null"); }
if (-d $blacklist){ system("chmod 755 $blacklist &> /dev/null"); }
}
system("chmod 666 $category/*.db &> /dev/null");
}
}

View File

@@ -0,0 +1,24 @@
logdir /var/log/squidGuard
dbhome /var/ipfire/urlfilter/blacklists
acl {
default {
pass all
}
}
logdir /var/log/squidGuard
dbhome /var/ipfire/urlfilter/blacklists
acl {
default {
pass all
}
}
logdir /var/log/squidGuard
dbhome /var/ipfire/urlfilter/blacklists
acl {
default {
pass all
}
}