nylar / pallet

📦 A private registry and API for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pallet

Pallet

Build Status License

A private registry and API for Rust.

Installation

Pallet comes with the following storage backends that must be selected at compile-time:

  • Local (files are stored and served from a directory).
  • S3 (files are stored and served from an S3 bucket).

Building from source

Pallet requires rust and the requirements listed below. A storage feature must be selected (either local or s3).

cargo build --release --features STORAGE_BACKEND

Docker

The docker directory has a Dockerfile for each storage backend. These are also available from the Docker registry.

Requirements

  • libssl-dev
  • libpq-dev

Database

Pallet currently requires a Postgresql database for storing owners and crate information. The migrations require the diesel_cli tool:

cargo install diesel_cli --no-default-features --features postgres

The migrations can then be run with:

DATABASE_URL=POSTGRES_DSN diesel migration run

Usage

To interact with the Pallet API via Cargo, you will need to create an owner and a token, information on how to do that can be found in the sections below. Once you have a token generated by Pallet, you can run cargo login --registry=NAME_OF_REGISTRY. This will prompt you to visit /me, however, you already have a token and can paste that into the prompt.

A token can also be supplied as an environment variable or as a flag to cargo subcommands.

Owners

Owners are currently created using the pallet binary by using the create_owner subcommand.

Tokens

Tokens are currently created using the pallet binary by using the create_token subcommand. An owner is required before you can create a token. The token can either be used with cargo login or passed in as an environment variable/flag when running commands that require authorisation.

Publishing

A token is required to publish a crate. When a crate is first pushed, the owner associated with the token publishing the crate will be the sole owner of the crate. Owners can be added/listed/removed from a crate using the cargo owner subcommand. A crate can be published using the cargo publish subcommand. You may either pass a registry as an environment variable/flag or add it to the Cargo.toml manifest:

[package]
# ...
publish = ["NAME_OF_REGISTRY"]

Yanking/Unyanking

A crate version can be yanked or unyanked using the cargo yank subcommand. A token for an owner of the crate is required to yank/unyank a crate version. A crate version can be unyanked using the --undo flag.

License

Licensed under either of

at your option.

About

📦 A private registry and API for Rust

License:Apache License 2.0


Languages

Language:Rust 96.4%Language:PLpgSQL 1.8%Language:RenderScript 1.3%Language:TSQL 0.5%