Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package MirrorCache for openSUSE:Factory checked in at 2023-09-21 22:22:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/MirrorCache (Old) and /work/SRC/openSUSE:Factory/.MirrorCache.new.1770 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "MirrorCache" Thu Sep 21 22:22:49 2023 rev:32 rq:1112699 version:1.064 Changes: -------- --- /work/SRC/openSUSE:Factory/MirrorCache/MirrorCache.changes 2023-09-07 21:15:14.382664677 +0200 +++ /work/SRC/openSUSE:Factory/.MirrorCache.new.1770/MirrorCache.changes 2023-09-21 22:22:55.556598846 +0200 @@ -1,0 +2,9 @@ +Thu Sep 14 06:49:28 UTC 2023 - Andrii Nikitin <andrii.niki...@suse.com> + +- Update to version 1.064: + * Remove must-revalidate from cache-control (#407) + * Add handling x-metalink-limit request header (#407) + * Add handling x-country-code request header (#407) + * Fix escaping in regexps (#406) + +------------------------------------------------------------------- Old: ---- MirrorCache-1.063.obscpio New: ---- MirrorCache-1.064.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ MirrorCache.spec ++++++ --- /var/tmp/diff_new_pack.Jwtmkh/_old 2023-09-21 22:22:57.220659229 +0200 +++ /var/tmp/diff_new_pack.Jwtmkh/_new 2023-09-21 22:22:57.220659229 +0200 @@ -22,7 +22,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) perl(Config::IniFiles) %define build_requires %{assetpack_requires} rubygem(sass) tidy sysuser-shadow sysuser-tools Name: MirrorCache -Version: 1.063 +Version: 1.064 Release: 0 Summary: WebApp to redirect and manage mirrors License: GPL-2.0-or-later ++++++ MirrorCache-1.063.obscpio -> MirrorCache-1.064.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.063/lib/MirrorCache/Datamodule.pm new/MirrorCache-1.064/lib/MirrorCache/Datamodule.pm --- old/MirrorCache-1.063/lib/MirrorCache/Datamodule.pm 2023-08-31 08:51:18.000000000 +0200 +++ new/MirrorCache-1.064/lib/MirrorCache/Datamodule.pm 2023-09-14 08:46:25.000000000 +0200 @@ -127,21 +127,21 @@ } sub region($self) { - unless (defined $self->_region) { + unless (defined $self->_lat) { $self->_init_location; } return $self->_region; } sub country($self) { - unless (defined $self->_country) { + unless (defined $self->_lat) { $self->_init_location; } return $self->_country; } sub avoid_countries($self) { - unless (defined $self->_country) { + unless (defined $self->_lat) { $self->_init_location; } return $self->_avoid_countries; @@ -355,6 +355,29 @@ } } } + my ($region, $country, $metalink_limit); + for my $name (@{$headers->names}) { + next unless $name; + $name = lc($name); + if ($name eq 'region-code' || $name eq 'x-region-code' || $name eq 'x-geo-region-code') { + $region = $headers->header($name); + $region = lc(substr $region, 0, 2) if $region; + } + if ($name eq 'country-code' || $name eq 'x-country-code' || $name eq 'x-geo-country-code') { + $country = $headers->header($name); + if ($country) { + $country = lc(substr $country, 0, 2); + $region = region_for_country($country) unless $region; + } + } + if ($name eq 'x-metalink-limit') { + $metalink_limit = $headers->header($name); + $self->metalink_limit($metalink_limit) if int($metalink_limit) > 0; + } + } + $self->_country($country) if $country; + $self->_region($region) if $region; + return unless $headers->accept; $self->metalink(1) if $headers->accept =~ m/\bapplication\/metalink/; @@ -435,8 +458,8 @@ } $self->_avoid_countries(\@avoid_countries); - $self->_country($country); - $self->_region($region // ''); + $self->_country($country) unless $self->_country; + $self->_region($region // '') unless $self->_region; if (my $p = $query->param('LIMIT')) { # check numeric value if (int($p) > 0) { @@ -580,12 +603,12 @@ $self->agent; # parse headers if ( ( $self->accept_all || !$self->extra ) - && $path =~ m/.*\/(repodata\/repomd.xml[^\/]*|media\.1\/(media|products)|content|.*\.sha256(\.asc)|Release(.key|.gpg)?|InRelease|Packages(.gz)?|Sources(.gz)?|.*_Arch\.(files|db|key)(\.(sig|tar\.gz(\.sig)?))?|(files|primary|other).xml.gz|[Pp]ackages(\.[A-Z][A-Z])?\.(xz|gz)|gpg-pubkey.*\.asc|CHECKSUMS(.asc)?)$/ + && $path =~ m/\/(repodata\/repomd\.xml[^\/]*|media\.1\/(media|products)|content|.*\.sha256(\.asc)|Release(\.key|\.gpg)?|InRelease|Packages(\.gz)?|Sources(\.gz)?|.*_Arch\.(files|db|key)(\.(sig|tar\.gz(\.sig)?))?|(files|primary|other)\.xml\.gz|[Pp]ackages(\.[A-Z][A-Z])?\.(xz|gz)|gpg-pubkey.*\.asc|CHECKSUMS(\.asc)?)$/ ) { $self->must_render_from_root(1); my $time = ~time() & 0xff; - $self->c->res->headers->cache_control("public, max-age=$time, must-revalidate"); + $self->c->res->headers->cache_control("public, max-age=$time"); } my ($ext) = $path =~ /([^.]+)$/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.063/lib/MirrorCache/Schema/ResultSet/Stat.pm new/MirrorCache-1.064/lib/MirrorCache/Schema/ResultSet/Stat.pm --- old/MirrorCache-1.063/lib/MirrorCache/Schema/ResultSet/Stat.pm 2023-08-31 08:51:18.000000000 +0200 +++ new/MirrorCache-1.064/lib/MirrorCache/Schema/ResultSet/Stat.pm 2023-09-14 08:46:25.000000000 +0200 @@ -184,7 +184,7 @@ or ( folder_id is null and mirror_id > -2 ) -- file may be known, but requested folder is unknown - happens when realpath shows to a different folder ) -and stat.path !~ '.*\/(repodata\/repomd.xml[^\/]*|media\.1\/(media|products)|content|.*\.sha256(\.asc)|Release(.key|.gpg)?|InRelease|Packages(.gz)?|Sources(.gz)?|.*_Arch\.(files|db|key)(\.(sig|tar\.gz(\.sig)?))?|(files|primary|other).xml.gz|[Pp]ackages(\.[A-Z][A-Z])?\.(xz|gz)|gpg-pubkey.*\.asc|CHECKSUMS)$' +and stat.path !~ '\/(repodata\/repomd\.xml[^\/]*|media\.1\/(media|products)|content|.*\.sha256(\.asc)|Release(\.key|\.gpg)?|InRelease|Packages(\.gz)?|Sources(\.gz)?|.*_Arch\.(files|db|key)(\.(sig|tar\.gz(\.sig)?))?|(files|primary|other)\.xml\.gz|[Pp]ackages(\.[A-Z][A-Z])?\.(xz|gz)|gpg-pubkey.*\.asc|CHECKSUMS(\.asc)?)$' and lower(stat.agent) NOT LIKE '%bot%' and lower(stat.agent) NOT LIKE '%rclone%' and ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.063/lib/MirrorCache/WebAPI/Plugin/Dir.pm new/MirrorCache-1.064/lib/MirrorCache/WebAPI/Plugin/Dir.pm --- old/MirrorCache-1.063/lib/MirrorCache/WebAPI/Plugin/Dir.pm 2023-08-31 08:51:18.000000000 +0200 +++ new/MirrorCache-1.064/lib/MirrorCache/WebAPI/Plugin/Dir.pm 2023-09-14 08:46:25.000000000 +0200 @@ -673,7 +673,7 @@ # if we don't render file directly - we set max-age to short value, because redirect or metalink may change sub _set_cache_control { - shift->c->res->headers->cache_control('public, max-age=300, must-revalidate'); + shift->c->res->headers->cache_control('public, max-age=300'); return undef; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.063/t/environ/01-smoke-mirror-hasall.sh new/MirrorCache-1.064/t/environ/01-smoke-mirror-hasall.sh --- old/MirrorCache-1.063/t/environ/01-smoke-mirror-hasall.sh 2023-08-31 08:51:18.000000000 +0200 +++ new/MirrorCache-1.064/t/environ/01-smoke-mirror-hasall.sh 2023-09-14 08:46:25.000000000 +0200 @@ -50,10 +50,13 @@ test 2 == $($mc/curl /download/folder1/file1.1.dat.meta4?LIMIT=2 | grep location | wc -l) test 1 == $($mc/curl /download/folder1/file1.1.dat.meta4?LIMIT=1 | grep location | wc -l) - echo test LIMIT with metalink test 3 == $($mc/curl /download/folder1/file1.1.dat.metalink | grep location | wc -l) test 2 == $($mc/curl /download/folder1/file1.1.dat.metalink?LIMIT=2 | grep location | wc -l) test 1 == $($mc/curl /download/folder1/file1.1.dat.metalink?LIMIT=1 | grep location | wc -l) +echo test x-metalink-limit +test 2 == $($mc/curl -H 'x-metalink-limit: 2' /download/folder1/file1.1.dat.meta4 | grep location | wc -l) +test 1 == $($mc/curl -H 'x-metalink-limit: 1' /download/folder1/file1.1.dat.meta4 | grep location | wc -l) + echo success diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.063/t/environ/01-smoke.sh new/MirrorCache-1.064/t/environ/01-smoke.sh --- old/MirrorCache-1.063/t/environ/01-smoke.sh 2023-08-31 08:51:18.000000000 +0200 +++ new/MirrorCache-1.064/t/environ/01-smoke.sh 2023-09-14 08:46:25.000000000 +0200 @@ -134,6 +134,8 @@ $mc/backstage/shoot -q hashes +echo check zsync works +# perl-Inline-C might be missing if it doesnt $mc/curl -H "Accept: */*, application/metalink+xml, application/x-zsync" /download/folder1/file9.1.dat \ | grep -C 20 "URL: http://$($ap7/print_address)/folder1/file9.1.dat" \ | grep -C 20 "URL: http://$($ap8/print_address)/folder1/file9.1.dat" \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MirrorCache-1.063/t/environ/03-geo.sh new/MirrorCache-1.064/t/environ/03-geo.sh --- old/MirrorCache-1.063/t/environ/03-geo.sh 2023-08-31 08:51:18.000000000 +0200 +++ new/MirrorCache-1.064/t/environ/03-geo.sh 2023-09-14 08:46:25.000000000 +0200 @@ -53,6 +53,10 @@ $mc/curl --interface 127.0.0.3 -Is /download/folder1/file1.1.dat?COUNTRY=ca | grep 1304 $mc/curl --interface 127.0.0.2 -Is /download/folder1/file1.1.dat?COUNTRY=ca | grep 1304 +$mc/curl --interface 127.0.0.4 -H 'x-country-code: JP' -Is /download/folder1/file1.1.dat | grep 1324 +$mc/curl --interface 127.0.0.3 -H 'X-Country-Code: JP' -Is /download/folder1/file1.1.dat | grep 1324 +$mc/curl --interface 127.0.0.2 -H 'x-country-code: JP' -Is /download/folder1/file1.1.dat | grep 1324 + echo Further we test that servers are listed only once in metalink output $mc/curl -H "Accept: */*, application/metalink+xml" --interface 127.0.0.2 /download/folder1/file1.1.dat ++++++ MirrorCache.obsinfo ++++++ --- /var/tmp/diff_new_pack.Jwtmkh/_old 2023-09-21 22:22:57.600673018 +0200 +++ /var/tmp/diff_new_pack.Jwtmkh/_new 2023-09-21 22:22:57.600673018 +0200 @@ -1,5 +1,5 @@ name: MirrorCache -version: 1.063 -mtime: 1693464678 -commit: 81990fc9da0374b3be6fba8e816056d88e96bfe2 +version: 1.064 +mtime: 1694673985 +commit: e0be7842c9b0fc3e12af5e6830a0816f54a593f6