{"id":13671567,"url":"https://github.com/panamax-rs/panamax","last_synced_at":"2025-04-27T18:31:26.125Z","repository":{"id":39582549,"uuid":"196672958","full_name":"panamax-rs/panamax","owner":"panamax-rs","description":"Mirror rustup and crates.io repositories, for offline Rust and cargo usage.","archived":false,"fork":false,"pushed_at":"2024-04-07T22:37:27.000Z","size":681,"stargazers_count":376,"open_issues_count":27,"forks_count":41,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-04-23T22:55:20.385Z","etag":null,"topics":["cargo","mirror","rust","rustup","rustup-mirror"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/panamax-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-13T03:19:34.000Z","updated_at":"2024-06-06T04:38:24.171Z","dependencies_parsed_at":"2024-06-06T04:38:18.689Z","dependency_job_id":"647edb77-462b-4337-a944-42a76307b231","html_url":"https://github.com/panamax-rs/panamax","commit_stats":{"total_commits":165,"total_committers":21,"mean_commits":7.857142857142857,"dds":"0.32121212121212117","last_synced_commit":"bc54e64b3d3003934f2c8599e0ef6bab4754440a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panamax-rs%2Fpanamax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panamax-rs%2Fpanamax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panamax-rs%2Fpanamax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panamax-rs%2Fpanamax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panamax-rs","download_url":"https://codeload.github.com/panamax-rs/panamax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251187178,"owners_count":21549597,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","mirror","rust","rustup","rustup-mirror"],"created_at":"2024-08-02T09:01:13.447Z","updated_at":"2025-04-27T18:31:25.633Z","avatar_url":"https://github.com/panamax-rs.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Panamax\n\n[![crates.io](https://img.shields.io/crates/v/panamax.svg)](https://crates.io/crates/panamax)\n![Docker Image Version (latest semver)](https://img.shields.io/docker/v/panamaxrs/panamax?label=docker\u0026sort=semver)\n\n![image](https://user-images.githubusercontent.com/1247908/132435079-b703bd5d-c139-4a73-818f-51746353b3ea.png)\n\nPanamax is a tool to mirror the Rust and crates.io repositories, for offline usage of `rustup` and `cargo`.\n\n## Installation\n\nPanamax is itself available on crates.io, and can be installed via:\n\n```\n$ cargo install --locked panamax\n```\n\nAlternatively, you can clone this repository and `cargo build` or `cargo run` within it.\n\n## Usage\n\n## Docker\n\nPanamax is available as a docker image, so you can run:\n\n```\n$ docker run --rm -it -v /path/to/mirror/:/mirror --user $(id -u) panamaxrs/panamax init /mirror\n(Modify /path/to/mirror/mirror.toml as needed)\n$ docker run --rm -it -v /path/to/mirror/:/mirror --user $(id -u) panamaxrs/panamax sync /mirror\n(Once synced, serve the mirror)\n$ docker run --rm -it -v /path/to/mirror/:/mirror --user $(id -u) -p8080:8080 panamaxrs/panamax serve /mirror\n```\n\nAlternatively, you can run panamax in a bare-metal environment like below.\n\n### Init\n\nIn Panamax, mirrors consist of self-contained directories. To create a mirror directory `my-mirror`:\n\n```\n$ panamax init my-mirror\nSuccessfully created mirror base at `my-mirror`.\nMake any desired changes to my-mirror/mirror.toml, then run panamax sync my-mirror.\n```\n\nThere will now be a `my-mirror` directory in your current directory.\n\n### Modify mirror.toml\n\nWithin 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.\n\nThe 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.\n\nYou can modify `mirror.toml` at any point in time, even after the mirror is synchronized.\n\n### Sync\n\nOnce you have made the changes to `mirror.toml`, it is time to synchronize your mirror!\n\n```\n$ panamax sync my-mirror\nSyncing Rustup repositories...\n[1/5] Syncing rustup-init files... ██████████████████████████████████████████████████████████████ 27/27 [00:00:06]\n[2/5] Syncing latest stable...     ████████████████████████████████████████████████████████████ 602/602 [00:09:02]\n[3/5] Syncing latest beta...       ████████████████████████████████████████████████████████████ 524/524 [00:07:29]\n[4/5] Syncing latest nightly...    ████████████████████████████████████████████████████████████ 546/546 [00:08:56]\n[5/5] Cleaning old files...        ████████████████████████████████████████████████████████████ 546/546 [00:00:00]\nSyncing Rustup repositories complete!\nSyncing Crates repositories...\n[1/3] Fetching crates.io-index...  ██████████████████████████████████████████████████████████ 1615/1615 [00:00:02]\n[2/3] Syncing crates files...      ██████████████████████████████████████████████████████████ 6357/6357 [00:00:05]\n[3/3] Syncing index and config...\nSyncing Crates repositories complete!\nSync complete.\n```\n\nOnce 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!\n\nThis directory can now be copied to a USB or rsync'd somewhere else, or even used in place - perfect for long plane trips!\n\nAdditionally, 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.\n\n### Sync Select Dependencies\nOptionally, panamax can be told to only grab crates needed to build a singular project.\n`cargo vendor` is used to create a folder with all needed dependencies,\nthen a panamax command can parse the created directory and only grab those crates and versions.\n```\n# Only grab crates needed for panamax, as an example\n$ cargo vendor\n$ panamax sync my-mirror vendor\n```\n\n## Server\n\nPanamax 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.\n\n```\n$ panamax serve my-mirror\nRunning HTTP on [::]:8080\n```\n\nThe server's index page provides all the instructions needed on how to set up a Rust client that uses this mirror.\n\nIf you would prefer having these instructions elsewhere, the rest of this README will describe the setup process in more detail.\n\nAdditionally, if you would prefer hosting a server with nginx, there is a sample nginx configuration in the repository, at `nginx.sample.conf`.\n\n## Configuring `rustup` and `cargo`\n\nOnce you have a mirror server set up and running, it's time to tell your Rust components to use it.\n\n### Setting environment variables\n\nIn 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/:\n\n```\nexport RUSTUP_DIST_SERVER=http://panamax.internal\nexport RUSTUP_UPDATE_ROOT=http://panamax.internal/rustup\n```\n\nThese need to be set whenever `rustup` is used, so these should be added to your `.bashrc` file (or equivalent).\n\n### Installing `rustup`\n\nIf 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`.\n\nAssuming 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:\n\n```\nwget http://panamax.internal/rustup/dist/x86_64-unknown-linux-gnu/rustup-init\nchmod +x rustup-init\n./rustup-init\n```\n\nThis 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.\n\n### Configuring `cargo`\n\n`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):\n\n```\n[source.my-mirror]\nregistry = \"http://panamax.internal/crates.io-index\"\n[source.crates-io]\nreplace-with = \"my-mirror\"\n```\n\n`Cargo` should now be pointing to the correct location to use the mirror.\n\n### Testing configuration\n\nYou've now set up a Rust mirror! In order to make sure everything is set up properly, you can run a simple test:\n\n```\n$ cargo install ripgrep\n```\n\nThis 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!\n\n\n### Proxies\n\nIf you need to run Panamax through a proxy, you will need to set your configuration options in two places.\n\nFirst, you'll need to set the environment variable `http_proxy` to something like `https://your.proxy:1234` (which can be http or https).\n\nSecond, you'll need to set an http proxy in your `~/.gitconfig`, like so:\n\n```\n[http]\n    proxy = https://your.proxy:1234\n```\n\nWith these two parameters set, Panamax should work through an HTTP proxy.\n\n## License\n\nLicensed under the terms of the MIT license and the Apache License (Version 2.0)\n\nSee [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE) for details.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanamax-rs%2Fpanamax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanamax-rs%2Fpanamax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanamax-rs%2Fpanamax/lists"}