core icon indicating copy to clipboard operation
core copied to clipboard

Ensure 3rd-party s3 compatible storage works

Open c-nv-s opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. This will need some investigating, but static backend should allow developers to use their own preferred s3-compatible storage and not just be limited to AWS.

example s3 compatible alternatives: https://github.com/minio/minio https://www.backblaze.com/b2/docs/s3_compatible_api.html https://wasabi.com/s3-compatible-cloud-storage/ https://www.scaleway.com/en/object-storage/

c-nv-s avatar Jun 03 '23 10:06 c-nv-s

I wonder if the current AWS SDK can also be used directly for compatible alternative.

At this moment, there's still an hard-coded value in the s3 implementation that should not be hard-coded:

https://github.com/staticbackendhq/core/blob/18e8620affaf156a6f0b9f59755c371712109e54/storage/s3.go#L17

If it's possible to use these "compatible" providers with the AWS SDK / current code in the s3 implementation once this hard-coded value is in the config package, I guess it's just a matter of configuring the AWS environment variables that matches with the provider:

AWS_ACCESS_KEY_ID=your-aws-key
AWS_SECRET_ACCESS_KEY=your-aws-secret
AWS_SECRET_KEY=your-aws-key
AWS_SES_ENDPOINT=https://email.us-east-1.amazonaws.com
AWS_REGION=us-east-1
AWS_S3_BUCKET=your.bucketname.here
AWS_CDN_URL=https://your.cdnurlhere.com

If someone is interested in testing this. I believe updating the code in the storage/s3.go implementation to use the AWS_REGION instead of the hard-coded one and configuring those value to match a provider and tests would be how I'd do that one.

dstpierre avatar Jun 05 '23 09:06 dstpierre