Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package MirrorCache for openSUSE:Factory checked in at 2021-10-15 23:03:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/MirrorCache (Old) and /work/SRC/openSUSE:Factory/.MirrorCache.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "MirrorCache" Fri Oct 15 23:03:43 2021 rev:2 rq:925205 version:1.011 Changes: -------- --- /work/SRC/openSUSE:Factory/MirrorCache/MirrorCache.changes 2021-10-01 22:29:24.405413214 +0200 +++ /work/SRC/openSUSE:Factory/.MirrorCache.new.1890/MirrorCache.changes 2021-10-15 23:04:00.114099102 +0200 @@ -1,0 +2,14 @@ +Thu Oct 07 07:01:48 UTC 2021 - Andrii Nikitin <[email protected]> + +- Update to version 1.011: + * Improve openSUSE theme + * Fix sql error when mirror has no files + * Introduce hasall mirror capability + * Change behavior filtering mirrors based on supported IP version + * Fix mirrorlist for the same region + * Schedule scan even when Geo for IP is not detected + * Improve detection of ipv4 + * Fix syntax error after perl upgrade + * Properly redirect for symlinks in subtree + +------------------------------------------------------------------- Old: ---- MirrorCache-1.010.obscpio MirrorCache-1.010.tar.xz _servicedata New: ---- MirrorCache-1.011.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ MirrorCache.spec ++++++ --- /var/tmp/diff_new_pack.N1EyUB/_old 2021-10-15 23:04:00.766099567 +0200 +++ /var/tmp/diff_new_pack.N1EyUB/_new 2021-10-15 23:04:00.770099570 +0200 @@ -21,7 +21,7 @@ %define main_requires %{assetpack_requires} perl(Carp) perl(DBD::Pg) >= 3.7.4 perl(DBI) >= 1.632 perl(DBIx::Class) >= 0.082801 perl(DBIx::Class::DynamicDefault) perl(DateTime) perl(Encode) perl(Time::Piece) perl(Time::Seconds) perl(Time::ParseDate) perl(DateTime::Format::Pg) perl(Exporter) perl(File::Basename) perl(LWP::UserAgent) perl(Mojo::Base) perl(Mojo::ByteStream) perl(Mojo::IOLoop) perl(Mojo::JSON) perl(Mojo::Pg) perl(Mojo::URL) perl(Mojo::Util) perl(Mojolicious::Commands) perl(Mojolicious::Plugin) perl(Mojolicious::Plugin::RenderFile) perl(Mojolicious::Static) perl(Net::OpenID::Consumer) perl(POSIX) perl(Sort::Versions) perl(URI::Escape) perl(XML::Writer) perl(base) perl(constant) perl(diagnostics) perl(strict) perl(warnings) shadow rubygem(sass) perl(Net::DNS) perl(LWP::Protocol::https) perl(Digest::SHA) %define build_requires %{assetpack_requires} rubygem(sass) tidy sysuser-shadow sysuser-tools Name: MirrorCache -Version: 1.010 +Version: 1.011 Release: 0 Summary: WebApp to redirect and manage mirrors License: GPL-2.0-or-later ++++++ MirrorCache-1.010.obscpio -> MirrorCache-1.011.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/.gitignore new/MirrorCache-1.011/.gitignore --- old/MirrorCache-1.010/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/MirrorCache-1.011/.gitignore 2021-10-07 08:44:23.000000000 +0200 @@ -0,0 +1,7 @@ +.sass-cache/ +assets/cache/ +assets/assetpack.db +t/lib/src/ +/*[0-9] +/ca +templates/branding/SUSE* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/assets/stylesheets/overall.scss new/MirrorCache-1.011/assets/stylesheets/overall.scss --- old/MirrorCache-1.010/assets/stylesheets/overall.scss 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/assets/stylesheets/overall.scss 2021-10-07 08:44:23.000000000 +0200 @@ -179,6 +179,14 @@ min-width: 100%; } +#fileinfo { + border-radius: .25rem; + background-color: rgba(0, 0, 0, .03); + padding: 10px; + word-wrap: break-word; + margin: 1rem 0 1rem 0; +} + .break-long-content, .name { overflow-wrap: break-word; word-wrap: break-word; @@ -186,6 +194,13 @@ white-space: unset !important; } +.name { + width: 100%; +} +.mtime, .size { + text-align: right; +} + .breadcrumb { margin-top: 5px; margin-bottom: 2px; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/assets/stylesheets/slim-chameleon.scss new/MirrorCache-1.011/assets/stylesheets/slim-chameleon.scss --- old/MirrorCache-1.010/assets/stylesheets/slim-chameleon.scss 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/assets/stylesheets/slim-chameleon.scss 2021-10-07 08:44:23.000000000 +0200 @@ -225,7 +225,6 @@ footer, .footer { padding: 30px 0; color: #6c757d; - background: #f8f9fa; - position: absolute; + background: rgba(0, 0, 0, .025); bottom: 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/assets/stylesheets/tables.scss new/MirrorCache-1.011/assets/stylesheets/tables.scss --- old/MirrorCache-1.010/assets/stylesheets/tables.scss 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/assets/stylesheets/tables.scss 2021-10-07 08:44:23.000000000 +0200 @@ -67,7 +67,7 @@ } .table th, .table td, .breadcrumb { - padding: 2px; + padding: 5px; } .table th, .table td { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/lib/File/Listing/Rsync.pm new/MirrorCache-1.011/lib/File/Listing/Rsync.pm --- old/MirrorCache-1.010/lib/File/Listing/Rsync.pm 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/lib/File/Listing/Rsync.pm 2021-10-07 08:44:23.000000000 +0200 @@ -3,7 +3,6 @@ use Mojo::Base -base; use Socket; -# use Mojo::Exception; use Data::Dumper; has 'addr'; @@ -52,7 +51,7 @@ } die "Cannot parse url '$url'\n" unless $url =~ m{^([^:/]+)(:(\d*))?(/(.*)/?)?$}; - my ($host, $_, $port, $path) = ($1,$2,$3,$4); + my ($host, undef, $port, $path) = ($1,$2,$3,$4); $path = $5 if $path; $self->set_host($host); $self->port($port) if $port; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/lib/MirrorCache/Datamodule.pm new/MirrorCache-1.011/lib/MirrorCache/Datamodule.pm --- old/MirrorCache-1.010/lib/MirrorCache/Datamodule.pm 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/lib/MirrorCache/Datamodule.pm 2021-10-07 08:44:23.000000000 +0200 @@ -33,7 +33,7 @@ has '_original_path'; has 'must_render_from_root'; has '_agent'; -has [ '_is_secure', '_is_ipv4', '_is_head' ]; +has [ '_is_secure', '_is_ipv4', '_ipvstrict', '_is_head' ]; has 'mirrorlist'; has 'json'; has [ 'folder_id', 'file_id' ]; # shortcut to requested folder and file, if known @@ -213,6 +213,13 @@ return "ipv6"; } +sub ipvstrict($self) { + unless (defined $self->_ipvstrict) { + $self->_init_req; + } + return $self->_ipvstrict; +} + sub is_head($self) { unless (defined $self->_is_head) { $self->_init_req; @@ -237,9 +244,29 @@ sub _init_req($self) { $self->_is_secure($self->c->req->is_secure? 1 : 0); $self->_is_head('HEAD' eq uc($self->c->req->method)? 1 : 0); - $self->_is_ipv4(1); - if (my $ip = $self->ip) { - $self->_is_ipv4(0) if index($ip,':') > -1 && $ip ne '::ffff:127.0.0.1' + $self->_ipvstrict(0); + my $query = $self->c->req->url->query; + my $p; + $p = $query->every_param('IPV'); + if (scalar(@$p) && $p->[-1] ne '0') { + $self->_ipvstrict(1); + } + $p = $query->every_param('IPV4'); + if (scalar(@$p) && $p->[-1] ne '0') { + $self->_is_ipv4(1); + $self->_ipvstrict(1); + } + $p = $query->every_param('IPV6'); + if (scalar(@$p) && $p->[-1] ne '0') { + $self->_is_ipv4(0); + $self->_ipvstrict(1); + } + unless (defined $self->_is_ipv4) { + $self->_is_ipv4(1); + if (my $ip = $self->ip) { + $ip =~ s/^::ffff://; + $self->_is_ipv4(0) if index($ip,':') > -1; + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/lib/MirrorCache/Schema/ResultSet/Server.pm new/MirrorCache-1.011/lib/MirrorCache/Schema/ResultSet/Server.pm --- old/MirrorCache-1.010/lib/MirrorCache/Schema/ResultSet/Server.pm 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/lib/MirrorCache/Schema/ResultSet/Server.pm 2021-10-07 08:44:23.000000000 +0200 @@ -24,7 +24,7 @@ my ( $self, $country, $region, $folder_id, $file_id, $capability, $ipv, $lat, $lng, $avoid_countries, $limit, $avoid_region, - $mirrorlist, $vpn + $schemastrict, $ipvstrict, $vpn ) = @_; $country = '' unless $country; $region = '' unless $region; @@ -76,7 +76,14 @@ my $weight_country_case = ($avoid_country or $avoid_region) ? '' : "when country $avoid_country= '$country' then 2 "; my $ipvx = $ipv eq 'ipv4'? 'ipv6' : 'ipv4'; my $capabilityx = $capability eq 'http'? 'https' : 'http'; - my $extra = $mirrorlist? '': "WHERE no4 = 0 and no5 = 0"; + my $extra = ''; + if ($schemastrict && $ipvstrict) { + $extra = "WHERE no4 = 0 and no5 = 0"; + } elsif ($schemastrict) { + $extra = "WHERE no4 = 0"; + } elsif ($ipvstrict) { + $extra = "WHERE no5 = 0"; + } my $hostname = $vpn? "CASE WHEN length(s.hostname_vpn)>0 THEN s.hostname_vpn ELSE s.hostname END" : "s.hostname"; my $sql = <<"END_SQL"; @@ -89,7 +96,7 @@ (2*(yes1 * yes1) - 2*(case when no1 > 10 then no1 * no1 else 10 * no1 end) + (case when yes2 < 5 then yes2 else 5 * yes2 end) - (case when no2 > 10 then no2 * no2 else 10 * no2 end)) weight1, case $weight_country_case when region $avoid_region= '$region' then 1 else 0 end weight_country, (yes3 * yes3) - (case when no3 > 5 then no3 * no3 else 5 * no3 end) weight2, -last1, last2, last3, lastdt1, lastdt2, lastdt3, score, country, region, lng +last1, last2, last3, lastdt1, lastdt2, lastdt3, score, country, region, lng, no4, no5 from ( select s.id, concat($hostname,s.urldir,f.path,'/',s.name) as uri, @@ -128,10 +135,10 @@ group by s.id, s.country, s.region, s.score, $hostname, s.urldir, s.name, s.lat, s.lng, f.path ) x $extra -order by last1 desc nulls last, last2 desc nulls last, weight_country desc, weight1 desc, weight2 desc, score, lastdt1 desc nulls last, lastdt2 desc nulls last, last3 desc, lastdt3 desc, random() +order by no4, no5, last1 desc nulls last, last2 desc nulls last, weight_country desc, weight1 desc, weight2 desc, score, lastdt1 desc nulls last, lastdt2 desc nulls last, last3 desc, lastdt3 desc, random() limit $limit ) xx -order by last1 desc nulls last, last2 desc nulls last, weight_country desc, weight1 desc, (dist/100)::int, weight2 desc, score, last3 desc nulls last, dist, random() +order by no4, no5, last1 desc nulls last, last2 desc nulls last, weight_country desc, weight1 desc, (dist/100)::int, weight2 desc, score, last3 desc nulls last, dist, random() limit $limit; END_SQL my $prep = $dbh->prepare($sql); @@ -165,7 +172,8 @@ '://', CASE WHEN length(s.hostname_vpn)>0 THEN s.hostname_vpn ELSE s.hostname END, s.urldir,f.path) as url, -max(fds.folder_diff_id) as diff_id, extract(epoch from max(fd.dt)) as dt_epoch +max(fds.folder_diff_id) as diff_id, extract(epoch from max(fd.dt)) as dt_epoch, +cap_hasall.capability as hasall from server s join folder f on f.id=? left join server_capability_declaration cap_http on cap_http.server_id = s.id and cap_http.capability = 'http' and not cap_http.enabled left join server_capability_declaration cap_https on cap_https.server_id = s.id and cap_https.capability = 'https' and not cap_https.enabled @@ -173,12 +181,13 @@ left join server_capability_force cap_fhttps on cap_fhttps.server_id = s.id and cap_fhttps.capability = 'https' left join folder_diff fd on fd.folder_id = f.id left join folder_diff_server fds on fd.id = fds.folder_diff_id and fds.server_id=s.id +left join server_capability_declaration cap_hasall on cap_hasall.server_id = s.id and cap_hasall.capability = 'hasall' and cap_hasall.enabled where (fds.folder_diff_id IS NOT DISTINCT FROM fd.id OR fds.server_id is null) AND (cap_fhttp.server_id IS NULL or cap_fhttps.server_id IS NULL) END_SQL - $sql = $sql . $country_condition . ' group by s.id, s.hostname, s.urldir, f.path, cap_http.server_id, cap_fhttp.server_id order by s.id'; + $sql = $sql . $country_condition . ' group by s.id, s.hostname, s.urldir, f.path, cap_http.server_id, cap_fhttp.server_id, cap_hasall.capability order by s.id'; my $prep = $dbh->prepare($sql); if ($country) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/lib/MirrorCache/Schema/ResultSet/Stat.pm new/MirrorCache-1.011/lib/MirrorCache/Schema/ResultSet/Stat.pm --- old/MirrorCache-1.010/lib/MirrorCache/Schema/ResultSet/Stat.pm 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/lib/MirrorCache/Schema/ResultSet/Stat.pm 2021-10-07 08:44:23.000000000 +0200 @@ -137,9 +137,8 @@ my $dbh = $schema->storage->dbh; my $extra_condition = $mode eq 'path'? ' and file_id is null' : ' and file_id is not null '; - my $country_condition = $ENV{MIRRORCACHE_CITY_MMDB} ? "and country <> ''" : ''; - my $sql = "select id, country, path, case when mirrorlist then 1 else 0 end as mirrorlist from stat where mirror_id in (-1, 0) $extra_condition $country_condition"; + my $sql = "select id, country, path, case when mirrorlist then 1 else 0 end as mirrorlist from stat where mirror_id in (-1, 0) $extra_condition"; $sql = "$sql and id > $prev_stat_id" if $prev_stat_id; $sql = "$sql union all select max(id), '', '-max_id', null from stat"; # this is just to get max(id) in the same query $sql = "$sql order by id desc"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/lib/MirrorCache/Task/MirrorScan.pm new/MirrorCache-1.011/lib/MirrorCache/Task/MirrorScan.pm --- old/MirrorCache-1.010/lib/MirrorCache/Task/MirrorScan.pm 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/lib/MirrorCache/Task/MirrorScan.pm 2021-10-07 08:44:23.000000000 +0200 @@ -88,9 +88,13 @@ my $url = $folder_on_mirror->{url} . '/'; # it looks that defining $ua outside the loop greatly increases overal memory usage footprint for the task my $ua = Mojo::UserAgent->new->max_redirects(10); - $job->note("hash$server_id" => undef); - my $promise = $ua->get_p($url)->then(sub { + my $hasall = $folder_on_mirror->{hasall}; + $job->note("hash$server_id" => $hasall); + + my $then = sub { $count++; + my %mirrorfiles = (); +unless ($hasall) { my $tx = shift; my $sid = $folder_on_mirror->{server_id}; if ($tx->result->code == 404) { @@ -103,7 +107,6 @@ return $app->emit_event('mc_mirror_probe_error', {mirror => $sid, url => "u$url", err => $tx->result->code}, $folder_on_mirror->{server_id}) if $tx->result->code > 299; # we cannot mojo dom here because it takes too much RAM for huge html page # my $dom = $tx->result->dom; - my %mirrorfiles = (); my $href = ''; my $href1 = ''; my $start = sub { @@ -164,11 +167,11 @@ $p->parse($chunk); } $p->eof; - +} my $ctx = Digest::MD5->new; my @missing_files = (); foreach my $file (@dbfiles) { - next if $mirrorfiles{$file} || substr($file,length($file)-1) eq '/'; + next if $mirrorfiles{$file} || substr($file,length($file)-1) eq '/' || $hasall; $ctx->add($file); push @missing_files, $dbfileids{$file}; } @@ -196,12 +199,19 @@ if ($old_diff_id) { # we need update existing entry - $schema->resultset('FolderDiffServer')->update_diff_id($folder_diff->id, $max_dt, $old_diff_id, $folder_on_mirror->{server_id}); + $schema->resultset('FolderDiffServer')->update_diff_id($folder_diff->id, $max_dt? $max_dt : undef, $old_diff_id, $folder_on_mirror->{server_id}); } else { # need new entry - $schema->resultset('FolderDiffServer')->create( {server_id => $folder_on_mirror->{server_id}, folder_diff_id => $folder_diff->id, dt => $max_dt } ); + $schema->resultset('FolderDiffServer')->create( {server_id => $folder_on_mirror->{server_id}, folder_diff_id => $folder_diff->id, dt => ($max_dt ? $max_dt : undef) } ); } - })->catch(sub { + }; + + if ($hasall) { + $then->(); + next; + } + + my $promise = $ua->get_p($url)->then($then)->catch(sub { my $err = shift; return $app->emit_event('mc_mirror_probe_error', {mirror => $folder_on_mirror->{server_id}, url => "u$url", err => $err}, $folder_on_mirror->{server_id}); })->timeout(180)->wait; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/lib/MirrorCache/WebAPI/Plugin/Geolocation.pm new/MirrorCache-1.011/lib/MirrorCache/WebAPI/Plugin/Geolocation.pm --- old/MirrorCache-1.010/lib/MirrorCache/WebAPI/Plugin/Geolocation.pm 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/lib/MirrorCache/WebAPI/Plugin/Geolocation.pm 2021-10-07 08:44:23.000000000 +0200 @@ -30,6 +30,7 @@ $ip = shift->client_ip unless $ip; return ('us','na') if $ip eq '::1' || $ip eq '::ffff:127.0.0.1'; # for testing only + $ip =~ s/^::ffff://; my $country = _get_country($geodb, $ip) // ''; my $region = region_for_country($country) // ''; @@ -42,6 +43,7 @@ $ip = shift->client_ip unless $ip; return (0,0,'us','na') if $ip eq '::1' || $ip eq '::ffff:127.0.0.1'; # for testing only + $ip =~ s/^::ffff://; my $country = _get_country($geodb, $ip) // ''; my $region = region_for_country($country) // ''; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/lib/MirrorCache/WebAPI/Plugin/Mmdb.pm new/MirrorCache-1.011/lib/MirrorCache/WebAPI/Plugin/Mmdb.pm --- old/MirrorCache-1.010/lib/MirrorCache/WebAPI/Plugin/Mmdb.pm 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/lib/MirrorCache/WebAPI/Plugin/Mmdb.pm 2021-10-07 08:44:23.000000000 +0200 @@ -29,6 +29,7 @@ return ("", "") unless $reader; $ip = shift->client_ip unless $ip; return ('us','na') if $ip eq '::1' || $ip eq '::ffff:127.0.0.1'; # for testing only + $ip =~ s/^::ffff://; my $record = $reader->record_for_address($ip); my ($region, $country) = ("",""); eval { @@ -42,6 +43,7 @@ my ($c, $ip) = @_; return "" unless $reader; $ip = shift->client_ip unless $ip; + $ip =~ s/^::ffff://; return (0,0,'us','na') if $ip eq '::1' || $ip eq '::ffff:127.0.0.1'; # for testing only my $record = $reader->record_for_address($ip); return ($record->{location}->{latitude},$record->{location}->{longitude},lc($record->{country}->{iso_code}),lc($record->{continent}->{code})) if $record; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/lib/MirrorCache/WebAPI/Plugin/RenderFileFromMirror.pm new/MirrorCache-1.011/lib/MirrorCache/WebAPI/Plugin/RenderFileFromMirror.pm --- old/MirrorCache-1.010/lib/MirrorCache/WebAPI/Plugin/RenderFileFromMirror.pm 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/lib/MirrorCache/WebAPI/Plugin/RenderFileFromMirror.pm 2021-10-07 08:44:23.000000000 +0200 @@ -67,7 +67,7 @@ return $c->render(status => 404, text => "File not found"); } - my (@mirrors_country, @mirrors_region, @mirrors_rest, @avoid_countries); + my (@mirrors_country, @mirrors_region, @mirrors_rest); _collect_mirrors($dm, \@mirrors_country, \@mirrors_region, \@mirrors_rest, $file->{id}, $folder_id); @@ -421,6 +421,7 @@ my ($lat, $lng) = $dm->coord; my $avoid_countries = $dm->avoid_countries; my $mirrorlist = $dm->mirrorlist; + my $ipvstrict = $dm->ipvstrict; my $metalink = $dm->metalink; my $limit = $mirrorlist ? 100 : (( $metalink || $dm->pedantic )? 10 : 1); my $rs = $dm->c->schema->resultset('Server'); @@ -428,19 +429,20 @@ my $m = $rs->mirrors_query( $country, $region, $folder_id, $file_id, $scheme, $ipv, $lat, $lng, $avoid_countries, $limit, 0, - $mirrorlist, $vpn + !$mirrorlist, $ipvstrict, $vpn ) if $country; push @$mirrors_country, @$m if $m && scalar(@$m); my $found_count = scalar(@$mirrors_country) + scalar(@$mirrors_region) + scalar(@$mirrors_rest); if ($region && (($found_count < $limit))) { - my @avoid_countries = @{$avoid_countries} if $avoid_countries; + my @avoid_countries; + push @avoid_countries, @$avoid_countries if $avoid_countries && scalar(@$avoid_countries); push @avoid_countries, $country if ($country and !(grep { $country eq $_ } @avoid_countries)); $m = $rs->mirrors_query( $country, $region, $folder_id, $file_id, $scheme, $ipv, $lat, $lng, \@avoid_countries, $limit, 0, - $mirrorlist, $vpn + !$mirrorlist, $ipvstrict, $vpn ); my $found_more = scalar(@$m) if $m; if ($found_more) { @@ -449,11 +451,11 @@ } } - if (($metalink && $found_count < $limit) || $dm->mirrorlist || !$dm->country) { + if (($metalink && $found_count < $limit) || $mirrorlist || !$country) { $m = $rs->mirrors_query( $country, $region, $folder_id, $file_id, $scheme, $ipv, $lat, $lng, $avoid_countries, $limit, 1, - $mirrorlist, $vpn + !$mirrorlist, $ipvstrict, $vpn ); my $found_more = scalar(@$m) if $m; if ($found_more) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/lib/MirrorCache/WebAPI/Plugin/RootLocal.pm new/MirrorCache-1.011/lib/MirrorCache/WebAPI/Plugin/RootLocal.pm --- old/MirrorCache-1.010/lib/MirrorCache/WebAPI/Plugin/RootLocal.pm 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/lib/MirrorCache/WebAPI/Plugin/RootLocal.pm 2021-10-07 08:44:23.000000000 +0200 @@ -88,7 +88,7 @@ my ($self, $dm, $filepath) = @_; $filepath = "" unless $filepath; for my $root (@roots) { - next unless -e $root->[dir] . $root_subtree . $filepath; + next unless ( -e $root->[dir] . $root_subtree . $filepath || ( $root_subtree && ( -e $root->[dir] . $filepath ) ) ); return $dm->scheme . "://" . $root->[host_vpn] if ($dm->vpn && $root->[host_vpn]); return $dm->scheme . "://" . $root->[host] if ($root->[host]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/lib/MirrorCache/resources/migrations/pg.sql new/MirrorCache-1.011/lib/MirrorCache/resources/migrations/pg.sql --- old/MirrorCache-1.010/lib/MirrorCache/resources/migrations/pg.sql 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/lib/MirrorCache/resources/migrations/pg.sql 2021-10-07 08:44:23.000000000 +0200 @@ -221,3 +221,5 @@ create index if not exists file_folder_id_idx on file(folder_id); create index if not exists folder_diff_folder_id_idx on folder_diff(folder_id); create index if not exists folder_diff_server_folder_diff_id_idx on folder_diff_server(folder_diff_id); +-- 12 up +alter type server_capability_t add value 'hasall'; -- mirror always has all files - no scan is performed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/t/environ/01-smoke-mirror-hasall.sh new/MirrorCache-1.011/t/environ/01-smoke-mirror-hasall.sh --- old/MirrorCache-1.010/t/environ/01-smoke-mirror-hasall.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/MirrorCache-1.011/t/environ/01-smoke-mirror-hasall.sh 2021-10-07 08:44:23.000000000 +0200 @@ -0,0 +1,42 @@ +#!lib/test-in-container-environ.sh +set -ex + +mc=$(environ mc $(pwd)) + +$mc/start +$mc/status + +ap8=$(environ ap8) +ap7=$(environ ap7) + +for x in $mc $ap7 $ap8; do + mkdir -p $x/dt/{folder1,folder2,folder3} + echo $x/dt/{folder1,folder2,folder3}/{file1.1,file2.1}.dat | xargs -n 1 touch +done + +$ap7/start +$ap7/curl /folder1/ | grep file1.1.dat + +$ap8/start +$ap8/curl /folder1/ | grep file1.1.dat + + +$mc/db/sql "insert into server(hostname,urldir,enabled,country,region) select '$($ap7/print_address)','','t','us','na'" +$mc/db/sql "insert into server(hostname,urldir,enabled,country,region) select '$($ap8/print_address)','','t','de','eu'" +$mc/db/sql "insert into server(hostname,urldir,enabled,country,region) select 'notexists.com','','t','it','eu'" + + +$mc/db/sql "insert into server_capability_declaration(server_id, capability, enabled) select id, 'hasall', 't' from server where hostname = 'notexists.com'"; + +$mc/curl -Is /download/folder1/file1.1.dat.mirrorlist + +$mc/backstage/job folder_sync_schedule_from_misses +$mc/backstage/job folder_sync_schedule +$mc/backstage/shoot + +$mc/curl -I /download/folder1/file1.1.dat?COUNTRY=it | grep -C10 302 | grep "notexists.com" +$mc/curl /download/folder1/file1.1.dat.mirrorlist | grep "notexists.com" +# with pedantic we ignore it though +rc=0 +$mc/curl -I /download/folder1/file1.1.dat?"COUNTRY=it&PEDANTIC=1" | grep "notexists.com" || rc=$? +test $rc -gt 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/t/environ/03-geo-locations.sh new/MirrorCache-1.011/t/environ/03-geo-locations.sh --- old/MirrorCache-1.010/t/environ/03-geo-locations.sh 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/t/environ/03-geo-locations.sh 2021-10-07 08:44:23.000000000 +0200 @@ -2,7 +2,10 @@ set -ex mc=$(environ mc $(pwd)) -$mc/gen_env MIRRORCACHE_PEDANTIC=1 +MIRRORCACHE_SCHEDULE_RETRY_INTERVAL=2 + +$mc/gen_env MIRRORCACHE_PEDANTIC=1 \ + MIRRORCACHE_SCHEDULE_RETRY_INTERVAL=$MIRRORCACHE_SCHEDULE_RETRY_INTERVAL ap9=$(environ ap9) ap8=$(environ ap8) @@ -49,3 +52,12 @@ $ap8/start $mc/curl --interface 127.0.0.3 -I /download/folder1/file1.1.dat $mc/curl --interface 127.0.0.3 -I /download/folder1/file1.1.dat | grep -C 10 302 | grep $munich_host + + +$mc/curl --interface 127.0.0.15 /rest/myip +$mc/curl --interface 127.0.0.15 /download/folder2/file1.1.dat.mirrorlist + +$mc/sql 'select * from stat order by id desc limit 1' +sleep $MIRRORCACHE_SCHEDULE_RETRY_INTERVAL +$mc/backstage/shoot +$mc/curl --interface 127.0.0.15 /download/folder2/file1.1.dat.mirrorlist | grep -C10 $munich_host | grep -C10 $berlin_host | grep -C10 $altona_host | grep http diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/t/environ/03-geo-mirrorlist.sh new/MirrorCache-1.011/t/environ/03-geo-mirrorlist.sh --- old/MirrorCache-1.010/t/environ/03-geo-mirrorlist.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/MirrorCache-1.011/t/environ/03-geo-mirrorlist.sh 2021-10-07 08:44:23.000000000 +0200 @@ -0,0 +1,29 @@ +#!lib/test-in-container-environ.sh +set -ex + +mc=$(environ mc $(pwd)) + +ap9=$(environ ap9) +ap8=$(environ ap8) +ap7=$(environ ap7) +ap6=$(environ ap6) + +for x in $mc $ap6 $ap7 $ap8 $ap9; do + mkdir -p $x/dt/{folder1,folder2,folder3} + echo $x/dt/{folder1,folder2,folder3}/{file1.1,file2.1}.dat | xargs -n 1 touch + $x/start +done + +$mc/db/sql "insert into server(hostname,urldir,enabled,country,region) select '$($ap6/print_address)','','t','cu','na'" +$mc/db/sql "insert into server(hostname,urldir,enabled,country,region) select '$($ap7/print_address)','','t','us','na'" +$mc/db/sql "insert into server(hostname,urldir,enabled,country,region) select '$($ap8/print_address)','','t','mx','na'" +$mc/db/sql "insert into server(hostname,urldir,enabled,country,region) select '$($ap9/print_address)','','t','ca','na'" + +$mc/curl /download/folder1/file1.1.dat.mirrorlist + +$mc/backstage/job folder_sync_schedule_from_misses +$mc/backstage/job folder_sync_schedule +$mc/backstage/shoot + +$mc/curl /download/folder1/file1.1.dat.mirrorlist?COUNTRY=mx | grep http +$mc/curl /download/folder1/file1.1.dat.mirrorlist?COUNTRY=ca | grep http | grep '(MX)' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/t/environ/04-remote-nginx.sh new/MirrorCache-1.011/t/environ/04-remote-nginx.sh --- old/MirrorCache-1.010/t/environ/04-remote-nginx.sh 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/t/environ/04-remote-nginx.sh 2021-10-07 08:44:23.000000000 +0200 @@ -172,4 +172,4 @@ $mc/backstage/job -e folder_sync -a '["/folder1"]' $mc/backstage/shoot -$mc/curl /download/folder1/ | grep -A1 $f | grep '10 Byte' +$mc/curl /download/folder1/ | grep -B1 $f | grep '10 Byte' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/t/environ/10-ipv-probe.sh new/MirrorCache-1.011/t/environ/10-ipv-probe.sh --- old/MirrorCache-1.010/t/environ/10-ipv-probe.sh 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/t/environ/10-ipv-probe.sh 2021-10-07 08:44:23.000000000 +0200 @@ -51,5 +51,39 @@ $mc/backstage/shoot # make sure it redirects to ipv4 and ipv6 as requested -curl -I -s $ipv4/download/folder1/file1.1.dat | grep $($ap7/print_address) -curl -I -s $ipv6/download/folder1/file1.1.dat | grep Location | grep ::1 +curl -Is $ipv4/download/folder1/file1.1.dat | grep $($ap7/print_address) +curl -Is $ipv6/download/folder1/file1.1.dat | grep Location | grep ::1 + + +# make sure order in metalink honorc ipv +curl -s $ipv4/download/folder1/file1.1.dat.metalink | grep -A1 $($ap7/print_address) | grep ::1 +curl -s $ipv6/download/folder1/file1.1.dat.metalink | grep -A1 ::1 | grep $($ap7/print_address) + +# make sure ipv is strict with IPV parameter +curl -s $ipv4/download/folder1/file1.1.dat.metalink?IPV | grep $($ap7/print_address) +curl -s $ipv4/download/folder1/file1.1.dat.metalink?IPV4 | grep $($ap7/print_address) +curl -s $ipv4/download/folder1/file1.1.dat.metalink?IPV6 | grep ::1 + +curl -s $ipv6/download/folder1/file1.1.dat.metalink?IPV | grep ::1 +curl -s $ipv6/download/folder1/file1.1.dat.metalink?IPV6 | grep ::1 +curl -s $ipv6/download/folder1/file1.1.dat.metalink?IPV4 | grep $($ap7/print_address) + +rc=0 +curl -s $ipv4/download/folder1/file1.1.dat.metalink?IPV | grep ::1 || rc=$? +test $rc -gt 0 +rc=0 +curl -s $ipv4/download/folder1/file1.1.dat.metalink?IPV4 | grep ::1 || rc=$? +test $rc -gt 0 +rc=0 +curl -s $ipv4/download/folder1/file1.1.dat.metalink?IPV6 | grep $($ap7/print_address) || rc=$? +test $rc -gt 0 + +rc=0 +curl -s $ipv6/download/folder1/file1.1.dat.metalink?IPV | grep $($ap7/print_address) || rc=$? +test $rc -gt 0 +rc=0 +curl -s $ipv6/download/folder1/file1.1.dat.metalink?IPV6 | grep $($ap7/print_address) || rc=$? +test $rc -gt 0 +rc=0 +curl -s $ipv6/download/folder1/file1.1.dat.metalink?IPV4 | grep file1.dat | grep ::1 || rc=$? +test $rc -gt 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/t/environ/15-local-symlink-subtree-rootredirect.sh new/MirrorCache-1.011/t/environ/15-local-symlink-subtree-rootredirect.sh --- old/MirrorCache-1.010/t/environ/15-local-symlink-subtree-rootredirect.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/MirrorCache-1.011/t/environ/15-local-symlink-subtree-rootredirect.sh 2021-10-07 08:44:23.000000000 +0200 @@ -0,0 +1,58 @@ +#!lib/test-in-container-environ.sh +set -ex + +mc=$(environ mc $(pwd)) + +$mc/start +$mc/status + +ap8=$(environ ap8) +ap7=$(environ ap7) + +mkdir -p $mc/dt/{folder1,folder2,folder3} +echo $mc/dt/{folder1,folder2,folder3}/{file1.1,file2.1}.dat | xargs -n 1 touch + +mkdir -p $mc/dt/updates/tool +( +cd $mc/dt/updates/tool/ +ln -s ../../folder1 v1 +ln -s ../../folder2 v2 +) + +ls -la $mc/dt/updates/tool/ + +cp -r $mc/dt/folder1/ $ap7/dt/ +cp -r $mc/dt/folder2/ $ap7/dt/ +mkdir -p $ap8/dt/updates/tool/v1 +mkdir -p $ap8/dt/updates/tool/v2 +cp $mc/dt/folder1/* $ap8/dt/updates/tool/v1/ +cp $mc/dt/folder2/* $ap8/dt/updates/tool/v2/ + + +$ap7/start +$ap7/curl /folder1/ | grep file1.1.dat + +$ap8/start +$ap8/curl /updates/tool/v1/ | grep file1.1.dat + + +$mc/db/sql "insert into server(hostname,urldir,enabled,country,region) select '$($ap7/print_address)','','t','us','na'" +$mc/db/sql "insert into server(hostname,urldir,enabled,country,region) select '$($ap8/print_address)','','t','de','eu'" + +mcsub=$mc/sub + +$mcsub/gen_env MIRRORCACHE_ROOT="'$mc/dt:testhost.com:testhost.vpn'" \ + MIRRORCACHE_SUBTREE=/updates \ + MIRRORCACHE_TOP_FOLDERS=tool \ + MIRRORCACHE_ROOT_COUNTRY=us +$mcsub/start + +$mc/curl -Is /download/updates/tool/v1/file1.1.dat.mirrorlist +$mc/curl -Is --interface 127.0.0.15 /download/updates/tool/v2/file1.1.dat.mirrorlist + +$mc/backstage/job folder_sync_schedule_from_misses +$mc/backstage/job folder_sync_schedule +$mc/backstage/shoot + +$mcsub/curl /tool/v1/file1.1.dat.metalink | grep -C10 $($ap7/print_address)/folder1/file1.1.dat | grep -C10 $($ap8/print_address)/updates/tool/v1/file1.1.dat | grep testhost.com +$mcsub/curl /tool/v2/file1.1.dat.metalink | grep -C10 $($ap8/print_address)/updates/tool/v2/file1.1.dat | grep testhost.com diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/templates/branding/openSUSE/header.html.ep new/MirrorCache-1.011/templates/branding/openSUSE/header.html.ep --- old/MirrorCache-1.010/templates/branding/openSUSE/header.html.ep 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/templates/branding/openSUSE/header.html.ep 2021-10-07 08:44:23.000000000 +0200 @@ -1,7 +1,7 @@ <nav class="navbar noprint navbar-expand-md sticky-top"> - <a class="navbar-brand" href="/"><img src="https://static.opensuse.org/favicon.svg" class="d-inline-block align-top" alt="openSUSE" title="openSUSE" width="30" height="30"> <span class="navbar-title">Download</span></a> - <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapse"><svg width="1em" height="1em" viewbox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M2.5 11.5A.5.5 0 0 1 3 11h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 3h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"></path></svg></button> + <a class="navbar-brand" href="/"><img src="https://static.opensuse.org/favicon.svg" class="d-inline-block align-top" width="30" height="30"> <span class="navbar-title">Download</span></a> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapse"><svg width="20" height="20" viewbox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M2.5 11.5A.5.5 0 0 1 3 11h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 3h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"></path></svg></button> <div class="collapse navbar-collapse" id="navbar-collapse"> @@ -23,7 +23,7 @@ <ul id="user-menu" class="navbar-nav"> <li class="nav-item dropdown"> <a class="nav-link" href="#" id="user-dropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> - <img src="<%= icon_url 'logo.svg'%>" alt="MirrorCache"> + <img src="<%= icon_url 'logo.svg'%>"> <span class="d-md-none">MirrorCache</span> </a> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="user-dropdown"> @@ -62,7 +62,7 @@ </div> <button class="navbar-toggler megamenu-toggler" type="button" data-toggle="collapse" - data-target="#megamenu" aria-expanded="true"><svg class="bi bi-grid" width="1em" height="1em" + data-target="#megamenu" aria-expanded="true"><svg class="bi bi-grid" width="20" height="20" viewbox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zM2.5 2a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zM1 10.5A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z"></path></svg> </button> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/templates/dir.html.ep new/MirrorCache-1.011/templates/dir.html.ep --- old/MirrorCache-1.010/templates/dir.html.ep 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/templates/dir.html.ep 2021-10-07 08:44:23.000000000 +0200 @@ -1,5 +1,5 @@ % layout 'bootstrap'; -% title 'Index of ' . $cur_path; +% title $cur_path; % my @breadcrumbs = split '/', 'download' . $cur_path; % my $bc_last = pop @breadcrumbs; % my $bc_url = '/'; @@ -37,25 +37,23 @@ <thead> <tr> % if ($files && @$files && $files->[-1]->{mtime}) { - <th>Name</th><th>Size</th><th>Last Modified</th><th>Metadata</th> + <th>Name</th><th>Last Modified</th><th>Size</th><th>Metadata</th> % } else { <th colspan="3">Name</th><th>Metadata</th> % } </tr> - <thead> + </thead> <tbody> - <tr> % if ($cur_path ne '/') { - <td colspan="4" class="breadcrumb-item"><a href="../">Parent Directory</a></td> + <tr><td colspan="4"><a href="../">Parent Directory</a></td></tr> % } - </tr> % for my $file (@$files) { <tr> % if ($file->{mtime}) { % my $colspan = $file->{dir} ? 'colspan=2 ' : ''; <td class="name"><a href="<%= $file->{url} %>"><%== $file->{name} %></a></td> - <td class="size"><%= $file->{dir} ? '' : $file->{size} %></td> <td <%= $colspan %>class="mtime"><%= $file->{mtime} %></td> + <td class="size"><%= $file->{dir} ? '' : $file->{size} %></td> % } else { % my $colspan = $file->{dir} ? 4 : 3; <td colspan="<%= $colspan %>" class="name"><a href="<%= $file->{url} %>"><%== $file->{name} %></a></td> @@ -68,7 +66,7 @@ % if (!$files || @$files == 0) { <tr><td colspan="4">Directory is empty</td></tr> % } - <tbody> + </tbody> </table> </div> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/templates/layouts/bootstrap.html.ep new/MirrorCache-1.011/templates/layouts/bootstrap.html.ep --- old/MirrorCache-1.010/templates/layouts/bootstrap.html.ep 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/templates/layouts/bootstrap.html.ep 2021-10-07 08:44:23.000000000 +0200 @@ -10,21 +10,22 @@ <meta name="csrf-token" content="<%= csrf_token %>" /> <meta name="csrf-param" content="csrf_token" /> + % my $mc_branding = eval '$branding' // 'MirrorCache'; % my $title_safe = stash('title') // ''; - % if ($title_safe && index($title_safe, 'Index of') != -1) { - <title><%= $title_safe %></title> - % } elsif ($title_safe) { - <title><%= "MirrorCache" . ": " . $title_safe %></title> + % my $is_opensuse = $mc_branding eq 'openSUSE'; + + % $mc_branding .= (!rindex($title_safe, '/', 0) || $is_opensuse) && index(lc($mc_branding), 'download') == -1 ? ' Download' : ''; + % if ($title_safe && $title_safe ne '/') { + <title><%= "$title_safe - $mc_branding" %></title> % } else { - <title>MirrorCache</title> + <title><%= $mc_branding %></title> % } <!-- Bootstrap core CSS --> %= asset 'bootstrap.css' %= asset 'bootstrap.js' - % my $mc_branding = eval '$branding' // ''; - % if ($mc_branding eq 'openSUSE') { + % if ($is_opensuse) { <!-- Chameleon Style --> <!-- <link rel="stylesheet" href="https://static.opensuse.org/chameleon-3.0/dist/css/chameleon.css" /> --> %= asset 'chameleon.css' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.010/templates/mirrorlist.html.ep new/MirrorCache-1.011/templates/mirrorlist.html.ep --- old/MirrorCache-1.010/templates/mirrorlist.html.ep 2021-09-30 09:27:01.000000000 +0200 +++ new/MirrorCache-1.011/templates/mirrorlist.html.ep 2021-10-07 08:44:23.000000000 +0200 @@ -31,26 +31,28 @@ </ol> </div> - <h4>File information</h4> - <ul> - <li>Filename: <%= $file->{name} %></li> - <li>Path: <%= $cur_path %></li> - <li>Size: <%= $file->{hsize} %> (<%= $file->{size} %> bytes)</li> - <li>Last modified: <%= $file->{hmtime} %> (Unix timestamp: <%= $file->{mtime} %>)</li> - % if ($file->{sha256}) { - <li>SHA-256 Hash: <%= $file->{sha256} %></li> - % } - % if ($file->{sha1}) { - <li>SHA-1 Hash: <%= $file->{sha1} %></li> - % } - % if ($file->{md5}) { - <li>MD5 Hash: <%= $file->{md5} %></li> - % } - <li><a href="<%= $bc_url . $bc_last %>.metalink">Metalink (v3.0)</a></li> - % if ($file->{url}) { - <li>Origin: <a href="<%= $file->{url} %>"><%= $file->{url} %></a></li> - % } - </ul> + <div id="fileinfo"> + <h4>File information</h4> + <ul> + <li>Filename: <%= $file->{name} %></li> + <li>Path: <%= $cur_path %></li> + <li>Size: <%= $file->{hsize} %> (<%= $file->{size} %> bytes)</li> + <li>Last modified: <%= $file->{hmtime} %> (Unix timestamp: <%= $file->{mtime} %>)</li> + % if ($file->{sha256}) { + <li>SHA-256 Hash: <%= $file->{sha256} %></li> + % } + % if ($file->{sha1}) { + <li>SHA-1 Hash: <%= $file->{sha1} %></li> + % } + % if ($file->{md5}) { + <li>MD5 Hash: <%= $file->{md5} %></li> + % } + <li><a href="<%= $bc_url . $bc_last %>.metalink">Metalink (v3.0)</a></li> + % if ($file->{url}) { + <li>Origin: <a href="<%= $file->{url} %>"><%= $file->{url} %></a></li> + % } + </ul> + </div> <h4>Mirrors</h4> % if ($ip && $lat && $lng) { ++++++ MirrorCache.obsinfo ++++++ --- /var/tmp/diff_new_pack.N1EyUB/_old 2021-10-15 23:04:01.002099735 +0200 +++ /var/tmp/diff_new_pack.N1EyUB/_new 2021-10-15 23:04:01.002099735 +0200 @@ -1,5 +1,5 @@ name: MirrorCache -version: 1.010 -mtime: 1632986821 -commit: a7c411af315b687691212977613b148628d36af5 +version: 1.011 +mtime: 1633589063 +commit: 881058e905ffc0c99069d5ebf801a5f651be14a1
