tor 2006-12-28 klockan 09:15 -0600 skrev King, John (Greg) (LMIT-HOU):
> How would I go about whitelisting the entire site based on referer? What
> I have now is the following and I am experiencing the situtation as
> described by Chris Robertson in a previous reply.
The helper needs to remeber that the site was whitelisted by Referer and
keep allowing requests within the site..
Here is a simple example:
## whitelist.pl ##
#!/usr/bin/perl -wl
use strict;
$|=1;
my %whitelist = ();
while(<>) {
my ($id, $site, $action) = split();
my $ret = "ERR";
if ($action eq "OK") {
$whitelist{$site} = 1;
}
$ret = "OK" if $whitelist{$site};
print "$id $ret\n";
}
## END ##
## squid.conf ##
external_acl_type whitelist children=1 concurrency=1024 %DST /path/to/whitelist.pl
acl do_whitelist external whitelist OK
acl is_whitelisted external whitelist CHECK
acl whitelist referer_regex ^http://[^/*]\.nettrekker\.com(:[0-9]*)?($|/)
http_access allow AllowedSites
http_access allow is_whitelisted
http_access allow whitelist do_whitelist
## END ##
The above should work, but hasn't been tested..
Note: squid-2.6 assumed. The above won't work in 2.5. It's possible to
solve in 2.5 as well using similar techniques, but not as easily..
Regards
Henrik
This archive was generated by hypermail pre-2.1.9 : Mon Jan 01 2007 - 12:00:01 MST