All Projects → panamax-rs → panamax

panamax-rs / panamax

Licence: other
Mirror rustup and crates.io repositories, for offline Rust and cargo usage.

Programming Languages

rust
11053 projects
CSS
56736 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to panamax

dcos-k8s-rust-skaffold-demo
A demo of pipelining Rust application development to Kubernetes on DC/OS with Skaffold.
Stars: ✭ 40 (-66.39%)
Mutual labels:  cargo, rustup
cleanmymac
A developer friendly command line cleaner program for modern macOS systems
Stars: ✭ 35 (-70.59%)
Mutual labels:  rustup
packagehub
An extension for displaying dependencies of projects on GitHub
Stars: ✭ 71 (-40.34%)
Mutual labels:  cargo
fe
A super-fast and easy to use command line fuzzy file searcher built with the rust programming language.
Stars: ✭ 23 (-80.67%)
Mutual labels:  cargo
mirror-leech-telegram-bot
Aria/qBittorrent Telegram mirror/leech bot
Stars: ✭ 1,289 (+983.19%)
Mutual labels:  mirror
project
☕️ Create node, rust, python or ruby project locally and on github (private or public)
Stars: ✭ 19 (-84.03%)
Mutual labels:  cargo
build-rust
Script helper for building rustc and cargo from source on OpenBSD (without rustup)
Stars: ✭ 33 (-72.27%)
Mutual labels:  cargo
vcpkg-rs
Build library for finding native libraries in vcpkg for Rust - Windows (msvc), Linux and macOS
Stars: ✭ 68 (-42.86%)
Mutual labels:  cargo
googleapis-mirror
A subset mirror of the Google Libraries API CDN meant to be served from your local development machine when internet access is lacking.
Stars: ✭ 45 (-62.18%)
Mutual labels:  mirror
cargo-testify
Watches changes in a rust project, runs test and shows friendly notification
Stars: ✭ 76 (-36.13%)
Mutual labels:  cargo
NuGet.CatalogReader
NuGet v3 catalog reader
Stars: ✭ 34 (-71.43%)
Mutual labels:  mirror
cargo-clone
A cargo subcommand to fetch the source code of a Rust crate
Stars: ✭ 72 (-39.5%)
Mutual labels:  cargo
proxpi
PyPI caching mirror
Stars: ✭ 19 (-84.03%)
Mutual labels:  mirror
libtool
Mirror of git://git.savannah.gnu.org/libtool.git
Stars: ✭ 17 (-85.71%)
Mutual labels:  mirror
rhack
Temporary edit external crates that your project depends on
Stars: ✭ 104 (-12.61%)
Mutual labels:  cargo
mirror
A "Smart Mirror" Android application
Stars: ✭ 53 (-55.46%)
Mutual labels:  mirror
Mirror
Deploy Google and Wikipedia mirror with one command using now.sh.
Stars: ✭ 93 (-21.85%)
Mutual labels:  mirror
cargo-llvm-cov
Cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage).
Stars: ✭ 181 (+52.1%)
Mutual labels:  cargo
autoconf
Mirror of git://git.savannah.gnu.org/autoconf.git
Stars: ✭ 21 (-82.35%)
Mutual labels:  mirror
nixcrates
DEPRECATED reads rust-lang/crates.io-index and outputs nix expressions into fractalide/nix-crates-index
Stars: ✭ 14 (-88.24%)
Mutual labels:  cargo

Panamax

crates.io Docker Image Version (latest semver)

image

Panamax is a tool to mirror the Rust and crates.io repositories, for offline usage of rustup and cargo.

Installation

Panamax is itself available on crates.io, and can be installed via:

$ cargo install panamax

Alternatively, you can clone this repository and cargo build or cargo run within it.

Usage

Docker

Panamax is available as a docker image, so you can run:

$ docker run -it -v /path/to/mirror/:/mirror panamaxrs/panamax init /mirror
(Modify /path/to/mirror/mirror.toml as needed)
$ docker run -it -v /path/to/mirror/:/mirror panamaxrs/panamax sync /mirror
(Once synced, serve the mirror)
$ docker run -it -v /path/to/mirror/:/mirror -p8080:8080 panamaxrs/panamax serve /mirror

Alternatively, you can run panamax in a bare-metal environment like below.

Init

In Panamax, mirrors consist of self-contained directories. To create a mirror directory my-mirror:

$ panamax init my-mirror
Successfully created mirror base at `my-mirror`.
Make any desired changes to my-mirror/mirror.toml, then run panamax sync my-mirror.

There will now be a my-mirror directory in your current directory.

Modify mirror.toml

