- Update to version 1.040:

* Add parameter METALINK_GREEDY (#300)
  * Optimization: assume package managers never want to render dir (#300)
  * Fix mirror picked despite disabled in server_project table (#301)
  * Avoid by and ru mirrors for ua requests (#298)

OBS-URL: https://build.opensuse.org/package/show/openSUSE:infrastructure:MirrorCache/MirrorCache?expand=0&rev=66
This commit is contained in:
Andrii Nikitin 2022-09-22 14:45:32 +00:00 committed by Git OBS Bridge
parent d7730bd67a
commit fb78b5d534
6 changed files with 16 additions and 56 deletions

View File

@ -1,47 +0,0 @@
From 7d9346897af13e5e5ca1752b7a9cfb5718305228 Mon Sep 17 00:00:00 2001
From: Andrii Nikitin <anikitin@suse.de>
Date: Thu, 1 Sep 2022 14:11:40 +0200
Subject: [PATCH] Avoid by and ru mrrors for ua requests
---
lib/MirrorCache/Datamodule.pm | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/lib/MirrorCache/Datamodule.pm b/lib/MirrorCache/Datamodule.pm
index 5e5c2d8..7fb4cfd 100644
--- a/lib/MirrorCache/Datamodule.pm
+++ b/lib/MirrorCache/Datamodule.pm
@@ -322,8 +322,18 @@ sub _init_location($self) {
$region = lc($p);
}
}
- if (my $p = $query->param('AVOID_COUNTRY')) {
+ $country = substr(lc($country), 0, 2) if $country;
+ $country = $country // '';
+ my $p = $query->param('AVOID_COUNTRY');
+ if ($p || $country eq 'ua') {
my @avoid_countries = ();
+ if ($country eq 'ua') {
+ if ($p) {
+ $p = $p . ',by,ru';
+ } else {
+ $p = 'by,ru';
+ }
+ }
for my $c (split ',', $p) {
next unless length($c) == 2;
$c = lc($c);
@@ -331,8 +341,8 @@ sub _init_location($self) {
$country = '' if $c eq lc($country // '');
}
$self->_avoid_countries(\@avoid_countries);
- }
- $country = substr($country, 0, 2) if $country;
+ }
+
$self->_country($country // '');
$self->_region($region // '');
}
--
2.35.3

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e369406301d0dd98e368258ba2f24c664a9137194ecd7e4c70024217fecefd5a
size 976396

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e5e79d1f08a8c8c09ac377d9a6130a6464182e3ee6fdd6baef262969a6827ac6
size 978956

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Sep 22 14:41:52 UTC 2022 - Andrii Nikitin <andrii.nikitin@suse.com>
- Update to version 1.040:
* Add parameter METALINK_GREEDY (#300)
* Optimization: assume package managers never want to render dir (#300)
* Fix mirror picked despite disabled in server_project table (#301)
* Avoid by and ru mirrors for ua requests (#298)
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Sep 1 14:29:10 UTC 2022 - Elisei Roca <eroca@suse.com> Thu Sep 1 14:29:10 UTC 2022 - Elisei Roca <eroca@suse.com>

View File

@ -1,4 +1,4 @@
name: MirrorCache name: MirrorCache
version: 1.039 version: 1.040
mtime: 1661519611 mtime: 1663852168
commit: 056db65ee5963af81f5b04c526dcc3f8df31e682 commit: 0545f63bb7a47082d6847ce218e9827fecd21e95

View File

@ -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) %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 %define build_requires %{assetpack_requires} rubygem(sass) tidy sysuser-shadow sysuser-tools
Name: MirrorCache Name: MirrorCache
Version: 1.039 Version: 1.040
Release: 0 Release: 0
Summary: WebApp to redirect and manage mirrors Summary: WebApp to redirect and manage mirrors
License: GPL-2.0-or-later License: GPL-2.0-or-later
@ -34,7 +34,6 @@ Source2: %{name}-user.conf
Source3: %{name}-tmpfilesd.conf Source3: %{name}-tmpfilesd.conf
# use update-cache (or tools/generate-packed-assets) to generate/update cache.tar.xz # use update-cache (or tools/generate-packed-assets) to generate/update cache.tar.xz
Source101: update-cache.sh Source101: update-cache.sh
Patch0: 0001-Avoid-by-and-ru-mrrors-for-ua-requests.patch
BuildRequires: %{build_requires} BuildRequires: %{build_requires}
Requires: %{main_requires} Requires: %{main_requires}
Requires: perl(Minion) >= 10.0 Requires: perl(Minion) >= 10.0
@ -46,7 +45,6 @@ Mirror redirector web service, which automatically scans the main server and mir
%prep %prep
%setup -q -a1 %setup -q -a1
%patch0 -p1
%build %build
# make {?_smp_mflags} # make {?_smp_mflags}