Skip to content

Commit

Permalink
chore: prepare freighter v0.1.1-rc.2 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah-Kennedy authored Jul 23, 2023
1 parent 04bf9e1 commit 806fae9
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = [

[workspace.dependencies]
freighter-auth = { path = "freighter-auth", registry = "freighter", version = "0.1.0-rc.1" }
freighter-index = { path = "freighter-index", registry = "freighter", version = "0.1.0-rc.1" }
freighter-index = { path = "freighter-index", registry = "freighter", version = "0.1.0-rc.2" }
freighter-server = { path = "freighter-server", registry = "freighter", version = "0.1.0-rc.1" }
freighter-storage = { path = "freighter-storage", registry = "freighter", version = "0.1.0-rc.1" }

Expand Down
2 changes: 1 addition & 1 deletion freighter-index/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "freighter-index"
version = "0.1.0-rc.1"
version = "0.1.0-rc.2"
edition = "2021"
license = "MIT OR Apache-2.0"
authors = ["Noah Kennedy <nomaxx117@gmail.com>"]
Expand Down
4 changes: 2 additions & 2 deletions freighter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "freighter"
version = "0.1.1-rc.1"
version = "0.1.1-rc.2"
edition = "2021"
license = "MIT OR Apache-2.0"
authors = ["Noah Kennedy <nomaxx117@gmail.com>"]
publish = ["freighter"]
repository = "https://github.com/cloudflare/freighter"
description = "Crate index traits and implementations for the freighter registry"
categories = ["asynchronous", "authentication"]
categories = ["asynchronous"]
keywords = ["registries", "freighter"]

[dependencies]
Expand Down
67 changes: 67 additions & 0 deletions freighter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Freighter
Freighter is a Rust private registry implementation designed to be, above all else, modular, fast and operationally
boring. Freighter is intended to be something you can feel comfortable deploying and then ignoring until the end of
time.

## Features

### Configurability
Freighter is configurable via a yaml file parsed at startup.

### Scalability
Freighter stores the index in PostgreSQL databases, and crate tarballs in services implementing basic elements of the
S3 API.

### Observability
Freighter exposes metrics via prometheus, and logs to stdout using `tracing`.

### Graceful Restarts
Freighter will stop accepting new requests but continue handling existing ones when a SIGTERM is received.

## Running locally

To try out Freighter **locally**, start a `postgres:14` or `postgres:15` server:
```
docker run -it -e POSTGRES_USER=freighter -e POSTGRES_PASSWORD=crates-crates-crates -p 5432:5432 -v /data:/var/lib/postgresql/data postgres:14
```

Run the migrations, e.g. with a locally installed `psql`:
```
PGPASSWORD=crates-crates-crates psql -U freighter -h localhost -f sql/init-index-db.sql
PGPASSWORD=crates-crates-crates psql -U freighter -h localhost -f sql/init-auth-db.sql
```

Next, we need an S3-compatible server. You can use an S3 emulator for testing purposes:
```
docker run -it -p 9090:9090 -e initialBuckets=crates -e validKmsKeys="arn:aws:kms:us-east-1:1234567890:key/valid-secret" -e debug=true -t adobe/s3mock
```

Finally, a config file using the above:
```yaml
service:
address: "127.0.0.1:3000"
download_endpoint: "127.0.0.1:3000/downloads/{crate}/{version}"
api_endpoint: "127.0.0.1:3000"
metrics_address: "127.0.0.1:3001"

index_db: &db
dbname: "freighter"
user: "freighter"
password: "crates-crates-crates"
host: "localhost"
port: 5432

auth_db: *db

store:
name: "crates"
endpoint_url: "http://127.0.0.1:9090"
region: "us-east-1"
access_key_id: "1234567890"
access_key_secret: "valid-secret"
```
Start Freighter:
```
cargo run -p freighter -- -c config.yaml
```

0 comments on commit 806fae9

Please sign in to comment.