aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changes26
-rw-r--r--lib/MGA/Mirrors.pm2
-rw-r--r--lib/MGA/Mirrors/Controller/Graph.pm8
-rw-r--r--lib/MGA/Mirrors/DB.pm10
-rw-r--r--mga-mirrors.spec.in31
-rw-r--r--root/html/includes/footer.tt2
-rw-r--r--root/html/includes/header.tt2
-rw-r--r--root/html/includes/host_information.tt2
-rw-r--r--root/html/includes/new/unsupported_protocol.tt2
-rw-r--r--root/html/pages/new/confirm.tt2
-rw-r--r--root/html/pages/report/index.tt21
-rw-r--r--root/mail/host_up_request.tt4
12 files changed, 78 insertions, 34 deletions
diff --git a/Changes b/Changes
index 21e5a82..5ac200b 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,30 @@
This file documents the revision history for Perl extension MGA::Mirrors.
+0.09 2025-11-17
+ - Fix some typos
+ - Make line width on graph proportional to bandwidth
+ - Add more bandwidths to getStrokeWeight()
+ - Use https:// where applicable
+ - Increase timeout when connecting to remote servers
+ - Suppress error messages from rsync
+ - Switch the mirrors graph to SVG
+ - Remove an error on the already-broken Google Maps page
+ - Suppress a maps API error
+
+0.08 2024-01-12
+ - Fix the favicon link (mga#12220)
+ - Sync the spec file template with Mageia's
+ - Use the proper name case in the makefile
+ - Regenerated the scripts with a modern Catalyst
+ - Choose better defaults in the distrib page
+ - Add a link to the status page from the index
+
+0.07 2020-07-05
+ - style a little page/nav layout, add favicon
+ - check mirrors more often
+
+0.06 2011-03-21
+...
+
0.01 2010-09-20 09:23:22
- initial revision, generated by Catalyst
diff --git a/lib/MGA/Mirrors.pm b/lib/MGA/Mirrors.pm
index 6070358..a13649d 100644
--- a/lib/MGA/Mirrors.pm
+++ b/lib/MGA/Mirrors.pm
@@ -23,7 +23,7 @@ use Catalyst qw/
extends 'Catalyst';
-our $VERSION = '0.07';
+our $VERSION = '0.09';
$VERSION = eval $VERSION;
# Configure the application.
diff --git a/lib/MGA/Mirrors/Controller/Graph.pm b/lib/MGA/Mirrors/Controller/Graph.pm
index 5ca93cf..a2b6ad6 100644
--- a/lib/MGA/Mirrors/Controller/Graph.pm
+++ b/lib/MGA/Mirrors/Controller/Graph.pm
@@ -42,10 +42,16 @@ sub index :Path :Args(0) {
$graph->add_node($_, shape => 'box', cluster => $node{$_}{country});
}
}
- $graph->add_edge($from, $to);
+ # Minimum bandwidth of both nodes
+ my $bandwidth = ($node{$from}{bandwidth} < $node{$to}{bandwidth}) ? $node{$from}{bandwidth} : $node{$to}{bandwidth};
+ $bandwidth = 1 if (!$bandwidth);
+ my $thickness = log($bandwidth) / log(3) - 16; # Scale line thickness from bandwidth
+ $thickness = ($thickness < 1) ? 1 : $thickness;
+ $graph->add_edge($from => $to, penwidth => $thickness);
}
}
$c->stash->{graphviz}->{graph} = $graph;
+ $c->stash->{graphviz}->{format} = "svg";
}
sub end : Private {
diff --git a/lib/MGA/Mirrors/DB.pm b/lib/MGA/Mirrors/DB.pm
index 2e54847..1f59614 100644
--- a/lib/MGA/Mirrors/DB.pm
+++ b/lib/MGA/Mirrors/DB.pm
@@ -10,6 +10,8 @@ use DBI;
use File::Temp qw(tempfile);
use Net::DNS;
+my $timeout = 10; # timeout connecting to remote servers
+
sub configfile { '/etc/mga-mirrors.ini' }
sub new {
@@ -284,13 +286,11 @@ sub check_distributions {
sub _check_url {
my ($self, $furi) = @_;
- my ($fh, $filename) = tempfile();
- close($fh);
my $cmd =
- $furi->scheme =~ /^http|ftp$/ ? "wget -q --no-check-certificate -nv -t 1 -T 4 -O $filename " . $furi->as_string :
- $furi->scheme eq 'rsync' ? "rsync --timeout 4 -q " . $furi->as_string . " $filename" : '';
+ $furi->scheme =~ /^http|ftp$/ ? "wget -q --no-check-certificate -nv -t 1 -T $timeout -O /dev/null " . $furi->as_string :
+ $furi->scheme eq 'rsync' ? "rsync --dry-run --timeout $timeout -q " . $furi->as_string . " /dev/null 2>/dev/null" : '';
my $ok = (system($cmd) == 0);
- unlink($filename);
+ #print STDERR "Result of \"$cmd\" was " . ($ok ? "ok" : "failure") . "\n";
return $ok
}
diff --git a/mga-mirrors.spec.in b/mga-mirrors.spec.in
index 04b0f5e..7c234b4 100644
--- a/mga-mirrors.spec.in
+++ b/mga-mirrors.spec.in
@@ -1,18 +1,16 @@
-# $Id$
+%define name mga-mirrors
+%define oname MGA-Mirrors
+%define version @VERSION@
+%define release %mkrel 1
-%define realname mga-mirrors
-%define version @VERSION@
-%define release %mkrel 1
-
-Name: %{realname}
+Name: %{name}
Version: %{version}
Release: %{release}
License: GPL or Artistic
Group: Development/Perl
Summary: Mageia Mirrors management
-Source: %{realname}-%{version}.tar.gz
-Url: http://mirrors.mageia.org/
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+Source: %{oname}-%{version}.tar.gz
+Url: https://mirrors.mageia.org/
BuildArch: noarch
BuildRequires: perl(Catalyst::Plugin::Prototype)
@@ -23,6 +21,7 @@ BuildRequires: perl(Catalyst::Plugin::Session::State::Cookie)
BuildRequires: perl(Catalyst::Plugin::Session)
BuildRequires: perl(Catalyst::Action::RenderView)
BuildRequires: perl(Catalyst::View::TT)
+BuildRequires: perl(Catalyst::View::GraphViz)
BuildRequires: perl(Catalyst::Plugin::ConfigLoader)
BuildRequires: perl(Catalyst::Plugin::Static::Simple)
BuildRequires: perl(Catalyst::Plugin::Prototype)
@@ -30,6 +29,9 @@ BuildRequires: perl(DBD::Pg)
BuildRequires: perl(Mail::Mailer)
BuildRequires: perl(Catalyst::Plugin::Prototype)
BuildRequires: perl(Catalyst::Plugin::Session::Store::FastMmap)
+BuildRequires: perl(Net::DNS)
+BuildRequires: perl(Config::General)
+BuildRequires: perl(Class::Data::Inheritable)
Requires: perl(Catalyst::Plugin::Session::State::Cookie)
Requires: perl(Catalyst::Plugin::Session::Store::FastMmap)
@@ -47,11 +49,11 @@ Requires: perl(DBD::Pg)
Mageia Mirrors management
%prep
-%setup -q -n %{realname}-%{version}
+%setup -q -n %{oname}-%{version}
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
-%make
+%make_build
%if 0
%check
@@ -59,8 +61,7 @@ make test
%endif
%install
-rm -rf %buildroot
-%makeinstall_std
+%make_install
mkdir -p %{buildroot}%_sysconfdir
install mga-mirrors.ini.in %{buildroot}%_sysconfdir/mga-mirrors.ini
@@ -68,11 +69,7 @@ install mga-mirrors.ini.in %{buildroot}%_sysconfdir/mga-mirrors.ini
mkdir -p %{buildroot}%_var/www/cgi-bin
install script/mga_mirrors_cgi.pl %{buildroot}%_var/www/cgi-bin/mga_mirrors_cgi.pl
-%clean
-rm -rf %buildroot
-
%files
-%defattr(-,root,root)
%doc Changes README
%attr(0640,root,apache) %config(noreplace) %_sysconfdir/mga-mirrors.ini
%_sysconfdir/cron.d/mga_mirrors
diff --git a/root/html/includes/footer.tt b/root/html/includes/footer.tt
index 0ecf502..a6e9cd7 100644
--- a/root/html/includes/footer.tt
+++ b/root/html/includes/footer.tt
@@ -1,5 +1,5 @@
<!-- $Id$ -->
<hr>
-<p><a href="http://www.mageia.org/">Mageia.Org</a></p>
+<p><a href="https://www.mageia.org/">Mageia.Org</a></p>
</body>
</html>
diff --git a/root/html/includes/header.tt b/root/html/includes/header.tt
index 6534c51..f957dd2 100644
--- a/root/html/includes/header.tt
+++ b/root/html/includes/header.tt
@@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<title>Mageia mirrors database</title>
- <link rel="icon" type="image/png" href="/g/favicon.png">
+ <link rel="icon" type="image/png" href="//www.mageia.org/g/favicon.png">
[% c.prototype.define_javascript_functions %]
</head>
<body>
diff --git a/root/html/includes/host_information.tt b/root/html/includes/host_information.tt
index 7ddef5b..7906fe1 100644
--- a/root/html/includes/host_information.tt
+++ b/root/html/includes/host_information.tt
@@ -120,7 +120,7 @@ your update request.<br>
</div>
<script type="text/javascript"
- src="http://maps.google.com/maps/api/js?sensor=false">
+ src="https://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
var map;
diff --git a/root/html/includes/new/unsupported_protocol.tt b/root/html/includes/new/unsupported_protocol.tt
index 7552c82..7c46698 100644
--- a/root/html/includes/new/unsupported_protocol.tt
+++ b/root/html/includes/new/unsupported_protocol.tt
@@ -1 +1 @@
-Unsuported protocol
+Unsupported protocol
diff --git a/root/html/pages/new/confirm.tt b/root/html/pages/new/confirm.tt
index 2dde830..85b19aa 100644
--- a/root/html/pages/new/confirm.tt
+++ b/root/html/pages/new/confirm.tt
@@ -1,7 +1,7 @@
<div id="foo">
<h2>Confirmation</h2>
-<p>The URL [% c.session.new_uri | html %] has been succefully validated.</p>
+<p>The URL [% c.session.new_uri | html %] has been successfully validated.</p>
<p>Please confirm the addition into the database.</p>
diff --git a/root/html/pages/report/index.tt b/root/html/pages/report/index.tt
index b52a1a8..6121133 100644
--- a/root/html/pages/report/index.tt
+++ b/root/html/pages/report/index.tt
@@ -1,6 +1,6 @@
<!-- $Id$ -->
<script type="text/javascript"
- src="http://maps.google.com/maps/api/js?sensor=false">
+ src="https://maps.google.com/maps/api/js?sensor=false&amp;loading=async">
</script>
<style>
div.infow { margin: 0; font-size: 70%; font-family: Helvetica, Arial, sans-serif; }
@@ -34,10 +34,24 @@ div.infow p { margin: 0; }
*
* @param string bw
* @return integer
+ *
+ * mirrors=> select * from bandwidth order by value;
+ * name | value
+ * ----------+--------------
+ * 10Mbits | 10485760
+ * 100Mbits | 104857600
+ * 1Gbits | 1073741824
+ * 2Gbits | 2147483648
+ * 10Gbits | 10737418240
+ * 20Gbits | 21474836480
+ * 100Gbits | 107374182400
+ * 200Gbits | 214748364800
*/
function getStrokeWeight(bw) {
- var bws = { "1Mbits": 1, "10Mbits": 2, "100Mbits": 3,
- "1Gbits": 4, "2Gbits": 5
+ var bws = { "1048576": 1, "10485760": 1, "104857600": 1,
+ "1073741824": 2, "2147483648": 2,
+ "10737418240": 3, "21474836480": 3,
+ "107374182400": 4, "214748364800": 4
};
return (bw in bws) ? bws[bw] : 1;
}
@@ -94,3 +108,4 @@ to Tier2 mirrors.</p>
<h2>Synchronisation tree</h2>
<img src="[% c.uri_for('/graph') %]">
+<p>Line thickness is proportional to bandwidth.</p>
diff --git a/root/mail/host_up_request.tt b/root/mail/host_up_request.tt
index 56b4e91..6f733d9 100644
--- a/root/mail/host_up_request.tt
+++ b/root/mail/host_up_request.tt
@@ -1,8 +1,8 @@
Hi,
-You (hopefully) asked to update information about Mageia mirror.
+You (hopefully) asked to update information about a Mageia mirror.
-To confirm the requst please visit:
+To confirm the request please visit:
[% c.uri_for('/validate', reqid) %]