From 0a638396887db41f8a82574a103f84f2656af818 Mon Sep 17 00:00:00 2001 From: Maniacikarus Date: Wed, 3 Sep 2008 20:17:23 +0200 Subject: [PATCH] Upgrade updbooster to xlrator 2.0 added to core --- config/rootfiles/common/apache2 | 31 +- config/rootfiles/core/17/files | 7 +- config/updxlrator/checkup | 298 +++-- config/updxlrator/convert | 110 ++ config/updxlrator/download | 212 +++- config/updxlrator/lscache | 246 ++++ config/updxlrator/setperms | Bin 0 -> 5928 bytes config/updxlrator/updxlrator | 419 ++++--- html/cgi-bin/updatexlrator.cgi | 1040 ++++++++++++----- html/html/images/updbooster/updxl-globe.gif | Bin 0 -> 1124 bytes .../html/images/{ => updbooster}/updxl-gr.gif | Bin .../{ => updbooster}/updxl-led-blue.gif | Bin .../html/images/updbooster/updxl-led-gray.gif | Bin 0 -> 158 bytes .../{ => updbooster}/updxl-led-green.gif | Bin .../images/{ => updbooster}/updxl-led-red.gif | Bin .../{ => updbooster}/updxl-led-yellow.gif | Bin .../html/images/{ => updbooster}/updxl-rd.gif | Bin .../{ => updbooster}/updxl-src-adobe.gif | Bin .../images/updbooster/updxl-src-apple.gif | Bin 0 -> 1027 bytes .../images/updbooster/updxl-src-avast.gif | Bin 0 -> 1032 bytes .../images/{ => updbooster}/updxl-src-avg.gif | Bin .../{ => updbooster}/updxl-src-avira.gif | Bin .../{ => updbooster}/updxl-src-kaspersky.gif | Bin .../images/updbooster/updxl-src-linux.gif | Bin 0 -> 1045 bytes .../{ => updbooster}/updxl-src-symantec.gif | Bin .../updbooster/updxl-src-trendmicro.gif | Bin 0 -> 1040 bytes .../{ => updbooster}/updxl-src-unknown.gif | Bin .../images/updbooster/updxl-src-windows.gif | Bin 0 -> 1052 bytes .../html/images/{ => updbooster}/updxl-yl.gif | Bin html/html/images/updxl-src-apple.gif | Bin 1010 -> 0 bytes html/html/images/updxl-src-avast.gif | Bin 1117 -> 0 bytes html/html/images/updxl-src-windows.gif | Bin 1052 -> 0 bytes 32 files changed, 1689 insertions(+), 674 deletions(-) create mode 100644 config/updxlrator/convert create mode 100644 config/updxlrator/lscache create mode 100644 config/updxlrator/setperms create mode 100644 html/html/images/updbooster/updxl-globe.gif rename html/html/images/{ => updbooster}/updxl-gr.gif (100%) rename html/html/images/{ => updbooster}/updxl-led-blue.gif (100%) create mode 100644 html/html/images/updbooster/updxl-led-gray.gif rename html/html/images/{ => updbooster}/updxl-led-green.gif (100%) rename html/html/images/{ => updbooster}/updxl-led-red.gif (100%) rename html/html/images/{ => updbooster}/updxl-led-yellow.gif (100%) rename html/html/images/{ => updbooster}/updxl-rd.gif (100%) rename html/html/images/{ => updbooster}/updxl-src-adobe.gif (100%) create mode 100644 html/html/images/updbooster/updxl-src-apple.gif create mode 100644 html/html/images/updbooster/updxl-src-avast.gif rename html/html/images/{ => updbooster}/updxl-src-avg.gif (100%) rename html/html/images/{ => updbooster}/updxl-src-avira.gif (100%) rename html/html/images/{ => updbooster}/updxl-src-kaspersky.gif (100%) create mode 100644 html/html/images/updbooster/updxl-src-linux.gif rename html/html/images/{ => updbooster}/updxl-src-symantec.gif (100%) create mode 100644 html/html/images/updbooster/updxl-src-trendmicro.gif rename html/html/images/{ => updbooster}/updxl-src-unknown.gif (100%) create mode 100644 html/html/images/updbooster/updxl-src-windows.gif rename html/html/images/{ => updbooster}/updxl-yl.gif (100%) delete mode 100644 html/html/images/updxl-src-apple.gif delete mode 100644 html/html/images/updxl-src-avast.gif delete mode 100644 html/html/images/updxl-src-windows.gif diff --git a/config/rootfiles/common/apache2 b/config/rootfiles/common/apache2 index e45c856f5..61ba23fc6 100644 --- a/config/rootfiles/common/apache2 +++ b/config/rootfiles/common/apache2 @@ -1615,17 +1615,26 @@ srv/web/ipfire/html #srv/web/ipfire/html/images/stock_up-16.png #srv/web/ipfire/html/images/table-header.gif #srv/web/ipfire/html/images/up.gif -#srv/web/ipfire/html/images/updxl-gr.gif -#srv/web/ipfire/html/images/updxl-led-blue.gif -#srv/web/ipfire/html/images/updxl-led-green.gif -#srv/web/ipfire/html/images/updxl-led-red.gif -#srv/web/ipfire/html/images/updxl-led-yellow.gif -#srv/web/ipfire/html/images/updxl-rd.gif -#srv/web/ipfire/html/images/updxl-src-adobe.gif -#srv/web/ipfire/html/images/updxl-src-symantec.gif -#srv/web/ipfire/html/images/updxl-src-unknown.gif -#srv/web/ipfire/html/images/updxl-src-windows.gif -#srv/web/ipfire/html/images/updxl-yl.gif +#srv/web/ipfire/html/images/updbooster +#srv/web/ipfire/html/images/updbooster/updxl-globe.gif +#srv/web/ipfire/html/images/updbooster/updxl-led-gray.gif +#srv/web/ipfire/html/images/updbooster/updxl-led-yellow.gif +#srv/web/ipfire/html/images/updbooster/updxl-src-apple.gif +#srv/web/ipfire/html/images/updbooster/updxl-src-avira.gif +#srv/web/ipfire/html/images/updbooster/updxl-src-trendmicro.gif +#srv/web/ipfire/html/images/updbooster/updxl-yl.gif +#srv/web/ipfire/html/images/updbooster/updxl-gr.gif +#srv/web/ipfire/html/images/updbooster/updxl-led-green.gif +#srv/web/ipfire/html/images/updbooster/updxl-rd.gif +#srv/web/ipfire/html/images/updbooster/updxl-src-avast.gif +#srv/web/ipfire/html/images/updbooster/updxl-src-linux.gif +#srv/web/ipfire/html/images/updbooster/updxl-src-unknown.gif +#srv/web/ipfire/html/images/updbooster/updxl-led-blue.gif +#srv/web/ipfire/html/images/updbooster/updxl-led-red.gif +#srv/web/ipfire/html/images/updbooster/updxl-src-adobe.gif +#srv/web/ipfire/html/images/updbooster/updxl-src-avg.gif +#srv/web/ipfire/html/images/updbooster/updxl-src-symantec.gif +#srv/web/ipfire/html/images/updbooster/updxl-src-windows.gif #srv/web/ipfire/html/images/urlfilter #srv/web/ipfire/html/images/urlfilter/1x1.gif #srv/web/ipfire/html/images/urlfilter/bg_cool_tux.jpg diff --git a/config/rootfiles/core/17/files b/config/rootfiles/core/17/files index b682495cd..e8ebb2eb5 100644 --- a/config/rootfiles/core/17/files +++ b/config/rootfiles/core/17/files @@ -1,9 +1,12 @@ etc/squid etc/init.d/connectd -usr/lib/squid +usr/lib/squid/ usr/sbin/squid -srv/web/ipfire/cgi-bin/updatexlrator.cgi bin/ntfs-3g lib/libntfs-3g.so lib/libntfs-3g.so.36 lib/libntfs-3g.so.36.0.0 +srv/web/ipfire/html/images/updbooster +srv/web/ipfire/cgi-bin/updatexlrator.cgi +var/ipfire/updatexlrator/bin/ +usr/sbin/updxlrator diff --git a/config/updxlrator/checkup b/config/updxlrator/checkup index fc353f443..35c4953ed 100644 --- a/config/updxlrator/checkup +++ b/config/updxlrator/checkup @@ -2,102 +2,70 @@ # # This code is distributed under the terms of the GPL # -# (c) 2006 marco.s +# (c) 2006-2008 marco.s - http://update-accelerator.advproxy.net # -# $Id: checkup,v 1.0 2006/08/30 00:00:00 marco.s Exp $ +# $Id: checkup,v 2.0 2007/06/17 00:00:00 marco.s Exp $ # use strict; -use IO::Socket; use HTTP::Date; my $swroot='/var/ipfire'; -my $scriptpath=substr($0,0,rindex($0,"/")); my $apphome="/var/ipfire/updatexlrator"; my $logfile="/var/log/updatexlrator/checkup.log"; -my $debug=(-e "$apphome/debug"); -my $repository='/srv/web/ipfire/html/updatecache'; +my $repository='/var/updatecache'; +my $useragent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"; +my %proxysettings=(); my %xlratorsettings=(); my $download=0; my $updatefile=''; my $sourceurl=''; -my $remote_size=0; -my $local_size=0; -my $remote_mtime=0; -my $local_mtime=0; +my @sources=(); my @updatelist=(); -my @metadata=(); - -@updatelist = <$repository/*>; +my $logging=0; my $sfUnknown = "0"; my $sfOk = "1"; my $sfOutdated = "2"; +my $sfNoSource = "3"; if (-e "$swroot/updatexlrator/settings") { &readhash("$swroot/updatexlrator/settings", \%xlratorsettings); if ($xlratorsettings{'FULL_AUTOSYNC'} eq 'on') { $download=1; }; + if ($xlratorsettings{'ENABLE_LOG'} eq 'on') { $logging=1; }; } -foreach (@updatelist) +if (-e "$swroot/proxy/settings") { &readhash("$swroot/proxy/settings", \%proxysettings); } + +if (-e "$swroot/proxy/advanced/settings") { - if (!-d $_) + %proxysettings=(); + &readhash("$swroot/proxy/advanced/settings", \%proxysettings); +} + +foreach (<$repository/*>) +{ + if (-d $_) { - $updatefile = substr($_,rindex($_,"/")+1); - if (-e "$repository/metadata/$updatefile") + unless (/^$repository\/download$/) { push(@sources,$_); } + } +} + +foreach (@sources) +{ + @updatelist=<$_/*>; + foreach(@updatelist) + { + if (-e "$_/source.url") { - open (FILE,"$repository/metadata/$updatefile"); - @metadata = ; - close FILE; - chomp(@metadata); - $sourceurl = $metadata[0]; - - $remote_size = &getdownloadsize($sourceurl); - $local_size = (-s "$repository/$updatefile"); - - $remote_mtime = &getlastmod($sourceurl); - $local_mtime = &getmtime("$repository/$updatefile"); - - if ($remote_mtime eq 0) - { - $metadata[2] = $sfUnknown; - if ($debug) { &writelog("$updatefile - WARNING: Source not found"); } - print "$updatefile - WARNING: Source not found\n"; - } - elsif (($local_mtime eq $remote_mtime) && ($local_size == $remote_size)) - { - $metadata[2] = $sfOk; - $metadata[3] = time; - if ($debug) { &writelog("$updatefile"); } - print "$updatefile\n"; - } - else - { - $metadata[2] = $sfOutdated; - $metadata[3] = time; - if ($debug) { &writelog("$updatefile - WARNING: Out of date"); } - print "$updatefile - WARNING: Out of date\n"; - if ($download) - { - if ($debug) - { - 1 while $remote_size =~ s/^(-?\d+)(\d{3})/$1.$2/; - print "Please wait, retrieving file ($remote_size Byte) from source ..."; - `$scriptpath/../bin/wget -nd -nv -O $repository/$updatefile $sourceurl >>$logfile 2>&1`; - print "\n"; - } else - { - `$scriptpath/../bin/wget -nd -nv -O $repository/$updatefile $sourceurl 2>&1`; - } - $local_mtime = &getmtime("$repository/$updatefile"); - if ($local_mtime eq $remote_mtime) { $metadata[2] = $sfOk; } - } - } - open (FILE,">$repository/metadata/$updatefile"); - foreach (@metadata) { print FILE "$_\n"; } + open (FILE,"$_/source.url"); + $sourceurl=; close FILE; + chomp($sourceurl); + $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); + &checksource($_); } } } @@ -143,106 +111,108 @@ sub getmtime # ------------------------------------------------------------------- -sub getlastmod -{ - my $remote=0; - my @response=(); - my $lastmoddate=0; - - my $url = $_[0]; - - $url =~ s@^(.*)://([^/]*)@@; - - my $proto = $1; - my $fqhn = $2; - - if ((-e "$swroot/red/active") && ($proto eq 'http')) - { - $remote = IO::Socket::INET->new( - PeerHost => $fqhn, - PeerPort => 'http(80)', - Timeout => 1 - ); - } - - if ($remote) - { - print $remote "HEAD $url HTTP/1.0\n"; - print $remote "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\n"; - print $remote "Host: $fqhn\n"; - print $remote "Accept: */*\n\n"; - while (<$remote>) { push(@response,$_); } - close $remote; - if ($response[0] =~ /^HTTP\/\d+\.\d+\s\d+\sOK\s*$/) - { - foreach (@response) - { - if (/^Last-Modified: /i) - { - s/^Last-Modified: //i; - $lastmoddate=HTTP::Date::str2time($_); - } - } - } - } - return $lastmoddate; -} - -# ------------------------------------------------------------------- - -sub getdownloadsize -{ - my $remote=0; - my @response=(); - my $contentlength=0; - - my $url = $_[0]; - - $url =~ s@^(.*)://([^/]*)@@; - - my $proto = $1; - my $fqhn = $2; - - if ((-e "$swroot/red/active") && ($proto eq 'http')) - { - $remote = IO::Socket::INET->new( - PeerHost => $fqhn, - PeerPort => 'http(80)', - Timeout => 1 - ); - } - - if ($remote) - { - print $remote "HEAD $url HTTP/1.0\n"; - print $remote "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\n"; - print $remote "Host: $fqhn\n"; - print $remote "Accept: */*\n\n"; - while (<$remote>) { push(@response,$_); } - close $remote; - if ($response[0] =~ /^HTTP\/\d+\.\d+\s\d+\sOK\s*$/) - { - foreach (@response) - { - if (/^Content-Length: /i) - { - s/^Content-Length: //i; - $contentlength=int($_); - } - } - } - } - return $contentlength; -} - -# ------------------------------------------------------------------- - sub writelog { - open (LOGFILE,">>$logfile"); - my @now = localtime(time); - printf LOGFILE "%02d:%02d:%02d %s\n",$now[2],$now[1],$now[0],$_[0]; - close LOGFILE; + print "$_[0]\n"; + if ($logging) + { + open (LOGFILE,">>$logfile"); + my @now = localtime(time); + printf LOGFILE "%04d-%02d-%02d %02d:%02d:%02d %s\n",$now[5]+1900,$now[4]+1,$now[3],$now[2],$now[1],$now[0],$_[0]; + close LOGFILE; + } +} + +# ------------------------------------------------------------------- + +sub setcachestatus +{ + open (FILE,">$_[0]"); + print FILE "$_[1]\n"; + close FILE; +} + +# ------------------------------------------------------------------- + +sub checksource +{ + my @http_header=(); + my $http_result='000 n/a'; + my $returncode=0; + my $localfile=''; + my $remote_size=0; + my $remote_mtime=0; + my $login=''; + my $url=''; + my $cdir=$_[0]; + + open (FILE,"$cdir/source.url"); + $url=; + close FILE; + chomp($url); + + $localfile = $cdir . substr($url,rindex($url,'/'),length($url)); + + if (($proxysettings{'UPSTREAM_PROXY'}) && ($proxysettings{'UPSTREAM_USER'})) + { + $login = "--proxy-user=\"$proxysettings{'UPSTREAM_USER'}\""; + if ($proxysettings{'UPSTREAM_PASSWORD'}) + { + $login .= " --proxy-password=\"$proxysettings{'UPSTREAM_PASSWORD'}\""; + } + } + + $ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'}; + @http_header = `wget $login --user-agent="$useragent" --spider -S $url 2>&1`; + $ENV{'http_proxy'} = ''; + &writelog(@http_header); + + foreach (@http_header) + { + chomp; + if (/^\s*HTTP\/\d+\.\d+\s\d+\s+\w+/) { $http_result = $_; $http_result =~ s/^\s*HTTP\/\d+\.\d+\s+//; } + if (/^\s*Content-Length:\s/) { $remote_size = $_; $remote_size =~ s/[^0-9]//g; } + if (/^\s*Last-Modified:\s/) { $remote_mtime = $_; $remote_mtime =~ s/^\s*Last-Modified:\s//; $remote_mtime = HTTP::Date::str2time($remote_mtime) } + } + + &writelog($localfile); + &writelog("HTTP result: $http_result"); + &writelog("Source size: $remote_size"); + &writelog("Cached size: " . (-s $localfile)); + &writelog("Source time: $remote_mtime"); + &writelog("Cached time: " . getmtime($localfile)); + + if ($http_result =~ /\d+\s+OK$/) + { + if (($remote_size == -s $localfile) && ($remote_mtime == getmtime($localfile))) + { + &writelog("Status: Ok"); + &setcachestatus("$cdir/status",$sfOk); + } else { + &writelog("Status: Outdated"); + &setcachestatus("$cdir/status",$sfOutdated); + if ($download) + { + &writelog("Retrieving file from source: $remote_size bytes"); + $_ = system("wget $login --user-agent=\"$useragent\" -q -O $localfile $url"); + &writelog("Download finished with code: $_"); + if ($_ == 0) { &setcachestatus("$cdir/status",$sfOk); } + } + } + } else { + $_ = $http_result; + s/\D+//; + if ($_ eq '404') + { + &writelog("Status: No source"); + &setcachestatus("$cdir/status",$sfNoSource); + } else { + &writelog("Status: Error"); + &setcachestatus("$cdir/status",$sfUnknown); + } + } + + &setcachestatus("$cdir/checkup.log",time); } # ------------------------------------------------------------------- diff --git a/config/updxlrator/convert b/config/updxlrator/convert new file mode 100644 index 000000000..25cfae5b6 --- /dev/null +++ b/config/updxlrator/convert @@ -0,0 +1,110 @@ +#!/usr/bin/perl +# +# This code is distributed under the terms of the GPL +# +# (c) 2007-2008 marco.s - http://update-accelerator.advproxy.net +# +# $Id: convert,v 1.0 2007/09/12 00:00:00 marco.s Exp $ +# + +use strict; + +my $updcache='/var/updatecache/'; +my @metadata=(); +my $filename=''; +my $uuid=''; +my $vendorid=''; +my @cachedirs=qw(download); +my $i=0; +my $n=0; +my $verbose=1; +my $logging=1; +my $logfile="/var/log/updatexlrator/convert.log"; + +if (@ARGV[0] eq '-nv') { $verbose = 0; } +if (!-d "/var/log/updatexlrator") { $logging = 0; } + +&writelog("Converting cached objects from Update Accelerator 1.0 to 2.x"); +&writelog("------------------------------------------------------------"); + +(-d "$updcache/metadata") || die "No version 1.0 cache found.\n"; + +if (`ps --no-heading -C wget`) +{ + &writelog("WARNING: Download in progress"); + print "\n"; + system("killall -9 -i wget"); + print "\n"; +} + +foreach (<$updcache/metadata/*>) +{ + $filename = substr($_,rindex($_,'/')+1,length($_)); + if ((-f "$updcache/$filename") && (-f "$updcache/metadata/$filename")) + { + &writelog("$filename"); + open (FILE,$_); + @metadata = ; + close FILE; + chomp(@metadata); + if (@metadata >= 5) + { + $uuid = `echo $metadata[0] | md5sum`; + $uuid =~ s/[^0-9a-f]//g; + $uuid =~ s/([a-f\d]{8})([a-f\d]{4})([a-f\d]{4})([a-f\d]{4})([a-f\d]{12})/$1-$2-$3-$4-$5/; + $vendorid = $metadata[1]; + $vendorid =~ tr/A-Z/a-z/; + unless (-d "$updcache/$vendorid") + { + system("mkdir $updcache/$vendorid"); + push(@cachedirs,$vendorid); + } + system("chmod 775 $updcache/$vendorid"); + unless (-d "$updcache/$vendorid/$uuid") { system("mkdir $updcache/$vendorid/$uuid"); } + system("chmod 775 $updcache/$vendorid/$uuid"); + open (FILE,">$updcache/$vendorid/$uuid/source.url"); + print FILE "$metadata[0]\n"; + close FILE; + open (FILE,">$updcache/$vendorid/$uuid/status"); + print FILE "$metadata[2]\n"; + close FILE; + open (FILE,">$updcache/$vendorid/$uuid/checkup.log"); + print FILE "$metadata[3]\n"; + close FILE; + open (FILE,">$updcache/$vendorid/$uuid/access.log"); + for($i=4;$i<@metadata;$i++) + { + print FILE "$metadata[$i]\n"; + } + close FILE; + system("mv $updcache/$filename $updcache/$vendorid/$uuid"); + system("chmod 664 $updcache/$vendorid/$uuid/*"); + $n++; + } else { &writelog("WARNING: Insufficient metadata for $filename"); } + } +} + +if (($n) && (-d "$updcache/metadata")) { system("rm -r $updcache/metadata"); } + +foreach (@cachedirs) { system("chown -R nobody:squid $updcache/$_"); } + +if ($n) { &writelog("------------------------------------------------------------"); } + +$verbose=1; +&writelog("$n objects converted."); + +# ------------------------------------------------------------------- + +sub writelog +{ + if ($verbose) { print "$_[0]\n"; } + if ($logging) + { + open (LOGFILE,">>$logfile"); + my @now = localtime(time); + printf LOGFILE "%04d-%02d-%02d %02d:%02d:%02d %s\n",$now[5]+1900,$now[4]+1,$now[3],$now[2],$now[1],$now[0],$_[0]; + close LOGFILE; + } +} + +# ------------------------------------------------------------------- diff --git a/config/updxlrator/download b/config/updxlrator/download index 87bae3fc4..4330fcd4b 100644 --- a/config/updxlrator/download +++ b/config/updxlrator/download @@ -2,67 +2,199 @@ # # This code is distributed under the terms of the GPL # -# (c) 2006 marco.s +# (c) 2006-2008 marco.s - http://update-accelerator.advproxy.net # -# $Id: download,v 1.0 2006/08/30 00:00:00 marco.s Exp $ +# $Id: download,v 2.0 2008/04/06 00:00:00 marco.s Exp $ # use strict; +use HTTP::Date; +my $swroot='/var/ipfire'; +my $apphome="$swroot/updatexlrator"; my $logfile="/var/log/updatexlrator/download.log"; -my $debug = 1; -my $updcachedir="/var/updatecache"; -my $updfile=''; -my @metadata=(); +my $logging=0; +my $repository='/var/updatecache'; +my $login=''; +my $dlrate=''; +my $uuid=''; +my $wget="$apphome/bin/wget"; +my $useragent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"; +my %xlratorsettings=(); +my %proxysettings=(); +my @http_header=(); +my $remote_mtime=0; +my $updatefile=''; +my $unique=0; +my $mirror=1; my $sfOk="1"; -my $dsturl=@ARGV[0]; if ($dsturl eq '') { exit; } +my $vendorid = @ARGV[0]; if ($vendorid eq '') { exit; } +my $sourceurl = @ARGV[1]; if ($sourceurl eq '') { exit; } +my $cfmirror = @ARGV[2]; if ($cfmirror eq '') { exit; } -$dsturl =~ s@\%2f@/@ig; -$updfile = substr($dsturl,rindex($dsturl,"/")+1); +umask(0002); -# --------------------------------------------------------------- -# Retrieve file -# --------------------------------------------------------------- +$sourceurl =~ s@\%2f@/@ig; +$sourceurl =~ s@\%7e@~@ig; +$updatefile = substr($sourceurl,rindex($sourceurl,"/")+1); +$updatefile =~ s@\%20@ @ig; +$vendorid =~ tr/A-Z/a-z/; -if ($debug) +unless (-d "$repository/download/$vendorid") { - &writelog("Retrieving file for local cache: $updfile"); - `/usr/bin/wget -nc -nd -nv -P $updcachedir/download $dsturl >>$logfile 2>&1`; -} else -{ - `/usr/bin/wget -nc -nd -nv -P $updcachedir/download $dsturl 2>&1`; + system("mkdir $repository/download/$vendorid"); + system("$apphome/bin/setperms download/$vendorid"); } -if ($debug) { &writelog("Moving file into the cache directory -> \"$updcachedir/$updfile\""); } -system("mv $updcachedir/download/$updfile $updcachedir"); +exit if (-e "$repository/download/$vendorid/$updatefile"); -# --------------------------------------------------------------- -# Write metadata -# --------------------------------------------------------------- +system("touch $repository/download/$vendorid/$updatefile"); -if ($debug) { &writelog("Writing metadata \"$updcachedir/metadata/$updfile\""); } +if ($cfmirror) +{ + $uuid = `echo $updatefile | md5sum`; +} else { + $uuid = `echo $sourceurl | md5sum`; +} -open(FILE,"$updcachedir/metadata/$updfile"); -@metadata = ; -close(FILE); -chomp @metadata; -$metadata[2]="$sfOk"; -$metadata[3]=time; -open(FILE,">$updcachedir/metadata/$updfile"); -foreach (@metadata) { print FILE "$_\n"; } -print FILE time."\n"; -close(FILE); +$uuid =~ s/[^0-9a-f]//g; +$uuid =~ s/([a-f\d]{8})([a-f\d]{4})([a-f\d]{4})([a-f\d]{4})([a-f\d]{12})/$1-$2-$3-$4-$5/; -# =============================================================== +if (-e "$swroot/updatexlrator/settings") +{ + &readhash("$swroot/updatexlrator/settings", \%xlratorsettings); + if ($xlratorsettings{'ENABLE_LOG'} eq 'on') { $logging=1; }; + if ($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') { $dlrate = "--limit-rate=" . int($xlratorsettings{'MAX_DOWNLOAD_RATE'} / 8) . "k" }; +} + +if (-e "$swroot/proxy/settings") { &readhash("$swroot/proxy/settings", \%proxysettings); } + +if (-e "$swroot/proxy/advanced/settings") +{ + %proxysettings=(); + &readhash("$swroot/proxy/advanced/settings", \%proxysettings); +} + +if (($proxysettings{'UPSTREAM_PROXY'}) && ($proxysettings{'UPSTREAM_USER'})) +{ + $login = "--proxy-user=\"$proxysettings{'UPSTREAM_USER'}\""; + if ($proxysettings{'UPSTREAM_PASSWORD'}) + { + $login .= " --proxy-password=\"$proxysettings{'UPSTREAM_PASSWORD'}\""; + } +} + +if ($xlratorsettings{'MAX_DOWNLOAD_RATE'} eq '') +{ + &writelog("Retrieving file for local cache: $updatefile"); +} else { + &writelog("Retrieving file for local cache at max. " . $xlratorsettings{'MAX_DOWNLOAD_RATE'} . " kBit/s: $updatefile"); +} + +$ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'}; +@http_header = `$wget $login --user-agent="$useragent" --spider -S $sourceurl 2>&1`; +$ENV{'http_proxy'} = ''; + +foreach (@http_header) +{ + chomp; + if (/^\s*Content-Length:\s/) { s/[^0-9]//g; &writelog("Remote file size: $_ bytes"); } + if (/^\s*Last-Modified:\s/) { s/^\s*Last-Modified:\s//; $remote_mtime = HTTP::Date::str2time($_); &writelog("Remote file date: $_"); } +} + +$ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'}; +unlink "$repository/download/$vendorid/$updatefile"; +$_ = system("$wget $login $dlrate --user-agent=\"$useragent\" -q -nc -P $repository/download/$vendorid $sourceurl"); +$ENV{'http_proxy'} = ''; + +if ($_ == 0) +{ + &writelog("Download finished with result code: OK"); + + unless (-d "$repository/$vendorid") + { + system("mkdir $repository/$vendorid"); + system("$apphome/bin/setperms $vendorid"); + } + + unless (-d "$repository/$vendorid/$uuid") + { + system("mkdir $repository/$vendorid/$uuid"); + system("$apphome/bin/setperms $vendorid/$uuid"); + } + + &writelog("Moving file to the cache directory: $vendorid/$uuid"); + $updatefile =~ s@ @\\ @ig; + system("mv $repository/download/$vendorid/$updatefile $repository/$vendorid/$uuid"); + # Workaround for IPCop's mv bug: + utime time,$remote_mtime,"$repository/$vendorid/$uuid/$updatefile"; + $updatefile =~ s@\\ @ @ig; + + &setcachestatus("$repository/$vendorid/$uuid/source.url",$sourceurl); + &setcachestatus("$repository/$vendorid/$uuid/status",$sfOk); + &setcachestatus("$repository/$vendorid/$uuid/checkup.log",time); + &setcachestatus("$repository/$vendorid/$uuid/access.log",time); + + system("$apphome/bin/setperms $vendorid/$uuid/*"); + +} else { + &writelog("Download finished with result code: ERROR"); + if (-e "$repository/download/$vendorid/$updatefile") { unlink ("$repository/download/$vendorid/$updatefile"); } +} + + +# ------------------------------------------------------------------- + +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 () + { + 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; + } +} + +# ------------------------------------------------------------------- sub writelog { - open (LOGFILE,">>$logfile"); - my @now = localtime(time); - printf LOGFILE "%02d:%02d:%02d %s\n",$now[2],$now[1],$now[0],$_[0]; - close LOGFILE; + if ($logging) + { + open (LOGFILE,">>$logfile"); + my @now = localtime(time); + printf LOGFILE "%04d-%02d-%02d %02d:%02d:%02d [%d] %s\n",$now[5]+1900,$now[4]+1,$now[3],$now[2],$now[1],$now[0],$$,$_[0]; + close LOGFILE; + } } -# =============================================================== +# ------------------------------------------------------------------- + +sub setcachestatus +{ + open (FILE,">$_[0]"); + print FILE "$_[1]\n"; + close FILE; +} + +# ------------------------------------------------------------------- diff --git a/config/updxlrator/lscache b/config/updxlrator/lscache new file mode 100644 index 000000000..b25339f82 --- /dev/null +++ b/config/updxlrator/lscache @@ -0,0 +1,246 @@ +#!/usr/bin/perl +# +# This code is distributed under the terms of the GPL +# +# (c) 2006-2008 marco.s - http://update-accelerator.advproxy.net +# +# $Id: lscache,v 1.0 2007/09/11 00:00:00 marco.s Exp $ +# + +use strict; +use Getopt::Std; + +my $swroot='/var/ipfire'; +my $apphome="$swroot/updatexlrator"; +my $repository='/var/updatecache'; +my $updatefile=''; +my $sourceurl=''; +my $filesize=0; +my $totalfilesize=0; +my $cachedtraffic=0; +my @updatelist=(); +my @sources=(); +my @requests=(); +my @filelist=(); +my $objectdir=''; +my @tmp; +my $counts=0; +my $filedate; +my $lastaccess; +my $vendorid; +my @vendors=(); +my $numfiles=0; +my $cachehits=0; +my $efficiency='0.0'; +my %vendorstats=(); +my $maxlength_filesize=0; +my $maxlength_request=0; +my $maxlength_vendorid=0; + + +getopts('adfs'); + +foreach (<$repository/*>) +{ + if (-d $_) + { + unless ((/^$repository\/download$/) || (/^$repository\/lost\+found$/)) { push(@sources,$_); } + } +} + +foreach (@sources) +{ + $vendorid=substr($_,rindex($_,'/')+1,length($_)); + push(@vendors,$vendorid); + @updatelist=<$_/*>; + foreach $objectdir (@updatelist) + { + if (-e "$objectdir/source.url") + { + open (FILE,"$objectdir/source.url"); + $sourceurl=; + close FILE; + chomp($sourceurl); + $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); + # + # Get filesize and calculate max length for output + # + $filesize = (-s "$objectdir/$updatefile"); + if (length($filesize) > $maxlength_filesize) { $maxlength_filesize = length($filesize); } + # + # Total file size + # + $totalfilesize += $filesize; + # + # File size for this source + # + $vendorstats{$vendorid . "_filesize"} += $filesize; + # + # Number of requests from cache for this source + # + open (FILE,"$objectdir/access.log"); + @requests=; + close FILE; + chomp(@requests); + $counts = @requests; + $counts--; + $vendorstats{$vendorid . "_requests"} += $counts; + $cachehits += $counts; + # + # Calculate cache hits max length for output + # + if (length($cachehits) > $maxlength_request) { $maxlength_request = length($cachehits); } + # + # Get last cache access date + # + my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($requests[-1]); + $DAYdt = sprintf ("%.02d",$DAYdt); + $MONTHdt = sprintf ("%.02d",$MONTHdt+1); + $YEARdt = sprintf ("%.04d",$YEARdt+1900); + if (($counts) && ($requests[-1] =~ /^\d+/) && ($requests[-1] >= 1)) + { + $lastaccess = $YEARdt."-".$MONTHdt."-".$DAYdt; + } else { + $lastaccess = ' '; + } + # + # Get file modification time + # + ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime(&getmtime("$objectdir/$updatefile")); + $DAYdt = sprintf ("%.02d",$DAYdt); + $MONTHdt = sprintf ("%.02d",$MONTHdt+1); + $YEARdt = sprintf ("%.04d",$YEARdt+1900); + $filedate = $YEARdt."-".$MONTHdt."-".$DAYdt; + # + # Total number of files in cache + # + $numfiles++; + # + # Number of files for this source + # + $vendorstats{$vendorid . "_files"}++; + # + # Count cache status occurences + # + open (FILE,"$objectdir/status"); + $_=; + close FILE; + chomp; + $vendorstats{$vendorid . "_" . $_}++; + # + # Calculate cached traffic for this source + # + $vendorstats{$vendorid . "_cachehits"} += $counts * $filesize; + # + # Calculate total cached traffic + # + $cachedtraffic += $counts * $filesize; + # + # Calculate vendor ID max length for output + # + if (length($vendorid) > $maxlength_vendorid) { $maxlength_vendorid = length($vendorid); } + # + # Add record to filelist + # + push (@filelist,"$filesize;$filedate;$counts;$lastaccess;$vendorid;$objectdir;$updatefile"); + } + } +} + +@filelist || die "No matching files found in cache\n"; + +# +# Process statistics for output +# + +if ($Getopt::Std::opt_s) +{ + foreach (@vendors) + { + print "$_\n"; + printf "%5d %s", $vendorstats{$_ . "_files"}, "files in cache\n"; + printf "%5d %s", $vendorstats{$_ . "_requests"}, "files from cache\n"; + printf "%5d %s", $vendorstats{$_ . "_1"}, "files 'Ok'\n"; + printf "%5d %s", $vendorstats{$_ . "_3"}, "files 'No source'\n"; + printf "%5d %s", $vendorstats{$_ . "_2"}, "files 'Outdated'\n"; + printf "%5d %s", $vendorstats{$_ . "_0"}, "files 'Unknown'\n"; + unless ($vendorstats{$_ . "_filesize"}) { $vendorstats{$_ . "_filesize"} = '0'; } + 1 while $vendorstats{$_ . "_filesize"} =~ s/^(-?\d+)(\d{3})/$1.$2/; + printf "%15s %s", $vendorstats{$_ . "_filesize"}, "bytes in cache\n"; + unless ($vendorstats{$_ . "_cachehits"}) { $vendorstats{$_ . "_cachehits"} = '0'; } + 1 while $vendorstats{$_ . "_cachehits"} =~ s/^(-?\d+)(\d{3})/$1.$2/; + printf "%15s %s", $vendorstats{$_ . "_cachehits"}, "bytes from cache\n\n"; + } + + if ($numfiles) { $efficiency = sprintf("%.1f", $cachehits / $numfiles); } + 1 while $totalfilesize =~ s/^(-?\d+)(\d{3})/$1.$2/; + 1 while $cachedtraffic =~ s/^(-?\d+)(\d{3})/$1.$2/; + print "\nTotal files in cache: $numfiles\n"; + print "Total cache size: $totalfilesize bytes\n"; + print "Delivered from cache: $cachedtraffic bytes\n"; + print "Cache efficiency index: $efficiency\n"; + + exit; +} + +# +# Process filelist for output +# + +foreach (@filelist) +{ + @tmp = split(';'); + printf "%$maxlength_filesize\d %s ",$tmp[0],$tmp[1]; + if ($Getopt::Std::opt_a) { printf "%$maxlength_request\d %s ",$tmp[2],$tmp[3]; } + if ($Getopt::Std::opt_d) { printf "%-$maxlength_vendorid\s ",$tmp[4]; } + if ($Getopt::Std::opt_f) { print "$tmp[5]/"; } + print "$tmp[6]\n"; +} + + +# ------------------------------------------------------------------- + +sub getmtime +{ + my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($_[0]); + + return $mtime; +} + +# ------------------------------------------------------------------- + +sub VERSION_MESSAGE +{ + $Getopt::Std::STANDARD_HELP_VERSION=1; + print <s_%KC?DYHEa6d}5LyYJA!sSPI@W)9G0%LSm|@6Z6De zF$GQRTiOK~P#Ja7WRM>;2{a2vW_9}mB$^cE}o7c(B7jip6lW!7w-gT|FbT>-^Do>54hOfhT^L(?g1|!^#>S(8HhIL%CZkc zd&2}M8(n|>4isMkXaA2}eA&gfxp;+(f8k=!-uGPm8@Im&+=BlQIQ<_3A9>Cj&yC_v zU=|CDO@F_ZNC1-~MHd;j_ zq8riJ&WN6h>RLpLrsGL9C)5r#wp$fhHJ8iegsvL7WFnO?SZm8=%&ZQ*HZz)wi&obT zd*DS+w56j-(VEHa6uJ?IJ|yu>XClc=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pLb0HkjFX z)KFv5n5H%?)P;QGg~8?r9$ve$!PIj!v|LtnS#zGKip^`4_3KwkN4h2+RyKWYW!y}) z2tC@WM)bY9p{6F(O}^>x_If6wh5GW4Se-GG@$?-=$bE&c#(e9Bm%C!ZbLiX*Laot6 z60hx!zep^T!<7Or?0CZ$4RLjML)uIx$1TSbI&U5!%7rjm+#f1lVo5cc3&~qWD4EcW z@g8S9b&d5CnlL0bCDIAQy%tn0L=r3Ag!3;3+6D5um^&oiSaVqnhg=gdnd{24GAD9DL1iBaW5NIo?6|@`l z6zDskS3oC0Z-dT*J^)<-O~Je89MB?=XSc%FtX{o5REJL%^`RxWX)VFk{{O5ctZUeb zxao>8F1TtgE5hlFp@tt=weBt>+9tvpF1jKd-<#I=rW|hMM7S+&hIgwuofp(<5J6u~ zO;X;eWRnIh;|d!#)DApb0nn8}LPudwK2;}e^c}9?x>P0L#_^z*s<&ad473L zy^gy)zcqQq^ScKPlw(}VkSjy(#VWrcw6p97v6*YaZ=n1hIv;hfc=meG;MqF}xr31N z`Y7wwpGTcBp*{KC6mn-!$Fyak9OHZl) { $request=$_; - $from_local_cache=0; @tmp=split(/ /,$request); chomp(@tmp); - $dsturl =$tmp[0]; - $hostaddr=$tmp[1]; while ($hostaddr =~ /.*\/$/) { chop $hostaddr; } - $username=$tmp[2]; if ($username eq '') { $username='-'; }; - $method =$tmp[3]; + $source_url = $tmp[0]; + $hostaddr = $tmp[1]; while ($hostaddr =~ /.*\/$/) { chop $hostaddr; } + $username = $tmp[2]; if ($username eq '') { $username='-'; }; + $method = $tmp[3]; + + $xlrator_url = $source_url; if (($method eq 'GET') || ($method eq 'HEAD')) { @@ -81,105 +71,114 @@ while (<>) { # ----------------------------------------------------------- if ( - (($dsturl =~ m@^http://[^/]*\.microsoft\.com/.*\.(exe|psf|msi)$@i) || - ($dsturl =~ m@^http://[^/]*\.windowsupdate\.com/.*\.(exe|psf|cab)$@i)) - && ($dsturl !~ m@^http://[^/]*\.microsoft\.com/.*(/autoupd|selfupdate/).*\.cab@i) - && ($dsturl !~ m@\&@) + (($source_url =~ m@^http://[^/]*\.microsoft\.com/.*\.(exe|psf|msi|msp|cab)$@i) || + ($source_url =~ m@^http://[^/]*\.windowsupdate\.com/.*\.(exe|psf|msi|msp|cab)$@i)) + && ($source_url !~ m@^http://[^/]*\.microsoft\.com/.*(/autoupd|selfupdate/).*\.cab@i) + && ($source_url !~ m@\&@) ) { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Microsoft"); + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Microsoft",$unique); } # ----------------------------------------------------------- # Section: Adobe Downloads # ----------------------------------------------------------- - if ($dsturl =~ m@^http://(ar)?download\.adobe\.com/.*\.(exe|bin|dmg|idx|gz)$@i) + if ( + ($source_url =~ m@^http://(ar)?download\.adobe\.com/.*\.(exe|msi|bin|dmg|idx|gz)$@i) || + ($source_url =~ m@^http://swupdl\.adobe\.com/updates/.*\.(exe|msi|bin|dmg|idx|gz|[a-z][a-z]_[A-Z][A-Z])$@i) || + ($source_url =~ m@^http://swupmf\.adobe\.com/manifest/.*\.upd$@i) + ) { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Adobe"); + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Adobe",$unique); + } + + # ----------------------------------------------------------- + # Section: Linux Downloads + # ----------------------------------------------------------- + + if ($source_url =~ m@^[h|f]t?tp://[^?]+\.(deb|rpm)$@i) + { + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Linux",$mirror); + } + + # ----------------------------------------------------------- + # Section: Trend Micro Downloads + # ----------------------------------------------------------- + + if ( + ($source_url =~ m@^http://[^/]*\.trendmicro\.com/activeupdate/.*@i) && + ($source_url !~ m@.*/tmnotify\.dat$@i) && + ($source_url !~ m@.*/ini_xml\.zip$@i) && + ($source_url !~ m@.*/server\.ini$@i) + ) + { + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"TrendMicro",$mirror); } # ----------------------------------------------------------- # Section: Symantec Downloads # ----------------------------------------------------------- - if ($dsturl =~ m@^[f|h]t?tp://[^/]*\.symantec(liveupdate)?\.com/.*\.(exe|zip|xdb)$@i) + if ($source_url =~ m@^[h|f]tt?p://[^/]*\.symantec(liveupdate)?\.com/.*\.(exe|zip|vdb|xdb)$@i) { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Symantec"); + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Symantec",$unique); } + + # ----------------------------------------------------------- + # Section: Apple Downloads + # ----------------------------------------------------------- + + if ( + (($source_url =~ m@^http://swcdn\.apple\.com/content/downloads/.*\.(tar)$@i) || + ($source_url =~ m@^http://appldnld\.apple\.com\.edgesuite\.net/.*\.(exe|dmg)$@i) || + ($source_url =~ m@^http://.*\.g.akamai.net/.*/3093/1/.*\.(tar|pkg|dmg|exe)$@i)) + ) + { + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Apple",$unique); + } + + # ----------------------------------------------------------- + # Section: Avast Downloads + # ----------------------------------------------------------- + + if ($source_url =~ m@^http://download[\d]+\.avast\.com/.*\.(exe|vpu)$@i) + { + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Avast",$mirror); + } + + # ----------------------------------------------------------- # ----------------------------------------------------------- # Section: Avira Downloads # ----------------------------------------------------------- - - if ($dsturl =~ m@^http://dl[0-9]\.avgate\.net/.*\.(htm|html|gz)$@i) + + if ($source_url =~ m@^http://dl[0-9]\.avgate\.net/.*\.(htm|html|gz)$@i) { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Avira"); - } - - # ----------------------------------------------------------- - # Section: Avast Downloads - # ----------------------------------------------------------- - - if ($dsturl =~ m@^http://download[0-99]\.avast\.com/.*\.(exe|zip|vps|stamp|vpu)$@i) - { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Avast"); - } - - # ----------------------------------------------------------- - # Section: IPFire Downloads - # ----------------------------------------------------------- - - if ($dsturl =~ m@^[f|h]t?tp://.*\.(ipfire)$@i) - { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"IPFire"); - } - - # ----------------------------------------------------------- - # Section: Linux Downloads - # ----------------------------------------------------------- - - if ($dsturl =~ m@^[f|h]t?tp://.*\.(deb|rpm)$@i) - { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Linux"); - } - - # ----------------------------------------------------------- - - # ----------------------------------------------------------- - # Section: Apple Downloads - # ----------------------------------------------------------- - - if ($dsturl =~ m@^[f|h]t?tp://swcdn\.apple.*\.(pkm|tar)$@i) - { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Apple"); + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Avira",$mirror); } + # ----------------------------------------------------------- + # Section: IPFire Downloads + # ----------------------------------------------------------- + + if ($source_url =~ m@^[f|h]t?tp://.*\.(ipfire)$@i) + { + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"IPFire",$mirror); + } + + } + # ----------------------------------------------------------- # Section: AVG Downloads # ----------------------------------------------------------- - if ($dsturl =~ m@^http://[^/]*\.(grisoft|avg)\.com/.*\.(bin)$@i) + if ($source_url =~ m@^http://[^/]*\.(grisoft|avg)\.com/.*\.(bin)$@i) { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"AVG"); + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"AVG",$mirror); } - - # ----------------------------------------------------------- - # Section: Kaspersky Downloads - # not working properly - # ----------------------------------------------------------- - - #if ($dsturl =~ m@^http://dnl-.*\.kaspersky-labs\.com\/(diffs|bases|AutoPatches).*$@i) - #{ - #$from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Kaspersky"); - #} - - # ----------------------------------------------------------- - - } - - if ($from_local_cache) { $request="http://$netsettings{'GREEN_ADDRESS'}:$http_port/updatecache/".substr($dsturl,rindex($dsturl,"/")+1)." $hostaddr $username $method\n"; } + $request="$xlrator_url $hostaddr $username $method\n"; print $request; } @@ -218,29 +217,51 @@ sub readhash sub writelog { - open(LOGFILE,">>$logfile"); - print LOGFILE time." $_[0] $_[1] $_[2] $_[3] $_[4]\n"; - close(LOGFILE); + if ($logging) + { + open(LOGFILE,">>$logfile"); + print LOGFILE time." $_[0] $_[1] $_[2] $_[3] $_[4]\n"; + close(LOGFILE); + } } # ------------------------------------------------------------------- -sub diskfree +sub debuglog { - open(DF,"/bin/df --block-size=1 $_[0]|"); - while() + if ($debug) { - unless ($_ =~ m/^Filesystem/ ) - { - my ($device,$size,$used,$free,$percent,$mount) = split; - if ($free =~ m/^(\d+)$/) - { - close DF; - return $free; - } - } + open(LOGFILE,">>/var/log/updatexlrator/debug.log"); + my @now = localtime(time); + printf LOGFILE "%04d-%02d-%02d %02d:%02d:%02d [%d] [%s] %s\n",$now[5]+1900,$now[4]+1,$now[3],$now[2],$now[1],$now[0],$$,"updxlrator",$_[0]; + close(LOGFILE); } +} + +# ------------------------------------------------------------------- + +sub setcachestatus +{ + open (FILE,">>$_[0]"); + print FILE "$_[1]\n"; + close FILE; +} + +# ------------------------------------------------------------------- + +sub diskfree +{ + open(DF,"/bin/df --block-size=1 $_[0]|"); + my @dfdata = ; close DF; + shift(@dfdata); + chomp(@dfdata); + my $dfstr = join(' ',@dfdata); + my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr); + if ($free =~ m/^(\d+)$/) + { + return $free; + } } # ------------------------------------------------------------------- @@ -248,106 +269,126 @@ sub diskfree sub diskusage { open(DF,"/bin/df $_[0]|"); - while() - { - unless ($_ =~ m/^Filesystem/ ) - { - my ($device,$size,$used,$free,$percent,$mount) = split; - if ($percent =~ m/^(\d+)%$/) - { - close DF; - $percent =~ s/%$//; - return $percent; - } - } - } + my @dfdata = ; close DF; + shift(@dfdata); + chomp(@dfdata); + my $dfstr = join(' ',@dfdata); + my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr); + if ($percent =~ m/^(\d+)%$/) + { + $percent =~ s/%$//; + return $percent; + } } # ------------------------------------------------------------------- -sub getdownloadsize +sub getmtime { - my $remote=0; - my @response=(); - my $contentlength=0; + my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($_[0]); - my $url = $_[0]; - - $url =~ s@^(.*)://([^/]*)@@; - - my $proto = $1; - my $fqhn = $2; - - if ((-e "$swroot/red/active") && ($proto eq 'http')) - { - $remote = IO::Socket::INET->new( - PeerHost => $fqhn, - PeerPort => 'http(80)', - Timeout => 1 - ); - } - - if ($remote) - { - print $remote "HEAD $url HTTP/1.0\n"; - print $remote "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\n"; - print $remote "Host: $fqhn\n"; - print $remote "Accept: */*\n\n"; - while (<$remote>) { push(@response,$_); } - close $remote; - if ($response[0] =~ /^HTTP\/\d+\.\d+\s\d+\sOK\s*$/) - { - foreach (@response) - { - if (/^Content-Length: /i) - { - s/^Content-Length: //i; - $contentlength=$_; - } - } - } - } - return $contentlength; + return $mtime; } # ------------------------------------------------------------------- -sub cache_access +sub check_cache { my $updsource="UPDCACHE"; my $updfile=''; - my $do_redirect=0; + my $cacheurl=''; + my $vendorid=''; + my $uuid=''; + my @http_header=(); + my $remote_size=0; + my $remote_mtime=0; + my $login=''; + my $useragent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"; - $_[0] =~ s@\%2f@/@ig; - $updfile = substr($_[0],rindex($_[0],"/")+1); + my $sourceurl=$_[0]; + my $cfmirror=$_[4]; - if (!-e "$updcachedir/metadata/$updfile") + $sourceurl =~ s@\%2f@/@ig; + $updfile = substr($sourceurl,rindex($sourceurl,"/")+1); + $updfile =~ s@\%20@ @ig; + + if ($cfmirror) { - open(FILE,">$updcachedir/metadata/$updfile"); - print FILE "$_[0]\n$_[3]\n$sfOutdated\n0\n"; - close(FILE); + $uuid = `echo $updfile | md5sum`; + } else { + $uuid = `echo $sourceurl | md5sum`; } - if (-e "$updcachedir/$updfile") + $uuid =~ s/[^0-9a-f]//g; + $uuid =~ s/([a-f\d]{8})([a-f\d]{4})([a-f\d]{4})([a-f\d]{4})([a-f\d]{12})/$1-$2-$3-$4-$5/; + + $vendorid = $_[3]; + $vendorid =~ tr/A-Z/a-z/; + + &debuglog("Processing URL $sourceurl"); + &debuglog("Vendor ID is $vendorid"); + &debuglog("UUID is $uuid"); + + if (($proxysettings{'UPSTREAM_PROXY'}) && ($proxysettings{'UPSTREAM_USER'})) { - open(FILE,">>$updcachedir/metadata/$updfile"); - print FILE time."\n"; - close(FILE); - $do_redirect=1; - } - else - { - $updsource="DLSOURCE"; - if ((!$passive_mode) && (&diskusage($updcachedir) <= $maxusage) && (&getdownloadsize <= &diskfree($updcachedir)) && (!-e "$updcachedir/download/$updfile")) + $login = "--proxy-user=\"$proxysettings{'UPSTREAM_USER'}\""; + if ($proxysettings{'UPSTREAM_PASSWORD'}) { - system("$nice/var/ipfire/updatexlrator/bin/download $_[0] &"); + $login .= " --proxy-password=\"$proxysettings{'UPSTREAM_PASSWORD'}\""; } } - if ($logging) { &writelog($_[1],$_[2],$_[3],$updsource,$_[0]); } + if ($proxysettings{'UPSTREAM_PROXY'}) { &debuglog("Using upstream proxy $proxysettings{'UPSTREAM_PROXY'}"); } - return $do_redirect; + $ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'}; + @http_header = `$wget $login --user-agent="$useragent" --spider -S $sourceurl 2>&1`; + $ENV{'http_proxy'} = ''; + + foreach (@http_header) + { + chomp; + if (/^\s*Content-Length:\s/) { $remote_size = $_; $remote_size =~ s/[^0-9]//g; } + if (/^\s*Last-Modified:\s/) { $remote_mtime = $_; $remote_mtime =~ s/^\s*Last-Modified:\s//; $remote_mtime = HTTP::Date::str2time($remote_mtime) } + } + + if ( + (-e "$updcachedir/$vendorid/$uuid/$updfile") && + ($remote_size == (-s "$updcachedir/$vendorid/$uuid/$updfile")) && + ($remote_mtime == &getmtime("$updcachedir/$vendorid/$uuid/$updfile")) + ) + { + &debuglog("File exists in cache and is up to date"); + &debuglog("Retrieving file from cache ($updsource)"); + &setcachestatus("$updcachedir/$vendorid/$uuid/access.log",time); + system("$apphome/bin/setperms $vendorid/$uuid/access.log"); + $cacheurl="http://$netsettings{'GREEN_ADDRESS'}:$http_port/updatecache/$vendorid/$uuid/$updfile"; + } + else + { + if (-e "$updcachedir/$vendorid/$uuid/$updfile") + { + &debuglog("Local filesize: " . (-s "$updcachedir/$vendorid/$uuid/$updfile")); + &debuglog("Local timestamp: " . &getmtime("$updcachedir/$vendorid/$uuid/$updfile")); + } else { &debuglog("File not found in cache"); } + $updsource="DLSOURCE"; + &debuglog("Remote filesize: $remote_size"); + &debuglog("Remote timestamp: $remote_mtime"); + &debuglog("Free disk space: " . &diskfree($updcachedir)); + &debuglog("Disk usage: " . &diskusage($updcachedir) . "% (max. $maxusage%)"); + if (-e "$updcachedir/download/$vendorid/$updfile") { &debuglog("File download/$vendorid/$updfile exists"); } + &debuglog("Retrieving file from source ($updsource)"); + if ((!$passive_mode) && (&diskusage($updcachedir) <= $maxusage) && ($remote_size <= &diskfree($updcachedir)) && (!-e "$updcachedir/download/$vendorid/$updfile")) + { + &debuglog("Running command $nice$apphome/bin/download $vendorid $sourceurl $cfmirror &"); + system("$nice$apphome/bin/download $vendorid $sourceurl $cfmirror &"); + } + $cacheurl=$sourceurl; + } + + &writelog($_[1],$_[2],$_[3],$updsource,$sourceurl); + + return $cacheurl; } # ------------------------------------------------------------------- diff --git a/html/cgi-bin/updatexlrator.cgi b/html/cgi-bin/updatexlrator.cgi index f3a950afb..f73172a82 100644 --- a/html/cgi-bin/updatexlrator.cgi +++ b/html/cgi-bin/updatexlrator.cgi @@ -39,21 +39,39 @@ my %mainsettings=(); my %proxysettings=(); my %xlratorsettings=(); my $id=0; +my @dfdata=(); +my $dfstr=''; +my @updatelist=(); +my @sources=(); +my $sourceurl=''; +my $vendorid=''; +my $uuid=''; +my $status=0; my $updatefile=''; my $shortname=''; -my $vendor=''; my $time=''; my $filesize=0; my $filedate=''; my $lastaccess=''; my $lastcheck=''; +my $cachedtraffic=0; +my @requests=(); +my $data=''; +my $counts=0; +my $numfiles=0; +my $cachehits=0; +my $efficiency='0.0'; +my @vendors=(); +my %vendorstats=(); -my $repository = "/var/updatecache"; +my $repository = "/var/updatecache/"; my $hintcolour = '#FFFFCC'; +my $colourgray = '#808080'; -my $sfNoSource='0'; +my $sfUnknown='0'; my $sfOk='1'; my $sfOutdated='2'; +my $sfNoSource='3'; my $not_accessed_last=''; @@ -76,69 +94,114 @@ my $chk_cron_mly = "${General::swroot}/updatexlrator/autocheck/cron.monthly"; $xlratorsettings{'ACTION'} = ''; $xlratorsettings{'ENABLE_LOG'} = 'off'; $xlratorsettings{'PASSIVE_MODE'} = 'off'; -$xlratorsettings{'MAX_DISK_USAGE'} = '95'; +$xlratorsettings{'MAX_DISK_USAGE'} = '75'; $xlratorsettings{'LOW_DOWNLOAD_PRIORITY'} = 'off'; +$xlratorsettings{'MAX_DOWNLOAD_RATE'} = ''; $xlratorsettings{'ENABLE_AUTOCHECK'} = 'off'; $xlratorsettings{'FULL_AUTOSYNC'} = 'off'; $xlratorsettings{'NOT_ACCESSED_LAST'} = 'month1'; &Header::getcgihash(\%xlratorsettings); +$xlratorsettings{'EXTENDED_GUI'} = ''; + +if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr statistics'} >>") +{ + $xlratorsettings{'EXTENDED_GUI'} = 'statistics'; +} + +if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr maintenance'} >>") +{ + $xlratorsettings{'EXTENDED_GUI'} = 'maintenance'; +} + if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr purge'}) { + $xlratorsettings{'EXTENDED_GUI'} = 'maintenance'; + if (($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on') || ($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') || ($xlratorsettings{'REMOVE_OUTDATED'} eq 'on')) { - @repositorylist = <$repository/*>; - foreach (@repositorylist) + undef (@sources); + undef @repositoryfiles; + foreach (<$repository/*>) { - if (!-d $_) + if (-d $_) { - $updatefile = substr($_,rindex($_,"/")+1); - if (-e "$repository/metadata/$updatefile") - { - open (FILE,"$repository/metadata/$updatefile"); - @metadata = ; - close FILE; - chomp(@metadata); + unless (/^$repository\/download$/) { push(@sources,$_); } + } + } - if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($metadata[2] == $sfNoSource)) - { - unlink("$repository/$updatefile"); - unlink("$repository/metadata/$updatefile"); - } - if (($xlratorsettings{'REMOVE_OUTDATED'} eq 'on') && ($metadata[2] == $sfOutdated)) - { - unlink("$repository/$updatefile"); - unlink("$repository/metadata/$updatefile"); - } - if ($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on') - { - if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'week') && ($metadata[-1] < (time - 604800))) - { - unlink("$repository/$updatefile"); - unlink("$repository/metadata/$updatefile"); - } - if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($metadata[-1] < (time - 2505600))) - { - unlink("$repository/$updatefile"); - unlink("$repository/metadata/$updatefile"); - } - if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month3') && ($metadata[-1] < (time - 7516800))) - { - unlink("$repository/$updatefile"); - unlink("$repository/metadata/$updatefile"); - } - if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($metadata[-1] < (time - 15033600))) - { - unlink("$repository/$updatefile"); - unlink("$repository/metadata/$updatefile"); - } - if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'year') && ($metadata[-1] < (time - 31536000))) - { - unlink("$repository/$updatefile"); - unlink("$repository/metadata/$updatefile"); - } - } + foreach (@sources) + { + @updatelist=<$_/*>; + $vendorid = substr($_,rindex($_,"/")+1); + foreach(@updatelist) + { + $uuid = substr($_,rindex($_,"/")+1); + if (-e "$_/source.url") + { + open (FILE,"$_/source.url"); + $sourceurl=; + close FILE; + chomp($sourceurl); + $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); + $updatefile = "$vendorid/$uuid/$updatefile"; + push(@repositoryfiles,$updatefile); + } + } + } + + foreach (@repositoryfiles) + { + ($vendorid,$uuid,$updatefile) = split('/'); + + if (-e "$repository/$vendorid/$uuid/status") + { + open (FILE,"$repository/$vendorid/$uuid/status"); + @metadata = ; + close FILE; + chomp(@metadata); + $status = $metadata[-1]; + } + + if (-e "$repository/$vendorid/$uuid/access.log") + { + open (FILE,"$repository/$vendorid/$uuid/access.log"); + @metadata = ; + close FILE; + chomp(@metadata); + $lastaccess = $metadata[-1]; + } + + if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($status == $sfNoSource)) + { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); } + } + if (($xlratorsettings{'REMOVE_OUTDATED'} eq 'on') && ($status == $sfOutdated)) + { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); } + } + if ($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on') + { + if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'week') && ($lastaccess < (time - 604800))) + { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); } + } + if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($lastaccess < (time - 2505600))) + { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); } + } + if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month3') && ($lastaccess < (time - 7516800))) + { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); } + } + if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($lastaccess < (time - 15033600))) + { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); } + } + if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'year') && ($lastaccess < (time - 31536000))) + { + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); } } } } @@ -152,6 +215,11 @@ if ($xlratorsettings{'ACTION'} eq $Lang::tr{'save'}) $errormessage = $Lang::tr{'updxlrtr invalid disk usage'}; goto ERROR; } + if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1))) + { + $errormessage = $Lang::tr{'updxlrtr invalid download rate'}; + goto ERROR; + } &savesettings; } @@ -163,7 +231,12 @@ if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr save and restart'}) $errormessage = $Lang::tr{'updxlrtr invalid disk usage'}; goto ERROR; } - if (!(-e "${General::swroot}/proxy/enable")) + if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1))) + { + $errormessage = $Lang::tr{'updxlrtr invalid download rate'}; + goto ERROR; + } + if ((!(-e "${General::swroot}/proxy/enable")) && (!(-e "${General::swroot}/proxy/enable_blue"))) { $errormessage = $Lang::tr{'updxlrtr web proxy service required'}; goto ERROR; @@ -181,13 +254,19 @@ if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr save and restart'}) if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr remove file'}) { - $updatefile = $xlratorsettings{'ID'}; - if (-e "$repository/$updatefile") { unlink("$repository/$updatefile"); } - $updatefile =~ s/^download\///i; - if (-e "$repository/metadata/$updatefile") { unlink("$repository/metadata/$updatefile"); } -} + $xlratorsettings{'EXTENDED_GUI'} = 'maintenance'; -ERROR: + $updatefile = $xlratorsettings{'ID'}; + + if ($updatefile =~ /^download\//) + { + ($uuid,$vendorid,$updatefile) = split('/',$updatefile); + if (-e "$repository/download/$vendorid/$updatefile") { system("rm $repository/download/$vendorid/$updatefile"); } + } else { + ($vendorid,$uuid,$updatefile) = split('/',$updatefile); + if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); } + } +} $not_accessed_last = $xlratorsettings{'NOT_ACCESSED_LAST'}; undef($xlratorsettings{'NOT_ACCESSED_LAST'}); @@ -196,6 +275,7 @@ if (-e "${General::swroot}/updatexlrator/settings") { &General::readhash("${Gene if ($xlratorsettings{'NOT_ACCESSED_LAST'} eq '') { $xlratorsettings{'NOT_ACCESSED_LAST'} = $not_accessed_last; } ; +ERROR: $checked{'ENABLE_LOG'}{'off'} = ''; $checked{'ENABLE_LOG'}{'on'} = ''; @@ -244,6 +324,8 @@ print < $Lang::tr{'updxlrtr enable log'}: + + $Lang::tr{'updxlrtr passive mode'}: @@ -251,11 +333,17 @@ print <$Lang::tr{'updxlrtr max disk usage'}: % + +
+ - - - - + + + + + +
$Lang::tr{'updxlrtr low download priority'}:  $Lang::tr{'updxlrtr performance options'}
$Lang::tr{'updxlrtr low download priority'}:$Lang::tr{'updxlrtr max download rate'}: * +

