Giter Club home page Giter Club logo

freighter's Introduction

Freighter - Rust Proxy and Registry

The Freighter's purpose is to help the community and company to build the proxy for crates.io and the registry for the development environment.

Why need the Freighter?

When developing a program using Rust in a company, we need to host a proxy for crates.io and private crates registry for the following reasons:

  • The developers will only be allowed use crates of the company with security and complete evaluation.
  • Some crates need to upgrade functions or fix bugs, and the new version does not allow developers to contribute upstream.
  • Some private crates share with different teams and products in the development process.

What are the features?

  • The Freighter is a crate registry for private crates, public crates index and crates sync from crates.io. The registry can store the files in the local disk or storage service compliance S3.
  • The Freighter has an analytics engine for rating public crates.
  • The Freighter has a blacklist and whitelist of evaluated crates used in DevOps.

How to use the Freighter?

Freighter's functionality mainly consists of four parts: synchronizing crates index and crates; syncing the rustup-init files; syncing the rust toolchain files; providing a HTTP server that support static file server, parse the Git protocol, and offering API services such as crate publication.

Freighter can be executed as a standalone executable program. You can build it using the cargo build --release command and then copy it to your /usr/local/bin directory.

1. Prerequisite

  • Freighter defaults to storing data in the default directory /Users/${USERNAME}/freighter. To customize the storage directory, modify the config.toml file.
  • The config file can be obtained by executing any command; Freighter copies the config.default.toml file to the default directory.
  • Alternatively, the config file can be manually copied from the source code directory src which named config.default.toml.
  • Customize the storage path for data by modifying configurations like log_path, index_path, crates_path, etc., in the config file.
  • Freighter uses the config.toml configuration in the default directory for its operations. To use a custom config path, add the -c parameter when executing a command. For example:
    freighter -c /path/to/config.toml <subcommand>
    You can specify paths like /tmp/freighter/config.toml, /tmp/freighter, or /tmp, and Freighter will automatically interpret them as /tmp/freighter/config.toml.

2. Synchronizing Crates Index and Crates

To sync crate files, Freighter needs to first sync the crates index. You can use the following command to sync the index file:

freighter crates pull

This command will create a crates.io-index directory in the default path /Users/${USERNAME}/freighter and fetch the index. If the index already exists, it will attempt to update it.

Full download: Next, you can use the download command with the init parameter to download the full set of crates files:

freighter crates download --init

Incremental update: Without the init parameter, Freighter will compare log records in the working directory to determine the index and crates that need incremental updates:

freighter crates download

3.Syncing the rustup-init Files

4.Syncing the Rust Toolchain Files

5.Http Server

How to contribute?

This project enforce the DCO.

Contributors sign-off that they adhere to these requirements by adding a Signed-off-by line to commit messages.

This is my commit message

Signed-off-by: Random J Developer <[email protected]>

Git even has a -s command line option to append this automatically to your commit message:

$ git commit -s -m 'This is my commit message'

License

Freighter is licensed under this Licensed:

Acknowledgements

freighter's People

Contributors

benjamin-747 avatar bestmike007 avatar dependabot[bot] avatar genedna avatar wangkirin 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.