Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit f57d473

Browse files
committedMar 25, 2016
Merge pull request #511 from Medium/nick-global
Use github releases to serve download files
2 parents 18bed40 + 2da9622 commit f57d473

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed
 

‎README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,30 @@ the request of PhantomJS team.
7171
Deciding Where To Get PhantomJS
7272
-------------------------------
7373

74-
By default, this package will download phantomjs from `https://bitbucket.org/ariya/phantomjs/downloads`.
74+
By default, this package will download phantomjs from our [releases](https://github.com/Medium/phantomjs/releases/).
7575
This should work fine for most people.
7676

7777
##### Downloading from a custom URL
7878

79-
If bitbucket is down, or the Great Firewall is blocking bitbucket, you may need to use
80-
a download mirror. To set a mirror, set npm config property `phantomjs_cdnurl`.
81-
Default is ``.
79+
If github is down, or the Great Firewall is blocking github, you may need to use
80+
a different download mirror. To set a mirror, set npm config property `phantomjs_cdnurl`.
8281

83-
```shell
84-
npm install phantomjs-prebuilt --phantomjs_cdnurl=http://cnpmjs.org/downloads
82+
Alternatives include `https://bitbucket.org/ariya/phantomjs/downloads` (the official download site)
83+
and `http://cnpmjs.org/downloads`.
84+
85+
```Shell
86+
npm install phantomjs-prebuilt --phantomjs_cdnurl=https://bitbucket.org/ariya/phantomjs/downloads
8587
```
8688

8789
Or add property into your `.npmrc` file (https://www.npmjs.org/doc/files/npmrc.html)
8890

8991
```
90-
phantomjs_cdnurl=http://cnpmjs.org/downloads
92+
phantomjs_cdnurl=https://bitbucket.org/ariya/phantomjs/downloads
9193
```
9294

9395
Another option is to use PATH variable `PHANTOMJS_CDNURL`.
9496
```shell
95-
PHANTOMJS_CDNURL=http://cnpmjs.org/downloads npm install phantomjs
97+
PHANTOMJS_CDNURL=https://bitbucket.org/ariya/phantomjs/downloads npm install phantomjs
9698
```
9799

98100
##### Using PhantomJS from disk
@@ -175,9 +177,9 @@ was not able to download the PhantomJS binary for your platform. Please try agai
175177
##### I tried again, but I get `ECONNRESET` or `ETIMEDOUT` consistently.
176178

177179
Do you live in China, or a country with an authoritarian government? We've seen problems where
178-
the GFW or local ISP blocks bitbucket, preventing the installer from downloading the binary.
180+
the GFW or local ISP blocks github, preventing the installer from downloading the binary.
179181

180-
Try visiting [the download page](http://cdn.bitbucket.org/ariya/phantomjs/downloads) manually.
182+
Try visiting [the download page](https://bitbucket.org/ariya/phantomjs/downloads) manually.
181183
If that page is blocked, you can try using a different CDN with the `PHANTOMJS_CDNURL`
182184
env variable described above.
183185

‎install.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var url = require('url')
2020
var which = require('which')
2121

2222
var originalPath = process.env.PATH
23+
var DEFAULT_CDN = 'https://github.com/Medium/phantomjs/releases/download/v2.1.1/'
2324

2425
// If the process exits without going through exit(), then we did not complete.
2526
var validExit = false
@@ -428,7 +429,7 @@ function getDownloadUrl() {
428429
function getDownloadSpec() {
429430
var cdnUrl = process.env.npm_config_phantomjs_cdnurl ||
430431
process.env.PHANTOMJS_CDNURL ||
431-
'https://bitbucket.org/ariya/phantomjs/downloads'
432+
DEFAULT_CDN
432433
var downloadUrl = cdnUrl + '/phantomjs-' + helper.version + '-'
433434
var checksum = ''
434435

0 commit comments

Comments
 (0)
This repository has been archived.