Within the directory, you'll find a mirror.toml file. This file contains the full configuration of the mirror, and while it has sane defaults, you should ensure the values are set to what you want.

The other important parameter to set is the base_url within the [crates] section. After cargo fetches the index, it will try to use this URL to actually download the crates. It's important this value is accurate, or cargo may not work with the mirror.

You can modify mirror.toml at any point in time, even after the mirror is synchronized.

Sync

Once you have made the changes to mirror.toml, it is time to synchronize your mirror!

$ panamax sync my-mirror
Syncing Rustup repositories...
[1/5] Syncing rustup-init files... ██████████████████████████████████████████████████████████████ 27/27 [00:00:06]
[2/5] Syncing latest stable...     ████████████████████████████████████████████████████████████ 602/602 [00:09:02]
[3/5] Syncing latest beta...       ████████████████████████████████████████████████████████████ 524/524 [00:07:29]
[4/5] Syncing latest nightly...    ████████████████████████████████████████████████████████████ 546/546 [00:08:56]
[5/5] Cleaning old files...        ████████████████████████████████████████████████████████████ 546/546 [00:00:00]
Syncing Rustup repositories complete!
Syncing Crates repositories...
[1/3] Fetching crates.io-index...  ██████████████████████████████████████████████████████████ 1615/1615 [00:00:02]
[2/3] Syncing crates files...      ██████████████████████████████████████████████████████████ 6357/6357 [00:00:05]
[3/3] Syncing index and config...
Syncing Crates repositories complete!
Sync complete.

Once this is step completes (without download errors), you will now have a full, synchronized copy of all the files needed to use rustup and cargo to their full potential!

This directory can now be copied to a USB or rsync'd somewhere else, or even used in place - perfect for long plane trips!

Additionally, this mirror can continually by synchronized in the future - one recommendation is to run this command in a cronjob once each night, to keep the mirror reasonably up to date.

Server

Panamax provides a warp-based HTTP(S) server that can handle serving a Rust mirror fast and at scale. This is the recommended way to serve the mirror.

$ panamax serve my-mirror
Running HTTP on [::]:8080

The server's index page provides all the instructions needed on how to set up a Rust client that uses this mirror.

If you would prefer having these instructions elsewhere, the rest of this README will describe the setup process in more detail.

Additionally, if you would prefer hosting a server with nginx, there is a sample nginx configuration in the repository, at nginx.sample.conf.

Configuring rustup and cargo

Once you have a mirror server set up and running, it's time to tell your Rust components to use it.

Setting environment variables

In order to ensure rustup knows where to look for the Rust components, we need to set some environment variables. Assuming the mirror is hosted at http://panamax.internal/:

export RUSTUP_DIST_SERVER=http://panamax.internal
export RUSTUP_UPDATE_ROOT=http://panamax.internal/rustup

These need to be set whenever rustup is used, so these should be added to your .bashrc file (or equivalent).

Installing rustup

If you already have rustup installed, this step isn't necessary, however if you don't have access to https://rustup.rs, the mirror also contains the rustup-init files needed to install rustup.

Assuming the mirror is hosted at http://panamax.internal/, you will find the rustup-init files at http://panamax.internal/rustup/dist/. The rustup-init file you want depends on your architecture. Assuming you're running desktop Linux on a 64-bit machine:

wget http://panamax.internal/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
chmod +x rustup-init
./rustup-init

This will let you install rustup the similarly following the steps from https://rustup.rs. This will also let you use rustup to keep your Rust installation updated in the future.

Configuring cargo

Cargo also needs to be configured to point to the mirror. This can be done by adding the following lines to ~/.cargo/config (creating the file if it doesn't exist):

[source.my-mirror]
registry = "http://panamax.internal/crates.io-index"
[source.crates-io]
replace-with = "my-mirror"

Cargo should now be pointing to the correct location to use the mirror.

Testing configuration

You've now set up a Rust mirror! In order to make sure everything is set up properly, you can run a simple test:

$ cargo install ripgrep

This will install the grep-like rg tool (which is a great tool - props to burntsushi!). If cargo successfully downloads and builds everything, you have yourself a working mirror. Congratulations!

Proxies

If you need to run Panamax through a proxy, you will need to set your configuration options in two places.

First, you'll need to set the environment variable http_proxy to something like https://your.proxy:1234 (which can be http or https).

Second, you'll need to set an http proxy in your ~/.gitconfig, like so:

[http]
    proxy = https://your.proxy:1234

With these two parameters set, Panamax should work through an HTTP proxy.

License

Licensed under the terms of the MIT license and the Apache License (Version 2.0)

See LICENSE-MIT and LICENSE-APACHE for details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].