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 | 260 ++--- config/updxlrator/convert | 110 ++ config/updxlrator/download | 210 +++- config/updxlrator/lscache | 246 +++++ config/updxlrator/setperms | Bin 0 -> 5928 bytes config/updxlrator/updxlrator | 393 +++---- html/cgi-bin/updatexlrator.cgi | 980 +++++++++++++----- 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, 1626 insertions(+), 611 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 e45c856f5c..61ba23fc60 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 b682495cd2..e8ebb2eb56 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 fc353f4431..35c4953edc 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 (!-d $_) - { - $updatefile = substr($_,rindex($_,"/")+1); - if (-e "$repository/metadata/$updatefile") - { - open (FILE,"$repository/metadata/$updatefile"); - @metadata = ; - close FILE; - chomp(@metadata); - $sourceurl = $metadata[0]; +if (-e "$swroot/proxy/settings") { &readhash("$swroot/proxy/settings", \%proxysettings); } - $remote_size = &getdownloadsize($sourceurl); - $local_size = (-s "$repository/$updatefile"); +if (-e "$swroot/proxy/advanced/settings") +{ + %proxysettings=(); + &readhash("$swroot/proxy/advanced/settings", \%proxysettings); +} - $remote_mtime = &getlastmod($sourceurl); - $local_mtime = &getmtime("$repository/$updatefile"); +foreach (<$repository/*>) +{ + if (-d $_) + { + unless (/^$repository\/download$/) { push(@sources,$_); } + } +} - 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"; } +foreach (@sources) +{ + @updatelist=<$_/*>; + foreach(@updatelist) + { + if (-e "$_/source.url") + { + 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 +sub writelog { - 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 "$_[0]\n"; + if ($logging) { - 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($_); - } - } - } + 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; } - return $lastmoddate; } # ------------------------------------------------------------------- -sub getdownloadsize +sub setcachestatus { - my $remote=0; - my @response=(); - my $contentlength=0; + open (FILE,">$_[0]"); + print FILE "$_[1]\n"; + close FILE; +} - my $url = $_[0]; +# ------------------------------------------------------------------- - $url =~ s@^(.*)://([^/]*)@@; +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'}\""; + } + } - my $proto = $1; - my $fqhn = $2; + $ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'}; + @http_header = `wget $login --user-agent="$useragent" --spider -S $url 2>&1`; + $ENV{'http_proxy'} = ''; + &writelog(@http_header); - if ((-e "$swroot/red/active") && ($proto eq 'http')) + foreach (@http_header) { - $remote = IO::Socket::INET->new( - PeerHost => $fqhn, - PeerPort => 'http(80)', - Timeout => 1 - ); + 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) } } - if ($remote) + &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$/) { - 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*$/) + if (($remote_size == -s $localfile) && ($remote_mtime == getmtime($localfile))) { - foreach (@response) + &writelog("Status: Ok"); + &setcachestatus("$cdir/status",$sfOk); + } else { + &writelog("Status: Outdated"); + &setcachestatus("$cdir/status",$sfOutdated); + if ($download) { - if (/^Content-Length: /i) - { - s/^Content-Length: //i; - $contentlength=int($_); - } + &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); + } } - 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; + + &setcachestatus("$cdir/checkup.log",time); } # ------------------------------------------------------------------- diff --git a/config/updxlrator/convert b/config/updxlrator/convert new file mode 100644 index 0000000000..25cfae5b66 --- /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 87bae3fc44..4330fcd4bc 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 + system("mkdir $repository/download/$vendorid"); + system("$apphome/bin/setperms download/$vendorid"); +} + +exit if (-e "$repository/download/$vendorid/$updatefile"); + +system("touch $repository/download/$vendorid/$updatefile"); + +if ($cfmirror) +{ + $uuid = `echo $updatefile | md5sum`; +} else { + $uuid = `echo $sourceurl | 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/; + +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'})) { - `/usr/bin/wget -nc -nd -nv -P $updcachedir/download $dsturl 2>&1`; + $login = "--proxy-user=\"$proxysettings{'UPSTREAM_USER'}\""; + if ($proxysettings{'UPSTREAM_PASSWORD'}) + { + $login .= " --proxy-password=\"$proxysettings{'UPSTREAM_PASSWORD'}\""; + } } -if ($debug) { &writelog("Moving file into the cache directory -> \"$updcachedir/$updfile\""); } -system("mv $updcachedir/download/$updfile $updcachedir"); +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"); +} -# --------------------------------------------------------------- -# Write metadata -# --------------------------------------------------------------- +$ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'}; +@http_header = `$wget $login --user-agent="$useragent" --spider -S $sourceurl 2>&1`; +$ENV{'http_proxy'} = ''; -if ($debug) { &writelog("Writing metadata \"$updcachedir/metadata/$updfile\""); } +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: $_"); } +} -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); +$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 0000000000..b25339f824 --- /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 <~plOzpjVbIHl0PE*fd7i-zY%BXOhEuO<8o z?Dt;b`|5R@#axY+O3+NuWEwlDTF5@?knxH+qJC2x@2815n*o~6zFhGLU#UzKd_vJ! zCV?ISm5ceWaQIqWt_c2$@NKogmj!MSc(%ap0)JcJy#oJ5;B^JxTsD45;28oh6L^=9 ze_i0`1x^XvE3gPd_6>nMDCW8(kHp7Q&Bsb*pJ*Qtc)hUKBk)&6`_BZvCGg_{FA?}R zMf!du@E-(j0-0TQY?1v_;Dc`z{F%(26!NCqmj8Xxc&=rS+*w_(UXxd z+o|YbJ=hdgw8*Op)8ffgB(68JKtR)jpE^(q+A9N%#FQg;ycaZEF&(tw7%9MjCHNy3a{nnAUd@Xap> z(@d)EeEb~KjH-wE_&KJTRXh3kIi?v_kMr>ZKlRzmnQQ66n~j?`s5f&YiO2daY97Cr z=6=ZE>g>c?Y&2N$mVF>1To@jI6F zc6_W)&)iOTOFtoOeLV8o7`{+SqOMClncH^Xt|T0T&Y9(LcP#Y%d{A#zbgpu}qquEQGoxt6pVC zFjx!istrKR1>!XvS=%52`vus@4}&jjQJdneiGjeyj zt(O@Uee!vlsiCcuVb|_kRz|*@l`m)HbLqBomOcqjrdJM4Kr=)s{D$gLPq%rQE@Q6X zkU8-`+!z*YVfuz-8Qtnn$<=3Q$1&UPk4)af4>Yu6i(}mu}W`28b#LVAG z@V$EuGjE|+C;GIooZR1N8JEqk3q5x%qssgz$u5%gzlzBkF3ZaO8Tot`{|~IxO~-tQ zm0C1rrRF&4_a(^FuNHY25Vstv6@FO zs-oWj5};a4@LTp^O5}V-?jK&>nU$~FN@hc;ORt84%tv_neRkN*)pCQFH5m9K8ZRIf zHdjEPw%^u)@jW=Q`!urjz0r{!xbZF)p)fd+Q|Y$+vhQ-s`3ZV8o|TmGo)(v7^gL!Upk z#W(vpbn&*YBPnX!EP=)r$^7BnLXEM%Yp4ZxwBm01A5xO9hq5k%;jABZfMWwb0k}>ZKAgS!#nPd?p%_#t3x!1 zS#z?G$=ul9BlKr(u0xvqYdDW4hxcMn_hz==M*^CEgXDppDwyb#=1}luR?hKIuCAOT znF}x^{1}o_yWhqQT{|#Eh^}7|*DKP)5`HgBDBNznw3TPZ$nWY0_!in=p0#yc>Uron zsf2$Mx*ytJ*A$7@h1A5JxG$b)N`&_=)?UGvtFKN?#FRQ!*OOs9W6?Sz84l`7C>T}`EKW>7bI5_Ixmo1jq z6AGLP-B}dsw_&^NHOW&AdIIz;XccG+s2Q{y^cv^~pm#uLK^H(*K%atcgUayjSq*yP z&^Z3BUa?}auV(eS&9%OTIB6~X|9j)tR74_9y3CJ*sgg=Ee>|Zp{uh?7nXdfgwS>rK0^OT5z)&I^rpyHqxcdn>odLvN{_ht6?O zP;Ya{QQp>++W9Pr@fGA0p}$P*8y8E*-l-Mz?r_NEA(w|-qid|3B<`mQa&#wJkHy(n zKK4$paBo(SqkZcA$@X1SvE4n6ILJdT54ks8MR!3c`-L2>3BL!0p;_bT>u~5h2DxM2 z(Ke^t5#d{j*njB$^rBb~=R6;G*ri|L9hLU`Vtqe$$f&bc x?bmvxy++0Baa#CUBJTh4kXt4_IDfxz-ZPUd) { $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) + ) + { + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Adobe",$unique); + } + + # ----------------------------------------------------------- + # Section: Linux Downloads + # ----------------------------------------------------------- + + if ($source_url =~ m@^[h|f]t?tp://[^?]+\.(deb|rpm)$@i) { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Adobe"); + $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: Avira Downloads + # Section: Apple Downloads # ----------------------------------------------------------- - - if ($dsturl =~ m@^http://dl[0-9]\.avgate\.net/.*\.(htm|html|gz)$@i) + + 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)) + ) { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Avira"); + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Apple",$unique); } - - # ----------------------------------------------------------- - # 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: 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: Apple Downloads - # ----------------------------------------------------------- - - if ($dsturl =~ m@^[f|h]t?tp://swcdn\.apple.*\.(pkm|tar)$@i) - { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"Apple"); + # ----------------------------------------------------------- + # Section: Avira Downloads + # ----------------------------------------------------------- + + if ($source_url =~ m@^http://dl[0-9]\.avgate\.net/.*\.(htm|html|gz)$@i) + { + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Avira",$mirror); } # ----------------------------------------------------------- - # Section: AVG Downloads + # Section: IPFire Downloads # ----------------------------------------------------------- - if ($dsturl =~ m@^http://[^/]*\.(grisoft|avg)\.com/.*\.(bin)$@i) + if ($source_url =~ m@^[f|h]t?tp://.*\.(ipfire)$@i) { - $from_local_cache = &cache_access($dsturl,$hostaddr,$username,"AVG"); + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"IPFire",$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"); - #} - - # ----------------------------------------------------------- + # ----------------------------------------------------------- + # Section: AVG Downloads + # ----------------------------------------------------------- + if ($source_url =~ m@^http://[^/]*\.(grisoft|avg)\.com/.*\.(bin)$@i) + { + $xlrator_url = &check_cache($source_url,$hostaddr,$username,"AVG",$mirror); } - 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() + 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+)%$/) { - unless ($_ =~ m/^Filesystem/ ) - { - my ($device,$size,$used,$free,$percent,$mount) = split; - if ($percent =~ m/^(\d+)%$/) - { - close DF; - $percent =~ s/%$//; - return $percent; - } - } + $percent =~ s/%$//; + return $percent; } - close DF; } # ------------------------------------------------------------------- -sub getdownloadsize +sub getmtime { - my $remote=0; - my @response=(); - my $contentlength=0; - - my $url = $_[0]; + my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($_[0]); - $url =~ s@^(.*)://([^/]*)@@; + return $mtime; +} - my $proto = $1; - my $fqhn = $2; +# ------------------------------------------------------------------- - if ((-e "$swroot/red/active") && ($proto eq 'http')) +sub check_cache +{ + my $updsource="UPDCACHE"; + my $updfile=''; + 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)"; + + my $sourceurl=$_[0]; + my $cfmirror=$_[4]; + + $sourceurl =~ s@\%2f@/@ig; + $updfile = substr($sourceurl,rindex($sourceurl,"/")+1); + $updfile =~ s@\%20@ @ig; + + if ($cfmirror) { - $remote = IO::Socket::INET->new( - PeerHost => $fqhn, - PeerPort => 'http(80)', - Timeout => 1 - ); + $uuid = `echo $updfile | md5sum`; + } else { + $uuid = `echo $sourceurl | md5sum`; } - if ($remote) + $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'})) { - 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*$/) + $login = "--proxy-user=\"$proxysettings{'UPSTREAM_USER'}\""; + if ($proxysettings{'UPSTREAM_PASSWORD'}) { - foreach (@response) - { - if (/^Content-Length: /i) - { - s/^Content-Length: //i; - $contentlength=$_; - } - } + $login .= " --proxy-password=\"$proxysettings{'UPSTREAM_PASSWORD'}\""; } } - return $contentlength; -} -# ------------------------------------------------------------------- + if ($proxysettings{'UPSTREAM_PROXY'}) { &debuglog("Using upstream proxy $proxysettings{'UPSTREAM_PROXY'}"); } -sub cache_access -{ - my $updsource="UPDCACHE"; - my $updfile=''; - my $do_redirect=0; - - $_[0] =~ s@\%2f@/@ig; - $updfile = substr($_[0],rindex($_[0],"/")+1); + $ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'}; + @http_header = `$wget $login --user-agent="$useragent" --spider -S $sourceurl 2>&1`; + $ENV{'http_proxy'} = ''; - if (!-e "$updcachedir/metadata/$updfile") + foreach (@http_header) { - open(FILE,">$updcachedir/metadata/$updfile"); - print FILE "$_[0]\n$_[3]\n$sfOutdated\n0\n"; - close(FILE); + 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/$updfile") + if ( + (-e "$updcachedir/$vendorid/$uuid/$updfile") && + ($remote_size == (-s "$updcachedir/$vendorid/$uuid/$updfile")) && + ($remote_mtime == &getmtime("$updcachedir/$vendorid/$uuid/$updfile")) + ) { - open(FILE,">>$updcachedir/metadata/$updfile"); - print FILE time."\n"; - close(FILE); - $do_redirect=1; + &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"; - if ((!$passive_mode) && (&diskusage($updcachedir) <= $maxusage) && (&getdownloadsize <= &diskfree($updcachedir)) && (!-e "$updcachedir/download/$updfile")) + &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")) { - system("$nice/var/ipfire/updatexlrator/bin/download $_[0] &"); + &debuglog("Running command $nice$apphome/bin/download $vendorid $sourceurl $cfmirror &"); + system("$nice$apphome/bin/download $vendorid $sourceurl $cfmirror &"); } + $cacheurl=$sourceurl; } - if ($logging) { &writelog($_[1],$_[2],$_[3],$updsource,$_[0]); } + &writelog($_[1],$_[2],$_[3],$updsource,$sourceurl); - return $do_redirect; + return $cacheurl; } # ------------------------------------------------------------------- diff --git a/html/cgi-bin/updatexlrator.cgi b/html/cgi-bin/updatexlrator.cgi index f3a950afb6..f73172a82e 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 $repository = "/var/updatecache"; +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 $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 $_) + { + unless (/^$repository\/download$/) { push(@sources,$_); } + } + } + + foreach (@sources) { - if (!-d $_) + @updatelist=<$_/*>; + $vendorid = substr($_,rindex($_,"/")+1); + foreach(@updatelist) { - $updatefile = substr($_,rindex($_,"/")+1); - if (-e "$repository/metadata/$updatefile") + $uuid = substr($_,rindex($_,"/")+1); + if (-e "$_/source.url") { - open (FILE,"$repository/metadata/$updatefile"); - @metadata = ; + open (FILE,"$_/source.url"); + $sourceurl=; close FILE; - chomp(@metadata); - - 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"); - } - } + 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'}) { + $xlratorsettings{'EXTENDED_GUI'} = 'maintenance'; + $updatefile = $xlratorsettings{'ID'}; - if (-e "$repository/$updatefile") { unlink("$repository/$updatefile"); } - $updatefile =~ s/^download\///i; - if (-e "$repository/metadata/$updatefile") { unlink("$repository/metadata/$updatefile"); } -} -ERROR: + 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,83 +373,492 @@ print < - - - - - - + + + +END +; + +print" \n"; + +print" \n"; + +print < +
$Lang::tr{'updxlrtr maintenance'}
 $Lang::tr{'updxlrtr all files'} $Lang::tr{'updxlrtr not accessed'} -  >' "; } +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'}
 $Lang::tr{'updxlrtr marked as'}$Lang::tr{[$Lang::tr{'updxlrtr condition nosource'}] $Lang::tr{'updxlrtr marked as'}$Lang::tr{[$Lang::tr{'updxlrtr condition outdated'}][$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(); -print "\n"; +} + +# ===================================================================================== +# CACHE MAINTENANCE +# ===================================================================================== + +if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance') +{ + # ---------------------------------------------------- # File list dialog # ---------------------------------------------------- -&Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr current files'}:"); +&Header::openbox('100%', 'left', "$Lang::tr{'updxlrtr cache maintenance'}"); -@repositorylist = <$repository/download/*>; +@sources= <$repository/download/*>; undef @repositoryfiles; -foreach (@repositorylist) +foreach (@sources) { - if (!-d) + if (-d) { - $updatefile = substr($_,rindex($_,"/")+1); - $updatefile = "download/$updatefile"; - push(@repositoryfiles,$updatefile); + @updatelist = <$_/*>; + $vendorid = substr($_,rindex($_,"/")+1); + foreach(@updatelist) + { + $updatefile = substr($_,rindex($_,"/")+1); + $updatefile .= ":download/$vendorid/$updatefile"; + $updatefile = " ".$updatefile; + push(@repositoryfiles,$updatefile); + } } } -@repositorylist = <$repository/*>; +undef (@sources); +foreach (<$repository/*>) +{ + if (-d $_) +{ + unless (/^$repository\/download$/) { push(@sources,$_); } + } +} -foreach (@repositorylist) +foreach (@sources) { - if (!-d) { push(@repositoryfiles,substr($_,rindex($_,"/")+1)); } + @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 < +
+ + + + + + + + + + + + + + + + +
 $Lang::tr{'updxlrtr all files'} $Lang::tr{'updxlrtr not accessed'} +
 $Lang::tr{'updxlrtr marked as'}$Lang::tr{[$Lang::tr{'updxlrtr condition nosource'}] $Lang::tr{'updxlrtr marked as'}$Lang::tr{[$Lang::tr{'updxlrtr condition outdated'}]
+
+
+ + +
$Lang::tr{'updxlrtr current files'}
@@ -374,7 +871,7 @@ if (@repositoryfiles) - + 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; - - ($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; } - - ($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; } + ($vendorid,$uuid,$shortname) = split('/',$updatefile); + + 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[-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\n"; + print "$Lang::tr{ \n"; } - if ($metadata[2] eq $sfOk) + if ($status == $sfOk) { - print "$Lang::tr{ \n"; + print "$Lang::tr{ \n"; } - if (($metadata[2] eq $sfOutdated) && (!($updatefile =~ /^download\//i))) + if ($status == $sfNoSource) { - print "$Lang::tr{ \n"; + print "$Lang::tr{ \n"; } - if (($metadata[2] eq $sfOutdated) && ($updatefile =~ /^download\//i)) + if (($status == $sfOutdated) && (!($updatefile =~ /^download\//i))) { - print "$Lang::tr{ \n"; + print "$Lang::tr{ \n"; } - if ($metadata[2] eq '') + if (($status == $sfOutdated) && ($updatefile =~ /^download\//i)) { - print "$Lang::tr{ \n"; + print "$Lang::tr{ \n"; } print "\t\t\n"; - } elsif ($metadata[1] eq 'Microsoft') + print "Adobe \n"; + } elsif ($vendorid =~ /^Microsoft$/i) { - print "Microsoft \n"; - } elsif ($metadata[1] eq 'Symantec') + print "Microsoft \n"; + } elsif ($vendorid =~ /^Symantec$/i) { - print "Symantec \n"; - } elsif ($metadata[1] eq 'Avira') + print "Symantec \n"; + } elsif ($vendorid =~ /^Linux$/i) { - print "Avira \n"; - } elsif ($metadata[1] eq 'AVG') + print "Linux \n"; + } elsif ($vendorid =~ /^TrendMicro$/i) { - print "AVG \n"; - } elsif ($metadata[1] eq 'Avast') + print "Trend Micro \n"; + } elsif ($vendorid =~ /^Apple$/i) { - print "Avast \n"; - } elsif ($metadata[1] eq 'IPFire') + print "Apple \n"; + } elsif ($vendorid =~ /^Avast$/i) { - print "IPFire \n"; - } elsif ($metadata[1] eq 'Apple') + print "Avast \n"; + } elsif ($vendorid =~ /^Avira$/i) { - print "Apple \n"; - } elsif ($metadata[1] eq 'Kaspersky') + print "Avira \n"; + } elsif ($vendorid =~ /^AVG$/i) { - print "Kaspersky \n"; - } elsif ($metadata[1] eq 'Linux') + print "AVG \n"; + } elsif ($vendorid =~ /^Ipfire$/i) { - print "Linux \n"; - } else + print "IPFire \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 + @@ -513,7 +1038,7 @@ print <$Lang::tr{ - + @@ -523,125 +1048,102 @@ print <  - + - + - + - + - + + + + + + + + + + + + + + + + - + - + - - + + - - + + - - + + + + + + + - - - - + + + + + + + + - - - + + - - - - + + - - + + + + + - - +
$Lang::tr{'updxlrtr filesize'} $Lang::tr{'date'} $Lang::tr{$Lang::tr{$Lang::tr{  
 "; - if ($metadata[2] eq $sfNoSource) + if ($status == $sfUnknown) { - print "$Lang::tr{  "; - if ($metadata[1] eq 'Adobe') + if ($vendorid =~ /^Adobe$/i) { - print "Adobe $shortname  $filesize   $filedate   $lastaccess $Lang::tr{'updxlrtr last access'}  $Lang::tr{$Lang::tr{ $Lang::tr{'updxlrtr last checkup'}   $Lang::tr{

  $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'}:  AdobeAdobe Adobe  MicrosoftMicrosoftAppleApple  SymantecSymantecAvastAvast  AviraAviraLinuxLinux
 AVGAVG  AppleAppleMicrosoftMicrosoft SymantecSymantec Trend MicroTrend Micro  
  IPFire IPFire
 LinuxLinux  AvastAvastAviraAvira  KasperskyKasperskyAVGAVG $Lang::tr{$Lang::tr{'updxlrtr other'}  $Lang::tr{$Lang::tr{'updxlrtr unknown'}  
END ; -} else { - print "$Lang::tr{'updxlrtr empty repository'}\n"; } -print < - - - -
$Lang::tr{'updxlrtr disk usage'}:
+&Header::closebox(); - -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(); @@ -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 zc-k#fZERCz6n(K@Cs%OV4YS%`uC@r#Ie>dE=>9t z=hQt_yLDS5C6xR|2wDW}reF@T?l7&TbQGaBh_xaZWoJlAj3tG%7mOOl5lW?Cb`qM9 zZ;ygaVRMYS642`L%!^=G=>SKqVst*ng#;E4a}!Ri6u}gYUW}rflSdVtLUkeurWrVj z)U832Oe-ml>E$AmDJ0jj$fg9woNKDSE&VF8SiD*m; z^@5c4vsM{>GWO_$Q!x7FF&Ro_F0MDMVm+shX}CM8>bO?rIyma1+U$&+4Wc>XO^bAZ zLNmk7VYY}ulUG{svdtN=%4{SiObOtUmC+c~@?gD*t_*9I!NqeU3~YY1CfFIqe4=w$ znaO7E|9xNiH7H(;V85VDCA?#vz(`Q&_bAgr>c~vaX=*A%eF~Ne&?bt5L0laU4=1q4 z8CytVJHrr%4jFB_M)(dVJ;>2T2Btf(+5_eU?v^H}XIMX_l~FaFNsMSvt>Oz&DCMQB zALBf$W;9LF9p#3dU=H{%2CxBH1EcOFm}B&18O)k@&LdPySRZ2z5+2n96|@D=oTOF> zEHOGrr3EpQ&Y(%ABUGKzXi5)P;S{B18Ja>cX<(PwL7Ao~*kx{jLw9C!UIU9pMI|0b-{QOO^m`*jh1iC+4N+`I>5 z*>d*e(5E%;oKO8YRAZd_Ds=YYYj1woYFM+Y=Fk%eEd}cz?Jnn5lyC5HCruym^`3J@ z`O6wwPfp)ko}2DE%bjS+k}Ew`bfYt6H=H{6Nmu>&?>kzo8`o`6I=}1srfU!mm_Gh< zvDlJJzwnlP|ABJZ_L7*q>fV;{_8AJ=#@+4iW4SH4`4#&e_V>2?0>!Ha+7>3Z>|0~H z`b)`eQ+RI)Y~IRU*>$Wg9{K5P_p!bL{_-pI-r79H)abW=-t%Q_&k0UE&97(HQq{W?(FT# SxgPpjsXQQG-(fJ2$NvG*7Jg9x literal 0 Hc-jL100001 diff --git a/html/html/images/updxl-gr.gif b/html/html/images/updbooster/updxl-gr.gif similarity index 100% rename from html/html/images/updxl-gr.gif rename to html/html/images/updbooster/updxl-gr.gif diff --git a/html/html/images/updxl-led-blue.gif b/html/html/images/updbooster/updxl-led-blue.gif similarity index 100% rename from html/html/images/updxl-led-blue.gif rename to html/html/images/updbooster/updxl-led-blue.gif diff --git a/html/html/images/updbooster/updxl-led-gray.gif b/html/html/images/updbooster/updxl-led-gray.gif new file mode 100644 index 0000000000000000000000000000000000000000..ccac733b8a8cdb72368c9c023771215ca8109e6b GIT binary patch literal 158 zc-nLKbhEHb6k!lySi}GVO-)V5jvc#y|Ni&y-~ayo3l?Kg{K>)zqIEz7NG$_LG6N%r zjK_ur2b(#BwPH9F8l2mCr0wQNI6QP_lrRj_nQ&oY10#zOm&SpQ3yw3gvUSKrZd%~Z zq!m8NL^5INiJ5G+w~lmNPCYwUNAT5@n?~vlOfKD0DkryO9$Dt4>^0YGtJa|g25SJ3 CxHd!p literal 0 Hc-jL100001 diff --git a/html/html/images/updxl-led-green.gif b/html/html/images/updbooster/updxl-led-green.gif similarity index 100% rename from html/html/images/updxl-led-green.gif rename to html/html/images/updbooster/updxl-led-green.gif diff --git a/html/html/images/updxl-led-red.gif b/html/html/images/updbooster/updxl-led-red.gif similarity index 100% rename from html/html/images/updxl-led-red.gif rename to html/html/images/updbooster/updxl-led-red.gif diff --git a/html/html/images/updxl-led-yellow.gif b/html/html/images/updbooster/updxl-led-yellow.gif similarity index 100% rename from html/html/images/updxl-led-yellow.gif rename to html/html/images/updbooster/updxl-led-yellow.gif diff --git a/html/html/images/updxl-rd.gif b/html/html/images/updbooster/updxl-rd.gif similarity index 100% rename from html/html/images/updxl-rd.gif rename to html/html/images/updbooster/updxl-rd.gif diff --git a/html/html/images/updxl-src-adobe.gif b/html/html/images/updbooster/updxl-src-adobe.gif similarity index 100% rename from html/html/images/updxl-src-adobe.gif rename to html/html/images/updbooster/updxl-src-adobe.gif diff --git a/html/html/images/updbooster/updxl-src-apple.gif b/html/html/images/updbooster/updxl-src-apple.gif new file mode 100644 index 0000000000000000000000000000000000000000..1d7fe8e20d186889a63313c8d5e4eb7ea7009f1f GIT binary patch literal 1027 zc-l=<4`>@z9RAWKO&XkbXEWm#u`6{dTQS;-8P*Zn60#_j58Z!&e1`@D#uKk zv(|FVH9O~4j$q3XBpyM^(MdTGAotLB&AMZUr-tYH) z@B4VXmyZT~hu$M(nQ30g$=r-6=4I{AZE0CmN;-9g6N@UFHcLu$gp!Jidb`5T zN@8ANGlIOP(MeV*Rp?1hxutVifliru<>&}4njY4)$hjzWkzvw;vZk|Hk)M+k^U`Tv z%*nt$R7a<|49#kkU=T1&yrdaDR^uTUgMjxuj@(4o4dCOQ_WJ0wn47Bx+c-<941%cQ zEHi$ z=>-DGD#HhqfttSWb8H<1k*FTKflXkdra1)IQ17lqxIaI7+Hbp#h`P-T&i1h{_iOoUFU#*fPjhjZ&}TUc@BrFh3cQMJJxa1;R$*v z+lb@g@h_7Vf7b4~_kDH5NJA*Vyr(&(alkHhZ7?@jJgG?QA;G*E6tt zV!bfh5N>(Bt@mWUsd+CM`sA)Q{s=WF;Ba!$KHzzb?g;uC9PY>8ZSM~+{S+K;Z+bW+I-aYYm MG8!8s!+yN@FQFBlEC2ui literal 0 Hc-jL100001 diff --git a/html/html/images/updbooster/updxl-src-avast.gif b/html/html/images/updbooster/updxl-src-avast.gif new file mode 100644 index 0000000000000000000000000000000000000000..5aceddad1d995b134d22c8bf82842aab6580118b GIT binary patch literal 1032 zc-l=-Z%7+=7=Cm9s!oF1+bL>eNJB_RO(hG5bXjHMyAp5?z!5%rYgl1#R<2&3YUvqXo;MicCupfi(He?)wc zMHor@1yn=n8tF(>LH1zkRaV!|b4w{g&j>47;xI$ch*~2R3@0rEaa2MQjS($w;@4#9 znc|DenO()w$?NP4!c4(1=ea67J6SF&dIkjXHw9r%R6|?bKK8cky)2m;d?vfg6;6_8 zMaCc3>Z#Nc_b18ywD*0GpE^yMr48k0!(&KV_ zEOwUci114?zowwWUhZRpScn`P(YsGhYnPzclUD;dYMj7lit zw8+jU*>5G2nWXz8v|r?IW>T*d?q&+uZJBIvc~nuo32IuBRYOiN)Tl)Jd1giuR}{j=iVw3|Go9E_ z$VN8#LS1yA8V{=XqCyLMJ>}?#XrKZB&P@Xp16TkGAT$V1IrU5PK{5boP?I|VJ72+e z9pC`~A5=l{3xHXO`2aoz*ar~Kmm&ARcOF{yX;<4OKyU3-&nh02`XudYzMG7flZa z0tTP2PXmMbEikD5z+jJ+>jUUlNoKT$G&u2Cm)iBe?72VR_ux2u4hR218i3F8CgvT( zp{V#NJSo<_zi@4NoOUHYSlxKkWIVI}@~7ob(1ADU(z(giCsSB;$<>9e+1YDT1*7YZ zYO8Vbhp$h&${i4$bJjL{;}^rByW`_#ap!Ma)1d=)yEkTSJ`%mt=2F(Rwx;E=soL1v zUA8uZ?W|cUuMRD~Ro37VPqmmACMvCTVf^RjR^!PdLnFm0{FnPq{U|1oe|7v=IezGd zb?f)piRm}=H*`l0i_Zi4{daf%=r)F?ii)z>7uMc^vfl67jt!l<`0=e@-|INmv^3m) e&Og3l_(mMrzVc^bLFgkqR=a;qe@Gi=7{?#uMW-Cj9sd_U0eukP!~c{XPif=8L@QkCJj2}!^ApK%ci7Bv$!Q_8Dat8D-^i*fl6jP2 zz6_}=x}FyFb=J)3zVkQ}r&Z7zWx=%K&Rov>3aB z2Z4mD#EC!zD+d;4r7ci{Acpk`Wkm#`c-){&Rhr5FqW=mV$AMWh; zV)r}k{4(5$KH9As$81I{94r#71XxTlS`F|V#FIIXfwUlD0rM3^w_x|*`N$4x`+Rl*-u_MTigB^)uz1fl$>Gl zE0??Pwqf;WAcVO?cQMTIn-;9@dy0BLe=<_tP}^1B(zqP?_Pwo^S2*X>R<8k_KeSf{ zrBU{I^gA!9C_`H}7Ai{v73JrJa@yk%) fgMiroV0htN;+mrp98S#p2I50kTEB<};jMoFobt7U literal 0 Hc-jL100001 diff --git a/html/html/images/updxl-src-symantec.gif b/html/html/images/updbooster/updxl-src-symantec.gif similarity index 100% rename from html/html/images/updxl-src-symantec.gif rename to html/html/images/updbooster/updxl-src-symantec.gif diff --git a/html/html/images/updbooster/updxl-src-trendmicro.gif b/html/html/images/updbooster/updxl-src-trendmicro.gif new file mode 100644 index 0000000000000000000000000000000000000000..e34ec543eaf6ac3890ef971abff64db9bda78e9d GIT binary patch literal 1040 zc-l>qVN6?96vt1?E3ooJ@@zLCUE^w_0u>QoX05f-(R5GBbVfqE9l1=4JiyaI9> za(#uwSJ0x9^g0~%5vQZ*6-YdRlsS{dg~c?ra+z=~k)_IB2CqbM%#C-8gzCRagz{gH z;;3m)Nseu|60d<)i`~VT#n!NRF(GS zguCUNJEvdZU>ZOKGe91oj9@+oJ1xM4N^(8GHo*B(2qOS0*sTWnf9q6}U3C?vXFwFe z#mWTaKtvX4hPQ(N+R$!81mp)Gb5!2t(Uy5YCn)j-;K~Q{4?!4$P!Fwt&FmmMg#cH& zOIQ6H`E4(EzK`nbaK>}Bpq=5$o;=6`$RUu$@7V({!=Kg&=LdM7zY!JWR7m!V9}ajn zbAHR5Pm1?~--b&RtaOb%nzX zKi&q zl57CBY5>`10R3eE0G9wGl>kPP0BVl_jg0`YiU8Dz0QiLf0J#7jwg5r20A;ZNh_3*w ztN_oc0Q08+0NDT;*8n`!0ASGogUC0Q&$F_y9Nd09*3_e(?aJ?f}K> z0O{!f5)xfC5L;LcSbPgsp9oXK1yJS#PX7Q)4Kr9UFjiA8Q+F#-nki1cCQIQXN&g{6 z2vbulQBh7#PI602l}SmtMn>F3ME^lS19eU&a!g5ZNo{RLkZVM=XhGLyKKo-l0F_B0 zlSV|4L}-pdi;F+6h&vhOIfOsyEH3HSwh~0M|bk)jT@V zI$qE>fz36g$}-5vFYLuF0Qou+_ct~4HCgd8eD5!y>@CCUD(B}Y5D=&{4y9HLqIwCS zo(7)51DoXmnEwEl3^AiFE}&5?o^>gkm?oIKB$nVIlm8!)22q|VPn%3knQ%&$lSh-c zM3LJ~W(}y_Fgj~*nf6ITP$$ZAfdg{Y> z0QZCt^no+-e^>8(dhL3i>UY8Dbmir84i54%4DeJ5?Rf|4n*`{<0_EZW;{O2P2`}v| zEb31x=yWILmL=o6BH-O0-Txii1W)KEP31~T<8MgdkwxCNL)+Ov+5J7%0CD3YZ{S62 z-f3yujAz-fWY*JR)AwJ|0FmAukJ~_v*<^~=hlkXwh0)G}&hmfE0JGT`vDQ1T)L*O7 zf~n4?rp(Et$?c)X0MyhI(a|=~&sxmPeaXq8$H)Ks?x&}$iHV8-000300RR604GsVQ z0RI60|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 Hc-jL100001 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 Hc-jL100001 literal 1010 zc-lRae@Gi=7{|ZYsL5;y@k*>rE7z@qp>B0H3vvBpp^bJM1M^2=Ss6t~vPG&z+d#{9 z#M7LqNaosbl_5uV+M|dZvX&sFWW|jj!-Wn?EKI^^yU>^)NCsKEmC$#0C+y|rc;5Fu zJkRHO;63$Wzq5CU294*y$X9&wUNRb2a!+#noFK0%=?59{rozYMU__`stIDg%%yzb1 zEQ>42=z^@QC4*DZ)Mi?UC!+HrJ1Yi5QGQO$Jj{wW6a2i)&kD7dwUH2?+(_r1mNO4C z?5t3IQB!Uwvw!5uyH#Z^B`hTbwc^tp9}|?@iOhqHyrM*7G8++;RTayYcgylhQdm$D zca!P+89pY;D{4787~)eK>Dr5$xRi)(J6MEBgb)KEW{dfu9t)MGpX z3b4^omn*^;3=GWuS}a6fmJBVlS^Kd}dlx8M7+?YSb(AX5`Osz)EWp0@^)G-(9Sp-T zs{{!DD?x(5K~x7U67@#kXsQ4Kv}+8m?x5XwUE#u#5OLa4gs{kb0092n%&|g9LE`j({D7yPiU9&!OP1c7h9oRS%*U z#lLK{ULi%$Nf1_Xtz$1>+moosRKA2}ov}ZI&x!EIYNAgFUnM1u&?-J7T`HEWG(Dg( zqj$W%k}XWDj1;gJx_tD2ChF#bL+_R^4$x|U!?=5qB0&%a6X(Qkf3ZAF)8_#{Dh!o( zqj?Aj&e;7v-*8wHbx{=`@*ZgOp)i5I9yJBNgv$@#d3gNV03W-*`Elq;U+|QgS&sUw2?}HU!J`{z0%p#5qER^R{Xx2M%VK(^)h%V6Q-#*~10l)!d7YubdZEoD K-Ev&vaQr_By?dGf diff --git a/html/html/images/updxl-src-avast.gif b/html/html/images/updxl-src-avast.gif deleted file mode 100644 index 93bf6254b462fbd34646f8cfc4cf7f7dd6c7afc8..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 1117 zc-lRa4@etV9LIkdYBS7iyv5bhG>e&xc7~GKRAQHgsA+WKw05b}a+50OpUE}Y^w24X zi{{K+xVbfC>g33x93pbaaG{fuxtiWekx({!lu<$_61Fymj&5nUm9X0-h5dLu-tY0@ zeZRjiy!yB8rs^&P5cmr~^@^IFW*leH*j9{ik=$xnf6T!I*~G6Y!WD3|k+xbivcbpi z#hG9j>!s*vj+&sUi2&9~2-||$g7Q%z{WNW^#VIdqtTdCO6n`_uE=e%$Xv4!-Baw|5 z?F*FajDZ=(ScL^63ZUmH zn;nhckF$$myq602Im$~@-T>B32zLekrjU7-w$>?MxpP;32yi8LwL5|VkwMgU|?`R|VXpET; z^HHAmF#*4nCu*}`p%@H5finnXOAGBfXJy(wIFw_IPXRN5r%8I~J&{U_du|bt@Tt&na!-jM zEm`K`dONmP;z1-v)^7wo1}#~mjGO2=k)m3VZvhN&4P=svv_1mH0Lc{OJUjsT6Pb1h zvN?zlZ5lr_Y%`fZ;y4+yh}JRQ14^7C76d54&~|q8@sn?4P`x zb$xcr{)v5Z5q>wA(jJ*dsTdoayX5sD8s&)X=ZVniuPiUI4GY%Et-|BQBkQI+J4Gd@ zMop^G8y9{IDKG0Z+PZ}^3p3ih7dP(|&>>mz(Ztcb+FSlAl2Wag)p_TO-W*vTEZ*0$ z2vZF^KOOA)?C{|--9X2s>qY*`@gjYPZsLcl<%_>v#-CSB3fUb z`4~Y)f`(7N(>0dvcOrwb8`|C3a;I~-xS47wIH7DhqNv`fn=5Kom%5;!KvOtrwV!mj zmK7n}@#c1US53>SHLZ1xkKe5yXAa1fiZ3_Iuv^vY#OL{1n=ojX9r*jVU(~(q*PD4d KT-IuZxBdfnFunW$ diff --git a/html/html/images/updxl-src-windows.gif b/html/html/images/updxl-src-windows.gif deleted file mode 100644 index ab593e156334fe3591b6096a499442cdb9cca2da..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 1052 zc-kFPZ-|e15Fc5)l)W5Q*h{0%)g9r=F3y`dFP3fN>PqgUYosLE3N#I-}(HTXGLqvlBF9a!(8Hj-ygh3gM!8s?R010q` zPyrM0z*0a3QeXv9Pz6(P1u#GZGGGHSPy;h?18_hGa$pB>PzQ5x56;0c=mc_r#Jso~ zr;;Ti5fUQ_k|G(B7wXZDVj>|@A|vvm2RXaUBuvU=OkPBy`b(qH6c$t=R6EXLx+bj*X%%hCu}#7h#WsfRVYs$wc$;z3K1YQM$@kT>6-_S^e&iDxqoZ>`Iet%R%-wG z|LMuLEAt1Mdlqil*izY7w|>s)(HlQk8k)a<{mqlF{lf15?zY}~{nh2#b4_- zZvU!>`eDz&nblqEJ{s5e=ot1cYVT{lcy8z5y~dici+kG^Zky7-r+wYU&JE9hJZ{zg zfw?`aZtnZw*Y@F&C!757&I3)Y=kHuPSl_s}W4PY)^K6VvlB