Skip to content

Commit 3b60cd5

Browse files
authored
Merge pull request #3446 from metacpan/haarg/outage-message
Add mirror page and top banner regarding primary mirror outage
2 parents cd37fc8 + ba79d27 commit 3b60cd5

File tree

5 files changed

+62
-2
lines changed

5 files changed

+62
-2
lines changed

lib/MetaCPAN/Web/Controller/About.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ sub meta_hack : Local : Args(0) {
3838
my ( $self, $c ) = @_;
3939
}
4040

41+
sub mirror : Local : Args(0) { }
42+
4143
sub sponsors : Local : Args(0) {
4244
my ( $self, $c ) = @_;
4345
}

root/about/mirror.tx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
%% cascade base::about::markdown {
2+
%% title => $title || 'Using MetaCPAN as a mirror',
3+
%% }
4+
%% override about -> {
5+
## MetaCPAN Mirror
6+
7+
MetaCPAN provides an alternate mirror for CPAN, which is also a BackPAN (it
8+
includes deleted releases). It can be used if there are issues with the primary
9+
mirror, or you want to access older deleted releases via the `cpan` client.
10+
11+
The address for the mirror is https://cpan.metacpan.org/
12+
13+
### Configuring the Mirror
14+
15+
#### `cpanm`
16+
17+
`cpanm` can use the MetaCPAN mirror using the `-M` option:
18+
19+
cpanm -M https://cpan.metacpan.org/ Module::To::Install
20+
21+
When using the MetaCPAN mirror, it may also be useful to use MetaCPAN's index.
22+
This can be done using the `--metacpan` option.
23+
24+
cpanm -M https://cpan.metacpan.org/ --metacpan Module::To::Install
25+
26+
These options can be set more permanantly using the `PERL_CPANM_OPT` environment variable.
27+
28+
export PERL_CPANM_OPT='-M https://cpan.metacpan.org/ --metacpan'
29+
cpanm Module::To::Install
30+
31+
#### `cpan`
32+
33+
`CPAN.pm` can be configured to use an alternate mirror using the `urllist`
34+
configuration setting. It also must be configured to use the `urllist` option
35+
by disabling the `pushy_https` option.
36+
37+
cpan
38+
o conf urllist https://cpan.metacpan.org/
39+
o conf pushy_https 0
40+
o conf commit
41+
install Module::To::Install
42+
exit
43+
44+
%% }

root/base.tx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<link rel="shortcut icon" href="/static/icons/favicon.ico">
2323
<link rel="apple-touch-icon" sizes="152x152" href="/static/icons/apple-touch-icon.png">
2424
<link rel="search" href="/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
25-
<script async src="https://perl-ads.perlhacks.com/perl-ads.js"></script>
2625
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6B2JCQSHJE"></script>
2726
%% block opengraph -> { }
2827
</head>
@@ -118,7 +117,13 @@
118117
</ul>
119118
</nav>
120119
<div class="page-content [% block page_content_class -> { } %]">
121-
<div id="perl-ad-target" class="top-notify-banner perl-ad-target">
120+
<div class="top-notify-banner alert-banner">
121+
<p>
122+
<i class="fa-solid fa-triangle-exclamation"></i>
123+
There is an ongoing outage on the primary CPAN mirror. It is
124+
possible to work around the issue by <a href="/about/mirror">using
125+
MetaCPAN as a mirror</a>.
126+
</p>
122127
</div>
123128
<nav class="sidebar">
124129
%% block left_nav -> {

root/base/about.tx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ for [
1212
[ 'FAQ', '/about/faq' ],
1313
[ 'Contributors', '/about/contributors' ],
1414
[ 'meta::hack', '/about/meta_hack' ],
15+
[ 'CPAN Mirror', '/about/mirror' ],
1516
[ 'Missing Modules', '/about/missing_modules' ],
1617
[ 'Distribution Metadata', '/about/metadata' ],
1718
] -> $l {

root/static/less/nav.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
color: #c0d2e4;
2929
text-decoration: underline;
3030
}
31+
32+
p:last-child {
33+
margin-bottom: 0;
34+
}
35+
36+
&.alert-banner {
37+
background-color: #c00;
38+
}
3139
}
3240

3341
.navbar {

0 commit comments

Comments
 (0)