* Add Cloudflare R2 impl

* Bump actix version

* Fix sec issues
This commit is contained in:
Geometrically
2022-10-22 21:23:31 -07:00
committed by GitHub
parent 07edb998e4
commit 6e72be54cb
18 changed files with 265 additions and 181 deletions

View File

@@ -23,9 +23,15 @@ impl S3Host {
) -> Result<S3Host, FileHostingError> {
let mut bucket = Bucket::new(
bucket_name,
Region::Custom {
region: bucket_region.to_string(),
endpoint: url.to_string(),
if bucket_region == "r2" {
Region::R2 {
account_id: url.to_string(),
}
} else {
Region::Custom {
region: bucket_region.to_string(),
endpoint: url.to_string(),
}
},
Credentials::new(
Some(access_token),