官术网_书友最值得收藏!

Hosting your own private pub mirror

Another possibility for when the pub repository is not reachable (because you have no Internet access or work behind a very strict firewall) is to host your own private pub mirror.

How to do it...

Follow these steps to host your own private pub mirror:

  1. You need a server that speaks to the pub's HTTP API. Documentation on that standalone API does not yet exist, but the main pub server running at pub.dartlang.org is open source with its code living at https://github.com/dart-lang/pub-dartlang. To run the server locally, go through these steps:
    1. Install the App Engine SDK for Python.
    2. Verify that its path is in $PATH.
    3. Install the pip installation file, beautifulsoup4, and pycrypto webtest packages.
    4. From the top-level directory, run this command to start the pub server dev_appserver.py app.
    5. Verify that it works in your browser with http://localhost:8080/.
  2. You need to set a PUB_HOSTED_URL environment variable to point to the URL of your mirror server, so that the pub will look there to download the hosted dependencies, for example, PUB_HOSTED_URL = http://me:mypassword@127.0.0.1:8042.
  3. Manually upload the packages you need to your server, visit http://localhost:8080/admin (sign in as an administrator), go to the Private Key tab, and enter any string into the private key field.

How it works...

The server from can be run from an Intranet as well.

主站蜘蛛池模板: 天柱县| 沿河| 武义县| 阆中市| 长海县| 龙泉市| 石阡县| 德令哈市| 西峡县| 伊宁县| 依安县| 彝良县| 陆良县| 美姑县| 昭苏县| 皋兰县| 麻栗坡县| 新绛县| 扎鲁特旗| 安徽省| 璧山县| 旺苍县| 体育| 丰台区| 辽宁省| 云霄县| 商都县| 抚顺县| 申扎县| 建瓯市| 沅江市| 泽库县| 沙河市| 柏乡县| 壤塘县| 津南区| 自贡市| 蕉岭县| 玉溪市| 余干县| 额济纳旗|