An open API service indexing awesome lists of open source software.

https://github.com/cemoktra/cargolifter

doing the crate lifting for you
https://github.com/cemoktra/cargolifter

alternative-registries cargo registry rust

Last synced: about 1 month ago
JSON representation

doing the crate lifting for you

Awesome Lists containing this project

README

        

[![Build Status](https://github.com/cemoktra/cargolifter/workflows/CI/badge.svg)](https://github.com/cemoktra/cargolifter/actions)
[![crates.io](https://img.shields.io/crates/v/cargolifter.svg)](https://crates.io/crates/cargolifter)

# CargoLifter #
This project offers an implementation of an alternate registry. Instead of having it's own auth mechanism it uses existing source control providers logins. Those are:

- Github
- Gitlab
- Gitea (e.g. codederg)

CargoLifter uses access tokens for interacting with the backend. So each action will be impersonated. This of course requires write access and this is the way to limit.

## Cargo Login ##
### Github ###
Use a combination of username and personal access token like this: `:`

### Gitlab ###
Use your gitlab access token as cargo login token.

## Configuration ##
Configuration is done via a JSON config file.

### Service ###
```json
"web": {
"port": 8080
}
```

### Storage ###
FileSystem storage configuration:
```json
"storage": {
"FileSystem": {
"path": ""
}
}
```

S3 storage configuration (you may omit the `credentials` for S3 access as it will default to the environment variables):
```json
"storage": {
"S3": {
"bucket": "",
"credentials": {
"access_key": "",
"secret_key": "",
"secret_token": "",
}
}
}
```

Files that are mirrored will automatically put in a subfolder called `mirror`.

### Backend ###
Github configuration:

```json
"backend": {
"Github": {
"owner": "",
"repo": "",
"host": "",
"cargolifter_token": "",
"default_branch": ""
}
}
```

Gitlab configuration:
```json
"backend": {
"Gitlab": {
"project_id": "",
"host": "",
"cargolifter_token": "
",
"default_branch": ""
}
}
```

The registry git repository must contain a prefilled `config.json` containing on both cases:
```json
{
"dl": "http://:/api/v1/crates",
"api": "http://:"
}
```

### Example Config ###

```json
{
"backend": {
"Github": {
"owner": "cemoktra",
"repo": "my-private-crates",
}
},
"web": {
"port": 8080
},
"storage": {
"FileSystem": {
"path": "./test/storage"
}
}
}
```