Skip to content

Commit

Permalink
Merge branch 'release/0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius committed Mar 13, 2023
2 parents 4fcea57 + e23b139 commit 8437529
Show file tree
Hide file tree
Showing 21 changed files with 1,640 additions and 883 deletions.
1,942 changes: 1,339 additions & 603 deletions Cargo.lock

Large diffs are not rendered by default.

43 changes: 20 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustus"
version = "0.6.1"
version = "0.7.0"
edition = "2021"
description = "TUS protocol implementation written in Rust."
keywords = ["tus", "server", "actix-web"]
Expand All @@ -17,9 +17,10 @@ readme = "README.md"
name = "rustus"

[dependencies]
bytes = "~1.3.0"
bytes = "^1.3.0"
bb8 = "^0.8.0"
async-trait = "^0.1.52"
base64 = "0.20.0"
base64 = "^0.21.0"
log = "^0.4.14"
serde_json = "^1"
thiserror = "^1.0"
Expand All @@ -32,7 +33,10 @@ wildmatch = "2.1.0"
md-5 = "^0.10.1"
digest = "0.10.3"
mimalloc = { version = "~0.1.30", default-features = false }

clap = { version = "4.1.8", features = ["derive", "env"] }
dotenvy = { version = "0.15.6", features = ["clap"] }
sentry = "0.30.0"
sentry-actix = "0.30.0"

[dependencies.sha1]
version = "^0.10.1"
Expand Down Expand Up @@ -74,15 +78,19 @@ version = "^0.6.0"

[dependencies.lapin]
optional = true
version = "^1.0.0"
version = "^2.0.0"

[dependencies.bb8-lapin]
version = "^0.4.0"
optional = true

[dependencies.mobc-lapin]
[dependencies.bb8-redis]
optional = true
version = "^0.7.0"
version = "^0.12.0"

[dependencies.mobc-redis]
[dependencies.redis]
optional = true
version = "^0.7.0"
version = "^0.22.3"

[dependencies.rbatis]
default-features = false
Expand All @@ -98,9 +106,6 @@ version = "^2.0"
features = ["json"]
version = "^0.11.8"

[dependencies.structopt]
version = "^0.3"

[dependencies.strum]
features = ["derive"]
version = "0.24.0"
Expand All @@ -119,10 +124,6 @@ features = [
]
version = "^1.4.0"

[dependencies.tokio-amqp]
optional = true
version = "^1.0.0"

[dependencies.uuid]
features = ["v4"]
version = "^1.0.0-alpha.1"
Expand All @@ -131,15 +132,11 @@ version = "^1.0.0-alpha.1"
version = "~0.32.3"

[features]
all = [
"redis_info_storage",
"db_info_storage",
"amqp_notifier",
]
amqp_notifier = ["lapin", "tokio-amqp", "mobc-lapin"]
all = ["redis_info_storage", "db_info_storage", "amqp_notifier"]
amqp_notifier = ["lapin", "bb8-lapin"]
db_info_storage = ["rbatis", "rbson"]
default = []
redis_info_storage = ["mobc-redis"]
redis_info_storage = ["bb8-redis", "redis"]

### For testing
test_redis = []
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div align="center">
<img src="./imgs/logo_horizontal.svg" alt="logo" width="500">
<img src="https://raw.githubusercontent.com/s3rius/rustus/master/imgs/logo_horizontal.svg" alt="logo" width="500">
<div>
<p></p>
<img alt="Docker Image Size (latest by date)" src="https://img.shields.io/docker/image-size/s3rius/rustus?sort=date&style=for-the-badge">
<img alt="Docker Image Version (latest semver)" src="https://img.shields.io/docker/v/s3rius/rustus?style=for-the-badge">
<img alt="GitHub" src="https://img.shields.io/github/license/s3rius/rustus?style=for-the-badge">
<a href="https://hub.docker.com/r/s3rius/rustus/"><img alt="Docker Image Size (latest by date)" src="https://img.shields.io/docker/image-size/s3rius/rustus?sort=date&style=for-the-badge"></a>
<a href="https://hub.docker.com/r/s3rius/rustus/"><img alt="Docker Image Version (latest semver)" src="https://img.shields.io/docker/v/s3rius/rustus?style=for-the-badge"></a>
<a href="https://github.com/s3rius/rustus/blob/master/LICENSE"><img alt="GitHub" src="https://img.shields.io/github/license/s3rius/rustus?style=for-the-badge"></a>
</div>
<p><a href="https://tus.io/">TUS</a> protocol implementation written in Rust.</p>
<p>Production-ready <a href="https://tus.io/">TUS</a> protocol implementation written in Rust.</p>
</div>

