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

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.

主站蜘蛛池模板: 神池县| 社会| 赣榆县| 调兵山市| 崇文区| 奇台县| 呈贡县| 高陵县| 开鲁县| 甘肃省| 大英县| 桂林市| 报价| 建始县| 定边县| 克拉玛依市| 阿拉善左旗| 安西县| 莱州市| 德江县| 台安县| 仪陇县| 恭城| 青神县| 新兴县| 浦东新区| 翁牛特旗| 镇平县| 巴马| 丁青县| 古交市| 进贤县| 星子县| 石城县| 彭州市| 饶河县| 齐河县| 宜兴市| 元朗区| 江油市| 怀安县|