Skip to content

Commit 2602120

Browse files
committed
add about page with instructions for using metacpan as a mirror
1 parent cd37fc8 commit 2602120

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
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/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 {

0 commit comments

Comments
 (0)