Note
From Artifactory version 7.58.x, the default method for Cargo indexing is sparse indexing. However, If you are using an Artifactory earlier than 7.46.3, or a Cargo client earlier than 1.60, you may need to use Cargo Git Indexing.
To configure the Cargo client to work opposite JFrog Artifactory using Git indexing:
Edit the configuration file under your Cargo home directory (for example
~/.cargo/config.toml
). In this example we useartprod.mycompany
to represent the Artifactory:# Makes artifactory the default registry and saves passing --registry parameter [registry] default = "artifactory" [registries.artifactory] index = "https://productdemo.jfrog.io/artifactory/git/bank32-cargo-local-2.git" # For sending credentials in git requests. # Not required if anonymous access is enabled [net] git-fetch-with-cli = true
To set your credentials for API calls such as
publish
andyank
, add the following section to the credentials file under your Cargo home directory (for example~/.cargo/credentials.toml
):[registries.artifactory] token = "Bearer pm-admin:<PASSWORD> (converted to base 64)"
Git Support for Cargo Repositories
As the Cargo Client requires the Cargo registry to be a Git repository, the following Git support has been applied in Artifactory:
An internal
.git
folder exists for each Cargo repository to reflect the index.git
files. This folder is recreated after every reindexing process.An internal
git
directory in theData
directory of Artifactory has been added for each Cargo repository. This is a local clone that will be recreated following each restart or repository init.