@@ -285,8 +373,464 @@ print < - + + + +END +; + +print" \n"; + +print" \n"; + +print < +
$Lang::tr{'updxlrtr maintenance'} >' "; } +print "/>>' "; } +print "/>
+END +; + +&Header::closebox(); + +print "\n"; + +# ===================================================================================== +# CACHE STATISTICS +# ===================================================================================== + +if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics') +{ + +# ---------------------------------------------------- +# Get statistics +# ---------------------------------------------------- + +@sources=(); +foreach (<$repository/*>) +{ + if (-d $_) + { + unless ((/^$repository\/download$/) || (/^$repository\/lost\+found$/)) { push(@sources,$_); } + } +} + +@vendors=(); +foreach (@sources) +{ + $vendorid=substr($_,rindex($_,'/')+1,length($_)); + push(@vendors,$vendorid); + @updatelist=<$_/*>; + foreach $data (@updatelist) + { + if (-e "$data/source.url") + { + open (FILE,"$data/source.url"); + $sourceurl=; + close FILE; + chomp($sourceurl); + $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); + # + # Total file size + # + $filesize += (-s "$data/$updatefile"); + # + # File size for this source + # + $vendorstats{$vendorid."_filesize"} += (-s "$data/$updatefile"); + # + # Number of requests from cache for this source + # + open (FILE,"$data/access.log"); + @requests=; + close FILE; + chomp(@requests); + $counts = @requests; + $counts--; + $vendorstats{$vendorid."_requests"} += $counts; + $cachehits += $counts; + # + # Total number of files in cache + # + $numfiles++; + # + # Number of files for this source + # + $vendorstats{$vendorid."_files"}++; + # + # Count cache status occurences + # + open (FILE,"$data/status"); + $_=; + close FILE; + chomp; + $vendorstats{$vendorid."_".$_}++; + # + # Calculate cached traffic for this source + # + $vendorstats{$vendorid."_cachehits"} += $counts * (-s "$data/$updatefile"); + # + # Calculate total cached traffic + # + $cachedtraffic += $counts * (-s "$data/$updatefile"); + + } + } +} + +if ($numfiles) { $efficiency = sprintf("%.1f", $cachehits / $numfiles); } + +1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/; +1 while $cachedtraffic =~ s/^(-?\d+)(\d{3})/$1.$2/; + +# ---------------------------------------------------- +# Show statistics +# ---------------------------------------------------- + +&Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr cache statistics'}"); + +unless ($numfiles) { print "$Lang::tr{'updxlrtr empty repository'}\n
\n"; } + +print < +$Lang::tr{'updxlrtr disk usage'} + + + + + + + + + +END +; + +open(DF,"/bin/df -h $repository|"); +@dfdata = ; +close DF; +shift(@dfdata); +chomp(@dfdata); +$dfstr = join(' ',@dfdata); +my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr); + +print < + + + + + + +
$Lang::tr{'updxlrtr cache dir'}$Lang::tr{'size'}$Lang::tr{'used'}$Lang::tr{'free'}$Lang::tr{'percentage'}
[$repository]$size$used$free +END +; +&percentbar($percent); +print < +$percent
+END +; + +if ($numfiles) +{ + print < + + + + + + + + + + + + + + + + + + +
$Lang::tr{'updxlrtr summary'}
$Lang::tr{'updxlrtr total files'}:$numfiles$Lang::tr{'updxlrtr total cache size'}:$filesize
$Lang::tr{'updxlrtr efficiency index'}:$efficiency$Lang::tr{'updxlrtr total data from cache'}:$cachedtraffic
+
+ + + + + + + + + + + + + + + + + + + + + + +END +; + +$id = 0; + +foreach (@vendors) +{ + $vendorid = $_; + + unless ($vendorstats{$vendorid . "_files"}) { next; } + + $id++; + if ($id % 2) { + print "\n"; } + else { + print "\n"; } + + print "\n"; + print "\n"; + } elsif ($vendorid =~ /^Microsoft$/i) + { + print "Microsoft \n"; + print "\n"; + } elsif ($vendorid =~ /^Symantec$/i) + { + print "Symantec \n"; + print "\n"; + } elsif ($vendorid =~ /^Linux$/i) + { + print "Linux \n"; + print "\n"; + } elsif ($vendorid =~ /^TrendMicro$/i) + { + print "Trend Micro \n"; + print "\n"; + } elsif ($vendorid =~ /^Apple$/i) + { + print "Apple \n"; + print "\n"; + } elsif ($vendorid =~ /^Avast$/i) + { + print "Avast \n"; + print "\n"; + } elsif ($vendorid =~ /^Avira$/i) + { + print "Avira \n"; + print "\n"; + } elsif ($vendorid =~ /^AVG$/i) + { + print "AVG \n"; + print "\n"; + } elsif ($vendorid =~ /^Ipfire$/i) + { + print "IPFire \n"; + print "\n"; + } else + { + if (-e "/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . ".gif") + { + print "" . ucfirst $vendorid . " \n"; + } else { + print "" . ucfirst $vendorid . " \n"; + } + print "\n"; + } + + print "\n"; + + unless ($vendorstats{$vendorid."_filesize"}) { $vendorstats{$vendorid."_filesize"} = '0'; } + 1 while $vendorstats{$vendorid."_filesize"} =~ s/^(-?\d+)(\d{3})/$1.$2/; + print "\n"; + + unless ($vendorstats{$vendorid."_cachehits"}) { $vendorstats{$vendorid."_cachehits"} = '0'; } + 1 while $vendorstats{$vendorid."_cachehits"} =~ s/^(-?\d+)(\d{3})/$1.$2/; + print "\n"; + + print "\n"; + + print "\n"; + + print "\n"; + + print "\n"; + + print "\n"; + print "\n"; +} + +print "
$Lang::tr{'updxlrtr statistics by source'}
$Lang::tr{'updxlrtr source'} $Lang::tr{'updxlrtr files'} $Lang::tr{'updxlrtr cache size'} $Lang::tr{'updxlrtr data from cache'}     
 "; + + if ($vendorid =~ /^Adobe$/i) + { + print "Adobe  Adobe  Microsoft  Symantec  Linux  Trend Micro  Apple  Avast  Avira  AVG  IPFiew  " . ucfirst $vendorid . " "; + printf "%5d", $vendorstats{$vendorid."_files"}; + print " "; + printf "%15s", $vendorstats{$vendorid."_filesize"}; + print " "; + printf "%15s", $vendorstats{$vendorid."_cachehits"}; + print " "; + printf "%5d", $vendorstats{$vendorid."_1"}; + print "  "; + printf "%5d", $vendorstats{$vendorid."_3"}; + print "  "; + printf "%5d", $vendorstats{$vendorid."_2"}; + print "  "; + printf "%5d", $vendorstats{$vendorid."_0"}; + print "   
\n"; + +print < + + + + + + + + + + + + + + + + + +
  $Lang::tr{'legend'}: $Lang::tr{$Lang::tr{'updxlrtr condition ok'}   $Lang::tr{$Lang::tr{'updxlrtr condition nosource'}   $Lang::tr{$Lang::tr{'updxlrtr condition outdated'}   $Lang::tr{$Lang::tr{'updxlrtr condition unknown'}   
+END +; + +} + +&Header::closebox(); + +} + +# ===================================================================================== +# CACHE MAINTENANCE +# ===================================================================================== + +if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance') +{ + + +# ---------------------------------------------------- +# File list dialog +# ---------------------------------------------------- + +&Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr cache maintenance'}"); + +@sources= <$repository/download/*>; + +undef @repositoryfiles; +foreach (@sources) +{ + if (-d) + { + @updatelist = <$_/*>; + $vendorid = substr($_,rindex($_,"/")+1); + foreach(@updatelist) + { + $updatefile = substr($_,rindex($_,"/")+1); + $updatefile .= ":download/$vendorid/$updatefile"; + $updatefile = " ".$updatefile; + push(@repositoryfiles,$updatefile); + } + } +} + +undef (@sources); +foreach (<$repository/*>) +{ + if (-d $_) +{ + unless (/^$repository\/download$/) { push(@sources,$_); } + } +} + +foreach (@sources) +{ + @updatelist=<$_/*>; + $vendorid = substr($_,rindex($_,"/")+1); + foreach(@updatelist) + { + $uuid = substr($_,rindex($_,"/")+1); + if (-e "$_/source.url") + { + open (FILE,"$_/source.url"); + $sourceurl=; + close FILE; + chomp($sourceurl); + $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); + $_ = $updatefile; tr/[A-Z]/[a-z]/; + $updatefile = "$_:$vendorid/$uuid/$updatefile"; + push(@repositoryfiles,$updatefile); + } + } +} + +@repositoryfiles = sort(@repositoryfiles); + +unless (@repositoryfiles) { print "$Lang::tr{'updxlrtr empty repository'}\n
\n"; } + +print < +$Lang::tr{'updxlrtr disk usage'} + + + + + + + + + +END +; + +open(DF,"/bin/df -h $repository|"); +@dfdata = ; +close DF; +shift(@dfdata); +chomp(@dfdata); +$dfstr = join(' ',@dfdata); +my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr); + +print < + + + + + + +
$Lang::tr{'updxlrtr cache dir'}$Lang::tr{'size'}$Lang::tr{'used'}$Lang::tr{'free'}$Lang::tr{'percentage'}
[$repository]$size$used$free +END +; +&percentbar($percent); +print < +$percent
+END +; + +if (@repositoryfiles) +{ + print < +
+ @@ -303,66 +847,19 @@ print < - + - +
 $Lang::tr{'updxlrtr all files'}  $Lang::tr{'updxlrtr not accessed'}
 $Lang::tr{'updxlrtr marked as'}$Lang::tr{$Lang::tr{ [$Lang::tr{'updxlrtr condition nosource'}]  $Lang::tr{'updxlrtr marked as'}$Lang::tr{$Lang::tr{ [$Lang::tr{'updxlrtr condition outdated'}]
+

- - - - - - - +
  
+
$Lang::tr{'updxlrtr current files'}
- - - -
-   -
-END -; - -&Header::closebox(); - -print "\n"; - -# ---------------------------------------------------- -# File list dialog -# ---------------------------------------------------- - -&Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr current files'}:"); - -@repositorylist = <$repository/download/*>; - -undef @repositoryfiles; -foreach (@repositorylist) -{ - if (!-d) - { - $updatefile = substr($_,rindex($_,"/")+1); - $updatefile = "download/$updatefile"; - push(@repositoryfiles,$updatefile); - } -} - -@repositorylist = <$repository/*>; - -foreach (@repositorylist) -{ - if (!-d) { push(@repositoryfiles,substr($_,rindex($_,"/")+1)); } -} - -if (@repositoryfiles) -{ - print < @@ -374,7 +871,7 @@ if (@repositoryfiles) $Lang::tr{'updxlrtr filesize'} $Lang::tr{'date'} $Lang::tr{ - $Lang::tr{ + $Lang::tr{   END @@ -382,11 +879,13 @@ END $id = 0; foreach $updatefile (@repositoryfiles) { + $updatefile =~ s/.*://; + $id++; if ($id % 2) { - print "\n"; } + print "\n"; } else { - print "\n"; } + print "\n"; } $filesize = (-s "$repository/$updatefile"); 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/; @@ -398,95 +897,121 @@ END $lastaccess = "n/a"; $lastcheck = "n/a"; - undef @metadata; - $shortname = $updatefile; - $shortname =~ s/^download\///i; + $status = $sfUnknown; - if (-e "$repository/metadata/$shortname") + unless ($updatefile =~ /^download\//) { - open (FILE,"$repository/metadata/$shortname"); - @metadata = ; - close(FILE); - chomp @metadata; + ($vendorid,$uuid,$shortname) = split('/',$updatefile); - ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]); - $DAYdt = sprintf ("%.02d",$DAYdt); - $MONTHdt = sprintf ("%.02d",$MONTHdt+1); - $YEARdt = sprintf ("%.04d",$YEARdt+1900); - if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastaccess = $YEARdt."-".$MONTHdt."-".$DAYdt; } + if (-e "$repository/$vendorid/$uuid/access.log") + { + open (FILE,"$repository/$vendorid/$uuid/access.log"); + @metadata = ; + close(FILE); + chomp @metadata; - ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[3]); - $DAYdt = sprintf ("%.02d",$DAYdt); - $MONTHdt = sprintf ("%.02d",$MONTHdt+1); - $YEARdt = sprintf ("%.04d",$YEARdt+1900); - if (($metadata[3] =~ /^\d+/) && ($metadata[3] >= 1)) { $lastcheck = $YEARdt."-".$MONTHdt."-".$DAYdt; } - } - - print "\t\t "; - if ($metadata[2] eq $sfNoSource) - { - print "$Lang::tr{ \n"; - } - if ($metadata[2] eq $sfOk) - { - print "$Lang::tr{ \n"; - } - if (($metadata[2] eq $sfOutdated) && (!($updatefile =~ /^download\//i))) - { - print "$Lang::tr{ \n"; - } - if (($metadata[2] eq $sfOutdated) && ($updatefile =~ /^download\//i)) - { - print "$Lang::tr{ \n"; - } - if ($metadata[2] eq '') - { - print "$Lang::tr{ \n"; + ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]); + $DAYdt = sprintf ("%.02d",$DAYdt); + $MONTHdt = sprintf ("%.02d",$MONTHdt+1); + $YEARdt = sprintf ("%.04d",$YEARdt+1900); + if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastaccess = $YEARdt."-".$MONTHdt."-".$DAYdt; } + } + if (-e "$repository/$vendorid/$uuid/checkup.log") + { + open (FILE,"$repository/$vendorid/$uuid/checkup.log"); + @metadata = ; + close(FILE); + chomp @metadata; + + ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]); + $DAYdt = sprintf ("%.02d",$DAYdt); + $MONTHdt = sprintf ("%.02d",$MONTHdt+1); + $YEARdt = sprintf ("%.04d",$YEARdt+1900); + if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastcheck = $YEARdt."-".$MONTHdt."-".$DAYdt; } + } + if (-e "$repository/$vendorid/$uuid/status") + { + open (FILE,"$repository/$vendorid/$uuid/status"); + @metadata = ; + close(FILE); + chomp @metadata; + $status = $metadata[-1]; + } + } else { + ($uuid,$vendorid,$shortname) = split('/',$updatefile); + $status = $sfOutdated; } print "\t\t "; - if ($metadata[1] eq 'Adobe') + if ($status == $sfUnknown) { - print "Adobe \n"; - } elsif ($metadata[1] eq 'Microsoft') + print "$Lang::tr{ \n"; + } + if ($status == $sfOk) { - print "Microsoft \n"; - } elsif ($metadata[1] eq 'Symantec') + print "$Lang::tr{ \n"; + } + if ($status == $sfNoSource) { - print "Symantec \n"; - } elsif ($metadata[1] eq 'Avira') + print "$Lang::tr{ \n"; + } + if (($status == $sfOutdated) && (!($updatefile =~ /^download\//i))) { - print "Avira \n"; - } elsif ($metadata[1] eq 'AVG') + print "$Lang::tr{ \n"; + } + if (($status == $sfOutdated) && ($updatefile =~ /^download\//i)) { - print "AVG \n"; - } elsif ($metadata[1] eq 'Avast') + print "$Lang::tr{ \n"; + } + + print "\t\t "; + if ($vendorid =~ /^Adobe$/i) { - print "Avast \n"; - } elsif ($metadata[1] eq 'IPFire') + print "Adobe \n"; + } elsif ($vendorid =~ /^Microsoft$/i) + { + print "Microsoft \n"; + } elsif ($vendorid =~ /^Symantec$/i) + { + print "Symantec \n"; + } elsif ($vendorid =~ /^Linux$/i) + { + print "Linux \n"; + } elsif ($vendorid =~ /^TrendMicro$/i) + { + print "Trend Micro \n"; + } elsif ($vendorid =~ /^Apple$/i) + { + print "Apple \n"; + } elsif ($vendorid =~ /^Avast$/i) + { + print "Avast \n"; + } elsif ($vendorid =~ /^Avira$/i) + { + print "Avira \n"; + } elsif ($vendorid =~ /^AVG$/i) + { + print "AVG \n"; + } elsif ($vendorid =~ /^Ipfire$/i) { print "IPFire \n"; - } elsif ($metadata[1] eq 'Apple') + } + else { - print "Apple \n"; - } elsif ($metadata[1] eq 'Kaspersky') - { - print "Kaspersky \n"; - } elsif ($metadata[1] eq 'Linux') - { - print "Linux \n"; - } else - { - print "$Lang::tr{ \n"; + if (-e "/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . ".gif") + { + print "" . ucfirst $vendorid . " \n"; + } else { + print "" . ucfirst $vendorid . " \n"; + } } - $shortname = $updatefile; + $shortname = substr($updatefile,rindex($updatefile,"/")+1); $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/\1_*\2/i; - $shortname =~ s/^download\///i; print <$shortname + $shortname  $filesize   $filedate   $lastaccess  @@ -513,7 +1038,7 @@ print <$Lang::tr{ $Lang::tr{'updxlrtr last access'}   - $Lang::tr{ + $Lang::tr{ $Lang::tr{'updxlrtr last checkup'}   $Lang::tr{ @@ -523,126 +1048,103 @@ print <  - +
  $Lang::tr{'status'}:   - $Lang::tr{ + $Lang::tr{ $Lang::tr{'updxlrtr condition ok'}   - $Lang::tr{ + $Lang::tr{ $Lang::tr{'updxlrtr condition nosource'}   - $Lang::tr{ + $Lang::tr{ $Lang::tr{'updxlrtr condition outdated'}   - $Lang::tr{ +   +   + + +   +   + $Lang::tr{ $Lang::tr{'updxlrtr condition download'} +   + $Lang::tr{ + $Lang::tr{'updxlrtr condition unknown'} +   +   +   +   +   +   + + +  
+ + +   $Lang::tr{'updxlrtr source'}: +   + Adobe + Adobe +   + Apple + Apple +   + Avast + Avast +   + Linux + Linux -   $Lang::tr{'updxlrtr source'}:   - Adobe - Adobe   - Microsoft + Microsoft Microsoft   - Symantec + Symantec Symantec   - Avira - Avira + Trend Micro + Trend Micro   - AVG - AVG -   - Apple - Apple -   - - -   IPFire IPFire + +   - Linux - Linux   - Avast - Avast + Avira + Avira   - Kaspersky - Kaspersky + AVG + AVG   - $Lang::tr{ - $Lang::tr{'updxlrtr unknown'} + $Lang::tr{ + $Lang::tr{'updxlrtr other'} +   +   END ; -} else { - print "$Lang::tr{'updxlrtr empty repository'}\n"; } -print < - - - -
$Lang::tr{'updxlrtr disk usage'}:
- - -END -; -open(DF,"/bin/df -h $repository|"); -while() -{ - if ($_ =~ m/^Filesystem/ ) - { - print < - - - - - - -END -; - } - else - { - my ($device,$size,$used,$free,$percent,$mount) = split; - print < - - - - - - -END -; - } -} -close DF; -print "
$Lang::tr{'updxlrtr cache dir'}$Lang::tr{'size'}$Lang::tr{'used'}$Lang::tr{'free'}$Lang::tr{'percentage'}
[$repository]$size$used$free -END -; - &percentbar($percent); - print < -$percent
\n"; - &Header::closebox(); +} + +# ===================================================================================== + +# ---------------------------------------------------- + &Header::closebigbox(); &Header::closepage(); @@ -678,6 +1180,8 @@ sub savesettings delete($xlratorsettings{'REMOVE_NOSOURCE'}); delete($xlratorsettings{'REMOVE_OUTDATED'}); + delete($xlratorsettings{'EXTENDED_GUI'}); + &General::writehash("${General::swroot}/updatexlrator/settings", \%xlratorsettings); } diff --git a/html/html/images/updbooster/updxl-globe.gif b/html/html/images/updbooster/updxl-globe.gif new file mode 100644 index 0000000000000000000000000000000000000000..54e49fc826c94dee6ff9c31d5919fbeb7eb9aaab GIT binary patch literal 1124 zcmX9-ZA?>V6nYu6GvbC8KO8y`OEdusXFb7#rnATA`flwF3IuVSrGbAOZl0w=GMh)W#B~mau4K2ub zM8T%8YmB-Q(C+cv62Y$0A&y$b=&cwR5?DOUU3OxX2&QOsG>UFco=|WG)yqjR%|Rzp zw+1aTt)e)kmy58b02`xd^@AmfrxBVYXFQl(yu*+4$stwCYHWg`#SbK8$V^|;)KrH06f6-%2`^>+ z80T3HqiKrnC^zN=bHG0uz$Ro(jJlIxj?q_TFl*jx9-&6Uh8Sy-uu~6I&=x>*l3FFO z#ON@U7Q{?CgC?1dQ*}n8DLq_;la!WcXbQokfn8$zWtyU3m$@Mh-I?iI8dx+M*N=gt zE|uzAF#5%`I5#_2QS=UZ;U;<3N(eEKpNQcBAv(Wnm=wwNo5Z?=KSDgZjgU>c%Q_q( z;XZQg7&&}+ox!7{4{<`u33-_iD|w4J_mJyL(nGrRf5LiQDgF!eG~I+>GA#W>PVNJ; zYz2FIN<%G)2e8`d_~9(W3&Eq}w~Jr&%_ic%kU!t@E>;5k#6 zx2&oC#O%ElIqB{}?s!|4TM98jse;Bfkvx9PQ8N&%Z|Rt;s#mf3dC4Roqos`}$qu zs-e7dADTkTcTBH-!g8wepXqb`r6mi?Q?rrVR|+<*&;2#DirlEq)zV(EYgkXi@z9RAWKO&XkbXEWm#u`6{dTQS;*8P*Zn60P%kb zW+Zu8W%Gh^uS!qyd_iU=d7&V4Q=(XuwZ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NsC0A^8LW00930EC2ui01^Na00#*90RIX6_wK+eSFZ*tTzJdN8#fj#bXiEz z)d!0nB)YPt@SQ?0ZrpgeV8PQG4Rh-BsxjlhK!YZcG20F Wn*_-fwrb;|j;E{9DV9|j5CA(j`sjTC literal 0 HcmV?d00001 diff --git a/html/html/images/updxl-yl.gif b/html/html/images/updbooster/updxl-yl.gif similarity index 100% rename from html/html/images/updxl-yl.gif rename to html/html/images/updbooster/updxl-yl.gif diff --git a/html/html/images/updxl-src-apple.gif b/html/html/images/updxl-src-apple.gif deleted file mode 100644 index c5f75e3af00e54a8c5af4bc27e15415ac638d978..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1010 zcmXYwe@Gi=7{|ZYsL5;y@k*>rE7z@qp>B0H3vvBpp^bJM1M^2=Ss6t~vPG&z+d#{9 z#M7LqNaosbl_5tK?NLMySxb;ovf@UN;X(%`7A9e|U1-b?B!jHoO6a@y;vSCUec$`M z&+~a6xKkhY+k1ytuy_uPd?hCCCBjiP`y?yQNy@64dXScHs$xX(hos80in5wWZ)Zw{ zlDv`#FDU9-!ao&GZliQoQY=&2Eh#GrX+e$O zO{DIp#fYq|&~l1DASO3b)fZKHDIVFj@d%I*Av!{ggn*2qquxBTcRr2voH;&OWAF&b z!@`1wBgE-+9E|RMQ%_FYy8j zkrE){uLN-d8=($ZB=n^Aps5V_(5^AKx`TELwg%CKGr z3ZR>Hz%Y$!C)iqFE%5CkdJO^(ehj1@Bm%;Nj&6`3N+1yMqj1(Ui0nD!os~`qLGZL2 z*^R1YfyKX0I^XGHal zn-^yeb&oBd{{5uTaOf>_!!P4YS9ER1+C1OI4)4=VHQHi3@7(a+H@@0++41J$iEoX4 z$109%uRBH7aPBkv+F> zv#0G}|I{Ivj(W^-24mvEqZ?;@MnQj~Q9ADaA$H@I$?!_6GnTPWvRp~ O3vI60E!!0V$NvKfy?dGf diff --git a/html/html/images/updxl-src-avast.gif b/html/html/images/updxl-src-avast.gif deleted file mode 100644 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