## Features
Expand Down
38 changes: 29 additions & 9 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Also you can disable access log for `/health` endpoint, by using `--disable-heal
--url "/files" \
--log-level "INFO" \
--cors "my.*.domain.com,your.*.domain.com" \
--disable-health-access-log "yes"
--disable-health-access-log
```

=== "ENV"
Expand All @@ -52,12 +52,32 @@ Also you can disable access log for `/health` endpoint, by using `--disable-heal
export RUSTUS_URL="/files"
export RUSTUS_LOG_LEVEL="INFO"
export RUSTUS_CORS="my.*.domain.com,your.*.domain.com"
export RUSTUS_DISABLE_HEALTH_ACCESS_LOG="yes"
export RUSTUS_DISABLE_HEALTH_ACCESS_LOG="true"

rustus
```


## Sentry integration

If you have sentry and want to see all erros in your sentry project,
please provide sentry-dsn to rustus.

=== "CLI"

``` bash
rustus --sentry-dsn "https://[email protected]/11" \
--sentry-sample-rate 1.0
```

=== "ENV"

``` bash
export RUSTUS_SENTRY_DSN="https://[email protected]/11"
export RUSTUS_SENTRY_SAMPLE_RATE="1.0"

rustus
```


## Configuring storage
Expand Down Expand Up @@ -105,7 +125,7 @@ data
=== "CLI"

``` bash
rustus --force-fsync "yes" \
rustus --force-fsync \
--storage "file-storage" \
--data-dir "./data/" \
--dir-structure "{year}/{month}/{day}"
Expand All @@ -117,7 +137,7 @@ data
export RUSTUS_STORAGE="file-storage"
export RUSTUS_DATA_DIR="./data/"
export RUSTUS_DIR_STRUCTURE="{year}/{month}/{day}"
export RUSTUS_FORCE_FSYNC="yes"
export RUSTUS_FORCE_FSYNC="true"

rustus
```
Expand Down Expand Up @@ -167,9 +187,9 @@ Required parameter are only `--s3-url` and `--s3-bucket`.
--s3-profile "my_profile" \
--s3-security-token "token" \
--s3-session-token "token" \
--s3-force-path-style "yes" \
--s3-force-path-style \
--s3-headers '{"x-amz-acl": "public-read"}' \
--force-fsync "yes" \
--force-fsync \
--data-dir "./data/" \
--dir-structure "{year}/{month}/{day}"
```
Expand All @@ -189,7 +209,7 @@ Required parameter are only `--s3-url` and `--s3-bucket`.
export RUSTUS_S3_HEADERS='{"x-amz-acl": "public-read"}'
export RUSTUS_DATA_DIR="./data/"
export RUSTUS_DIR_STRUCTURE="{year}/{month}/{day}"
export RUSTUS_FORCE_FSYNC="yes"
export RUSTUS_FORCE_FSYNC="true"

rustus
```
Expand Down Expand Up @@ -317,15 +337,15 @@ By default all extensions are enabled.
=== "CLI"

``` bash
rustus --remove-parts "yes" \
rustus --remove-parts \
--tus-extensions "getting,creation,termination,creation-with-upload,creation-defer-length,concatenation,checksum"
```

=== "ENV"

``` bash
export RUSTUS_TUS_EXTENSIONS="getting,creation,termination,creation-with-upload,creation-defer-length,concatenation,checksum"
export RUSTUS_REMOVE_PARTS="yes"
export RUSTUS_REMOVE_PARTS="true"

rustus
```
28 changes: 14 additions & 14 deletions docs/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ This option disabled by default for security purposes unless you can be sure tha
=== "CLI"

``` bash
rustus --behind-proxy "yes"
rustus --behind-proxy
```

=== "ENV"

