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).
Pallet requires rust
and the requirements listed below. A storage feature must be selected (either local
or s3
).
cargo build --release --features STORAGE_BACKEND
The docker
directory has a Dockerfile
for each storage backend. These are also available from the Docker registry.
libssl-dev
libpq-dev
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
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 are currently created using the pallet
binary by using the create_owner
subcommand.
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.
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"]
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.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.