From 210eb68a41b29915312620f46b0b7e43a84061d2 Mon Sep 17 00:00:00 2001
From: Levente Polyak
Date: Thu, 16 Feb 2017 15:07:16 +0100
Subject: Added arch security tracker to navbar
Signed-off-by: Morten Linderud
Signed-off-by: Angel Velasquez
---
templates/base.html | 1 +
1 file changed, 1 insertion(+)
diff --git a/templates/base.html b/templates/base.html
index fae2037e..02a29a8c 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -23,6 +23,7 @@
Forums
Wiki
Bugs
+ Security
AUR
Download
--
cgit v1.2.2
From 644864de28eb8ccf992f90558a25e865d71f80f4 Mon Sep 17 00:00:00 2001
From: Florian Pritz
Date: Wed, 15 Feb 2017 19:55:53 +0100
Subject: Remove scored based mirrorlist sorting
Users may use the returned mirror list as-is without sorting it
themselves. This may lead to the first mirror in the list being
overloaded. Prevent this by not returning a sorted list.
References: https://lists.archlinux.org/pipermail/arch-dev-public/2017-January/028681.html
Signed-off-by: Florian Pritz
---
mirrors/views/mirrorlist.py | 5 +++--
templates/mirrors/mirrorlist_generate.html | 2 +-
templates/mirrors/mirrorlist_status.txt | 4 ++--
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/mirrors/views/mirrorlist.py b/mirrors/views/mirrorlist.py
index 3c68d036..0c9c0a7b 100644
--- a/mirrors/views/mirrorlist.py
+++ b/mirrors/views/mirrorlist.py
@@ -10,6 +10,7 @@ from django_countries import countries
from ..models import MirrorUrl, MirrorProtocol
from ..utils import get_mirror_statuses
+import random
class MirrorlistForm(forms.Form):
country = forms.MultipleChoiceField(required=False,
@@ -80,8 +81,8 @@ def status_filter(original_urls):
# (as opposed to those that have been set with no score)
if (u.id not in scores) or (u.score and u.score < 100.0):
urls.append(u)
- # if a url doesn't have a score, treat it as the highest possible
- return sorted(urls, key=lambda x: x.score or 100.0)
+ # randomize list to prevent users from overloading the first mirror in the returned list
+ return random.shuffle(urls)
def find_mirrors(request, countries=None, protocols=None, use_status=False,
diff --git a/templates/mirrors/mirrorlist_generate.html b/templates/mirrors/mirrorlist_generate.html
index 59b0d358..dda3b6c4 100644
--- a/templates/mirrors/mirrorlist_generate.html
+++ b/templates/mirrors/mirrorlist_generate.html
@@ -33,7 +33,7 @@
desired protocol(s). Simply replace the contents of
/etc/pacman.d/mirrorlist
with your generated list.
Additionally, the mirror status data can be incorporated into the generated
- mirror list and used to pre-order the mirrors.
+ mirror list and used to only list up to date mirrors.