``` bash
export RUSTUS_BEHIND_PROXY="yes"
export RUSTUS_BEHIND_PROXY="true"

rustus
```
Expand Down Expand Up @@ -913,11 +913,11 @@ Otherwise, it will use only one routing key and only one queue!
--hooks-amqp-exchange "rustus" \
--hooks-amqp-exchange-kind "topic" \
--hooks-amqp-routing-key "route66" \
--hooks-amqp-declare-exchange "yes" \
--hooks-amqp-declare-queues "yes" \
--hooks-amqp-durable-exchange "yes" \
--hooks-amqp-durable-queues "yes" \
--hooks-amqp-celery "yes"
--hooks-amqp-declare-exchange \
--hooks-amqp-declare-queues \
--hooks-amqp-durable-exchange \
--hooks-amqp-durable-queues \
--hooks-amqp-celery
```

=== "ENV"
Expand All @@ -928,11 +928,11 @@ Otherwise, it will use only one routing key and only one queue!
export RUSTUS_HOOKS_AMQP_EXCHANGE="rustus"
export RUSTUS_HOOKS_AMQP_EXCHANGE_KIND="topic"
export RUSTUS_HOOKS_AMQP_ROUTING_KEY="route66"
export RUSTUS_HOOKS_AMQP_DECLARE_EXCHANGE="yes"
export RUSTUS_HOOKS_AMQP_DECLARE_QUEUES="yes"
export RUSTUS_HOOKS_AMQP_DURABLE_EXCHANGE="yes"
export RUSTUS_HOOKS_AMQP_DURABLE_QUEUES="yes"
export RUSTUS_HOOKS_AMQP_CELERY="yes"
export RUSTUS_HOOKS_AMQP_DECLARE_EXCHANGE="true"
export RUSTUS_HOOKS_AMQP_DECLARE_QUEUES="true"
export RUSTUS_HOOKS_AMQP_DURABLE_EXCHANGE="true"
export RUSTUS_HOOKS_AMQP_DURABLE_QUEUES="true"
export RUSTUS_HOOKS_AMQP_CELERY="true"

rustus
```
Expand Down Expand Up @@ -1007,7 +1007,7 @@ adds required by Celery headers to every message.
--hooks-amqp-exchange "celery" \
--hooks-amqp-exchange-kind "direct" \
--hooks-amqp-routing-key "celery" \
--hooks-amqp-celery "yes"
--hooks-amqp-celery
```

=== "ENV"
Expand All @@ -1017,7 +1017,7 @@ adds required by Celery headers to every message.
export RUSTUS_HOOKS_AMQP_EXCHANGE="celery"
export RUSTUS_HOOKS_AMQP_EXCHANGE_KIND="direct"
export RUSTUS_HOOKS_AMQP_ROUTING_KEY="celery"
export RUSTUS_HOOKS_AMQP_CELERY="yes"
export RUSTUS_HOOKS_AMQP_CELERY="true"

rustus
```
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ description: Rustus docs
<img src="https://raw.githubusercontent.com/s3rius/rustus/master/imgs/logo_horizontal.svg" alt="logo" width="500">
<div>
<p></p>
<img alt="Docker Image Size (latest by date)" src="https://img.shields.io/docker/image-size/s3rius/rustus?sort=date&style=for-the-badge">
<img alt="Docker Image Version (latest semver)" src="https://img.shields.io/docker/v/s3rius/rustus?style=for-the-badge">
<img alt="GitHub" src="https://img.shields.io/github/license/s3rius/rustus?style=for-the-badge">
<a href="https://hub.docker.com/r/s3rius/rustus/"><img alt="Docker Image Size (latest by date)" src="https://img.shields.io/docker/image-size/s3rius/rustus?sort=date&style=for-the-badge"></a>
<a href="https://hub.docker.com/r/s3rius/rustus/"><img alt="Docker Image Version (latest semver)" src="https://img.shields.io/docker/v/s3rius/rustus?style=for-the-badge"></a>
<a href="https://github.com/s3rius/rustus/blob/master/LICENSE"><img alt="GitHub" src="https://img.shields.io/github/license/s3rius/rustus?style=for-the-badge"></a>
</div>
</div>

Rustus is a [TUS](https://tus.io) protocol implementation that helps you handle file uploads.
Rustus is a production-ready [TUS](https://tus.io) protocol implementation that helps you handle file uploads.

This project has many features that make it easy to integrate with your application.
This project has many features that make it easy to integrate with your existing infrastructure.


## Installation
Expand Down
Loading

0 comments on commit 8437529

Please sign in to comment.