Giter VIP home page Giter VIP logo

crates-caching-proxy's Introduction

crates-caching-proxy

A Clojure-based caching proxy for Cargo crates downloaded from crates.io. The primary intent of the application is to have a functioning build while the crates.io site is down. Note that there are two pieces to downloading crates, the first is the create-io.index and the second is the packages themselves. This project is only concerned with storing the crates themselves, not the index.

Usage

The entire application is a single clojure file, launched via lein crate-proxy. By default the proxy will launch on port 8888 and cache the crates in the proxy-cache directory, wherever it was launched. To override the port and the cache directory, use a command like: CACHE_ROOT="/full/path/to/dir" CRATE_PROXY_PORT=9090 lein crate-proxy.

To point cargo at your local proxy, first clone the create-io.index. Change the config.json in the root of the repository to indicate the local proxy:

{
  "dl": "http://localhost:8888/api/v1/crates",
  "api": "http://localhost:8888/"
}

Commit that change to the local crates-io.index repository. In the root directory of the cargo project you're wanting to build create a .cargo/config file that points to the local create-io.index:

[registry]
index = "file:///local/path/to/creates.io-index"

When running cargo build, you will see Updating registry... which will point to the new repostory location. The crates will be downloaded to the CACHE_ROOT directory, subqequent cargo runs will use the local cached copy.

It's important to note that cargo won't attempt to download crates that already exist in the ~/.cargo/registry. Make sure to clear that directory so that cargo will go fetch the depdencies and ensure the proxy is working.

Maintenance

Maintainers: Ryan Senior [email protected]

crates-caching-proxy's People

Contributors

rbrw avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.