Caesium is an alternative crate registry for Rust, allowing crates to be publshed directly from Cargo. Below are the key features of Caesium:
The key areas which it does not have compared to crates.io are:
There are two parts that are required for Caesium, these are:
The following sections will go through how to set each of these up.
You will need a new Git repository which needs to contain a config.json file at the base of the repository. This needs to contain the following information (note this is subject to change as the interface is still evolving):
{
"dl": "file:///path/to/my/crates/store",
"api": "http://127.0.0.1:3000"
}
The dl
field is the URL that uploaded crates can be downloaded from, note that
using a file based URL is only sensible if all machines that need to download
crates have access to the same location.
The api
field provides details of the URL to access the Caesium server.
Caesium loads registry.toml from the current directory for the configuration, an example of the configuration is shown below:
[registry]
index = "ssh://git@git.server/index.git"
[storage.file]
location = "/path/to/my/crates/store"
The index
field is the URL for the Git index that was setup in the previous
step.
Below are the key areas of config, the items in bold are mandatory:
This just has a single entry for the index, which is mandatory, below is an example:
[registry]
index = "ssh://git@git.server/index.git"
The storage config contains the following options (one of which must be set):
There is only one key for file based storage, that is the location
of where
to store the crates. Below is an example:
[storage.file]
location = "/crates/storage/path"
Artifactory includes the following configuration:
Below is an example:
[storage.artifactory]
base_url = "https://artifactory.server/caesium"
api_key = "ABSSJKDNAKSNCNUuansiasncsMKA..."
The server config just has one optional field, this allows setting the port that Caesium sets the server up on (by default this is 3000). Below is an example:
[server]
port = 3000