Changeset 86
- Timestamp:
- 09/11/25 17:57:24 (3 days ago)
- Location:
- trunk/uribl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/uribl/URIdb.pm
r81 r86 128 128 }) 129 129 or die "database inaccessible: ".$DBI::errstr; 130 # my $sth = $dbh->prepare("SELECT masklen,ipcount FROM autolist"); 131 # $sth->execute; 132 # while (my ($masklen,$ipcount) = $sth->fetchrow_array) { 133 # $autolist{$masklen} = $ipcount; 134 # } 130 my $sth = $dbh->prepare("SELECT key,value FROM misc"); 131 $sth->execute; 132 while (my ($key,$value) = $sth->fetchrow_array) { 133 $self->{misc}{$key} = $value; 134 } 135 $self->{misc}{blzone} = 'uribl.company.com' if !$self->{misc}{blzone}; 135 136 return $dbh; 136 137 } … … 186 187 my $sth; 187 188 189 ##fixme: should probably rejig this key to point to a FQDN rather than a "something that will get published under .dnsbl" 190 my $blzone = ($self->{misc}{blzone} ? $self->{misc}{blzone} : 'uri').".dnsbl"; 191 my $bladmin = ($self->{misc}{bladmin} ? $self->{misc}{bladmin} : 'systems.company.com'); 192 my $blttl = ($self->{misc}{ttl} ? $self->{misc}{ttl} : '900'); 193 ##fixme: should probably add some configuration strings for the nameserver value 194 188 195 if ($target eq 'rbldnsd') { 196 print $blfh "\$SOA 900 $blzone.dnsbl $bladmin 0 1200 600 600 900\n". 197 "\$NS 3600 127.0.0.1\n". 198 "\$TTL $blttl\n"; 189 199 print $blfh ":127.0.0.2:Domain found in reported missed-spam, no legitimate root or www content\n"; 190 200 $sth = $dbh->prepare("SELECT uri FROM urilist WHERE list=2"); -
trunk/uribl/export-uridb
r80 r86 29 29 use URIdb 2.0; 30 30 31 my $uridb = new URIdb;32 33 31 die "Usage: export-uridb <list> [type]\n" 34 32 if !$ARGV[0]; … … 42 40 $uridb->connect; 43 41 44 my %config;45 my $sth = $dbh->prepare("SELECT key,value FROM misc");46 $sth->execute;47 while (my ($key,$value) = $sth->fetchrow_array) {48 $config{$key} = $value;49 }50 51 print "\$SOA 900 ".($config{blzone} ? $config{blzone} : 'uri').".dnsbl systems.company.com 0 1200 600 600 900\n".52 "\$NS 3600 127.0.0.1\n".53 "\$TTL 900\n";54 55 42 $uridb->export($mode,*STDOUT); -
trunk/uribl/import-cur.pl
r84 r86 37 37 38 38 my $datesth = $dbh->prepare("UPDATE urilist SET added=? WHERE uri=?"); 39 40 my %config;41 my $sth = $dbh->prepare("SELECT key,value FROM misc");42 $sth->execute;43 while (my ($key,$value) = $sth->fetchrow_array) {44 $config{$key} = $value;45 }46 $config{blzone} = 'uribl.company.com' if !$config{blzone};47 39 48 40 my @months = ('null','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); -
trunk/uribl/uridb.cgi
r80 r86 74 74 $ENV{HTML_TEMPLATE_ROOT} = $templatedir; 75 75 76 my %config;77 my $sth = $dbh->prepare("SELECT key,value FROM misc");78 $sth->execute;79 while (my ($key,$value) = $sth->fetchrow_array) {80 $config{$key} = $value;81 }82 83 76 # decide which page to spit out... 84 77 if (!$webvar{page}) { … … 88 81 } 89 82 90 $page->param(pgtitle => $ config{pgtitle}) if defined($config{pgtitle});91 $page->param(pgcomment => $ config{pgcomment}) if defined($config{pgcomment});83 $page->param(pgtitle => $uridb->{cfg}{pgtitle}) if defined($uridb->{cfg}{pgtitle}); 84 $page->param(pgcomment => $uridb->{cfg}{pgcomment}) if defined($uridb->{cfg}{pgcomment}); 92 85 $page->param(cgiself => $cgiself); 93 86
Note:
See TracChangeset
for help on using the changeset viewer.